API Reference of GS2-Enhance 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 | |||
transactionSetting | TransactionSetting | ✓ | Transaction settings | |||
enhanceScript | ScriptSetting | Script to be executed at the time of reinforcement | ||||
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 |
RateModel
Enhancement Rate Model
The enhancement rate is data that defines the materials used for enhancement and the target of enhancement.
Both material data and enhancement target data must be managed in GS2-Inventory. The experience value obtained from the enhancement is recorded in GS2-Inventory metadata in JSON format. Here, it is necessary to describe at which level of the metadata the experience value is stored.
A correction value can be applied to the amount of experience value that can be obtained with a certain probability of great success
during enhancement.
The probability of that draw is also defined in this entity.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
rateModelId | string | ✓ | ~ 1024 chars | Enhance Rate Model GRN | ||
name | string | ✓ | ~ 128 chars | Enhanced Rate Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
targetInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for enhancement targets | ||
acquireExperienceSuffix | string | ✓ | ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience | ||
materialInventoryModelId | string | ✓ | ~ 1024 chars | Inventory model GRN | ||
acquireExperienceHierarchy | List<string> | ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
bonusRates | List<BonusRate> | ~ 1000 items | Experience gain bonus |
RateModelMaster
Enhancement Rate Master Data
The reinforcement rate is data that defines the materials used for reinforcement and the target of reinforcement.
Both material data and reinforcement target data must be managed in GS2-Inventory. The experience value obtained from the reinforcement is recorded in GS2-Inventory metadata in JSON format. Here, it is necessary to describe at which level of the metadata the experience value is stored.
A correction value can be applied to the amount of experience value that can be obtained with a certain probability of great success
during reinforcement.
The probability of that draw is also defined in this entity.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
rateModelId | string | ✓ | ~ 1024 chars | Enhance Rate Model Master GRN | ||
name | string | ✓ | ~ 128 chars | Enhanced Rate Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
targetInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for enhancement targets | ||
acquireExperienceSuffix | string | ✓ | ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience | ||
materialInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for materials | ||
acquireExperienceHierarchy | List<string> | ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience gained as a result of reinforcement | ||
bonusRates | List<BonusRate> | ~ 1000 items | Experience gain bonus | |||
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 |
UnleashRateModel
Unleash Rates
The limit breakthrough rate is the data that defines the limit breakthrough target and the GS2-Grade limit breakthrough model. The data for the limit breakthrough must be managed in GS2-Inventory.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
unleashRateModelId | string | ✓ | ~ 1024 chars | Unleash Rate Model GRN | ||
name | string | ✓ | ~ 128 chars | Enhanced Rate Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
targetInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for unleash targets | ||
gradeModelId | string | ✓ | ~ 1024 chars | Grade model | ||
gradeEntries | List<UnleashRateEntryModel> | ✓ | 1 ~ 1000 items | List of Grade Entry |
UnleashRateModelMaster
Enhancement Rate Master
The limit breakthrough rate is the data that defines the limit breakthrough target and the GS2-Grade limit breakthrough model. The data for the limit breakthrough must be managed in GS2-Inventory.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
unleashRateModelId | string | ✓ | ~ 1024 chars | Unleash Rate Model Master GRN | ||
name | string | ✓ | ~ 128 chars | Unleash Rate Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
targetInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for unleash targets | ||
gradeModelId | string | ✓ | ~ 1024 chars | Grade model | ||
gradeEntries | List<UnleashRateEntryModel> | ✓ | 1 ~ 1000 items | List of Grade Entry | ||
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 |
Progress
Enhance Progress
It is created at the beginning of the enhance and deleted at the end.
When you exit the application in the middle of an enhance, this data will remain. It is possible to resume the game from the ongoing enhance information maintained by the entity.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
progressId | string | ✓ | ~ 1024 chars | Progress GRN | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
rateName | string | ✓ | ~ 128 chars | Rate Model Name | ||
name | string | ✓ | UUID | ~ 36 chars | Conduct ID | |
propertyId | string | ✓ | ~ 1024 chars | Property ID to be enhanced | ||
experienceValue | long | ✓ | ~ 9223372036854775805 | Experience value | ||
rate | float | ✓ | ~ 100.0 | Experience value scale factor | ||
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 |
CurrentRateMaster
Currently available enhanced rate masters
GS2 uses JSON format files for master data management. By uploading the file, the settings can actually be reflected 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 your own 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-Enhance for the JSON file format.Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently available enhance experience rate setting GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
BonusRate
Experience gain bonus
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
rate | float | ✓ | 1.0 | ~ 10000 | Experience bonus multiplier (1.0 = no bonus) | |
weight | int | ✓ | 1 | ~ 2147483645 | lottery weight |
Material
Balance Parameter Value Model
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
materialItemSetId | string | ✓ | ~ 1024 chars | Quantity of items held per expiration date GRN | ||
count | int | ✓ | 1 | ~ 2147483645 | Number of consumption |
UnleashRateEntryModel
Unleash rate entry model
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
gradeValue | long | ✓ | 1 ~ 1000 | Target grade | ||
needCount | int | ✓ | 1 ~ 1000 | How many items of the same type to consume |
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 | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name |
Enumeration type definition to specify as 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 | ||
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Namespace GRN |
Enumeration type definition to specify as 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 |
TransactionSetting
Transaction settings
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | Automatically run issued transactions on the server side, or | ||
distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor namespace used for transaction execution | |
queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | Namespace in GS2-JobQueue used to run the transaction |
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeNamespacesRequest;
import io.gs2.enhance.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.DescribeNamespacesRequest;
using Gs2.Gs2Enhance.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Enhance.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 enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.describe_namespaces(
enhance.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('enhance')
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('enhance')
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 | |||
transactionSetting | TransactionSetting | ✓ | Transaction settings | |||
enhanceScript | ScriptSetting | Script to be executed at the time of reinforcement | ||||
logSetting | LogSetting | Log output settings | ||||
enableDirectEnhance | bool | ✓ | true | DirectEnhance is available | ||
queueNamespaceId | string | ~ 1024 chars | Namespace in GS2-JobQueue used to run the transaction | |||
keyId | string | ~ 1024 chars | GS2-Key namespace used to issue transactions |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&enhance.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
TransactionSetting: &enhance.TransactionSetting{
EnableAutoRun: pointy.Bool(false),
QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
},
EnhanceScript: nil,
LogSetting: &enhance.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName(self::namespace1)
->withDescription(null)
->withTransactionSetting((new \Gs2\Enhance\Model\TransactionSetting())
->withEnableAutoRun(False)
->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0001"))
->withEnhanceScript(null)
->withLogSetting((new \Gs2\Enhance\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CreateNamespaceRequest;
import io.gs2.enhance.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new io.gs2.enhance.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.withEnhanceScript(null)
.withLogSetting(new io.gs2.enhance.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.CreateNamespaceRequest;
using Gs2.Gs2Enhance.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Enhance.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithTransactionSetting(new Gs2.Gs2Enhance.Model.TransactionSetting()
.WithEnableAutoRun(false)
.WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.WithEnhanceScript(null)
.WithLogSetting(new Gs2.Gs2Enhance.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Enhance.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new Gs2Enhance.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.withEnhanceScript(null)
.withLogSetting(new Gs2Enhance.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.create_namespace(
enhance.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_transaction_setting(
enhance.TransactionSetting()
.with_enable_auto_run(False)
.with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001')
.with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001'))
.with_enhance_script(None)
.with_log_setting(
enhance.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.create_namespace({
name="namespace1",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
},
enhanceScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('enhance')
api_result_handler = client.create_namespace_async({
name="namespace1",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
},
enhanceScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&enhance.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName(self::namespace1)
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetNamespaceStatusRequest;
import io.gs2.enhance.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Enhance.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Enhance.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Enhance.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.get_namespace_status(
enhance.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.get_namespace_status({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('enhance')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
getNamespace
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&enhance.GetNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetNamespaceRequest;
import io.gs2.enhance.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.GetNamespaceRequest;
using Gs2.Gs2Enhance.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Enhance.Request.GetNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Enhance.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.get_namespace(
enhance.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.get_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('enhance')
api_result_handler = client.get_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateNamespace
Update namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
transactionSetting | TransactionSetting | ✓ | Transaction settings | |||
enhanceScript | ScriptSetting | Script to be executed at the time of reinforcement | ||||
logSetting | LogSetting | Log output settings | ||||
enableDirectEnhance | bool | ✓ | true | DirectEnhance is available | ||
queueNamespaceId | string | ~ 1024 chars | Namespace in GS2-JobQueue used to run the transaction | |||
keyId | string | ~ 1024 chars | GS2-Key namespace used to issue transactions |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&enhance.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
TransactionSetting: &enhance.TransactionSetting{
EnableAutoRun: pointy.Bool(false),
QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"),
},
EnhanceScript: nil,
LogSetting: &enhance.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName(self::namespace1)
->withDescription("description1")
->withTransactionSetting((new \Gs2\Enhance\Model\TransactionSetting())
->withEnableAutoRun(False)
->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0002"))
->withEnhanceScript(null)
->withLogSetting((new \Gs2\Enhance\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UpdateNamespaceRequest;
import io.gs2.enhance.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new io.gs2.enhance.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.withEnhanceScript(null)
.withLogSetting(new io.gs2.enhance.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.UpdateNamespaceRequest;
using Gs2.Gs2Enhance.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Enhance.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithTransactionSetting(new Gs2.Gs2Enhance.Model.TransactionSetting()
.WithEnableAutoRun(false)
.WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.WithEnhanceScript(null)
.WithLogSetting(new Gs2.Gs2Enhance.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Enhance.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new Gs2Enhance.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.withEnhanceScript(null)
.withLogSetting(new Gs2Enhance.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.update_namespace(
enhance.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_transaction_setting(
enhance.TransactionSetting()
.with_enable_auto_run(False)
.with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002')
.with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002'))
.with_enhance_script(None)
.with_log_setting(
enhance.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
},
enhanceScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('enhance')
api_result_handler = client.update_namespace_async({
namespaceName="namespace1",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
},
enhanceScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&enhance.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DeleteNamespaceRequest;
import io.gs2.enhance.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.DeleteNamespaceRequest;
using Gs2.Gs2Enhance.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Enhance.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Enhance.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.delete_namespace(
enhance.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.delete_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('enhance')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DumpUserDataByUserIdRequest;
import io.gs2.enhance.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Enhance.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Enhance.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.dump_user_data_by_user_id(
enhance.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
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('enhance')
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.enhance.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Enhance.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Enhance.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
enhance.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
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('enhance')
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CleanUserDataByUserIdRequest;
import io.gs2.enhance.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Enhance.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Enhance.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.clean_user_data_by_user_id(
enhance.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
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('enhance')
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.enhance.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Enhance.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Enhance.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
enhance.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
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('enhance')
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.enhance.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Enhance.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Enhance.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 enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
enhance.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('enhance')
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('enhance')
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.ImportUserDataByUserIdRequest;
import io.gs2.enhance.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Enhance.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Enhance.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.import_user_data_by_user_id(
enhance.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('enhance')
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('enhance')
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&enhance.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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CheckImportUserDataByUserIdRequest;
import io.gs2.enhance.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Enhance.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Enhance.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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Enhance.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 enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
enhance.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('enhance')
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('enhance')
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;
describeRateModels
Get list of enhanced rate models
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<RateModel> | List of Enhanced Rate Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.DescribeRateModels(
&enhance.DescribeRateModelsRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DescribeRateModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRateModels(
(new DescribeRateModelsRequest())
->withNamespaceName(self::namespace1)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeRateModelsRequest;
import io.gs2.enhance.result.DescribeRateModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
DescribeRateModelsResult result = client.describeRateModels(
new DescribeRateModelsRequest()
.withNamespaceName("namespace1")
);
List<RateModel> 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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.DescribeRateModelsRequest;
using Gs2.Gs2Enhance.Result.DescribeRateModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.DescribeRateModelsResult> asyncResult = null;
yield return client.DescribeRateModels(
new Gs2.Gs2Enhance.Request.DescribeRateModelsRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.describeRateModels(
new Gs2Enhance.DescribeRateModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.describe_rate_models(
enhance.DescribeRateModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.describe_rate_models({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('enhance')
api_result_handler = client.describe_rate_models_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
getRateModel
Get Enhanced Rate Model
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
rateName | string | ✓ | ~ 128 chars | Enhanced Rate Name |
Result
Type | Description | |
---|---|---|
item | RateModel | Enhanced Rate Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.GetRateModel(
&enhance.GetRateModelRequest {
NamespaceName: pointy.String("namespace1"),
RateName: pointy.String("character-level"),
}
)
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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetRateModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRateModel(
(new GetRateModelRequest())
->withNamespaceName(self::namespace1)
->withRateName("character-level")
);
$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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetRateModelRequest;
import io.gs2.enhance.result.GetRateModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
GetRateModelResult result = client.getRateModel(
new GetRateModelRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
);
RateModel 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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.GetRateModelRequest;
using Gs2.Gs2Enhance.Result.GetRateModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.GetRateModelResult> asyncResult = null;
yield return client.GetRateModel(
new Gs2.Gs2Enhance.Request.GetRateModelRequest()
.WithNamespaceName("namespace1")
.WithRateName("character-level"),
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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.getRateModel(
new Gs2Enhance.GetRateModelRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.get_rate_model(
enhance.GetRateModelRequest()
.with_namespace_name(self.hash1)
.with_rate_name('character-level')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.get_rate_model({
namespaceName="namespace1",
rateName="character-level",
})
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('enhance')
api_result_handler = client.get_rate_model_async({
namespaceName="namespace1",
rateName="character-level",
})
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;
describeRateModelMasters
Get list of enhanced rate 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<RateModelMaster> | List of Enhanced Rate Master |
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/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.DescribeRateModelMasters(
&enhance.DescribeRateModelMastersRequest {
NamespaceName: pointy.String("namespace1"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DescribeRateModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRateModelMasters(
(new DescribeRateModelMastersRequest())
->withNamespaceName(self::namespace1)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeRateModelMastersRequest;
import io.gs2.enhance.result.DescribeRateModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
DescribeRateModelMastersResult result = client.describeRateModelMasters(
new DescribeRateModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<RateModelMaster> 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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.DescribeRateModelMastersRequest;
using Gs2.Gs2Enhance.Result.DescribeRateModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.DescribeRateModelMastersResult> asyncResult = null;
yield return client.DescribeRateModelMasters(
new Gs2.Gs2Enhance.Request.DescribeRateModelMastersRequest()
.WithNamespaceName("namespace1")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.describeRateModelMasters(
new Gs2Enhance.DescribeRateModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.describe_rate_model_masters(
enhance.DescribeRateModelMastersRequest()
.with_namespace_name(self.hash1)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.describe_rate_model_masters({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('enhance')
api_result_handler = client.describe_rate_model_masters_async({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createRateModelMaster
Create a new Enhanced Rate Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Enhanced Rate Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
targetInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for enhancement targets | ||
acquireExperienceSuffix | string | ✓ | ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience | ||
materialInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for materials | ||
acquireExperienceHierarchy | List<string> | ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience gained as a result of reinforcement | ||
bonusRates | List<BonusRate> | ~ 1000 items | Experience gain bonus |
Result
Type | Description | |
---|---|---|
item | RateModelMaster | Created Enhanced Rate Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.CreateRateModelMaster(
&enhance.CreateRateModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("character-level"),
Description: nil,
Metadata: pointy.String("CHARACTER_LEVEL"),
TargetInventoryModelId: pointy.String("grn:inventory:character"),
AcquireExperienceSuffix: pointy.String(":level"),
MaterialInventoryModelId: pointy.String("grn:inventory:material"),
AcquireExperienceHierarchy: []*string{
pointy.String("experience"),
},
ExperienceModelId: pointy.String("grn:experience:level"),
BonusRates: []enhance.BonusRate{
enhance.BonusRate{
Rate: pointy.Float32(1.0),
Weight: pointy.Int32(90),
},
enhance.BonusRate{
Rate: pointy.Float32(1.5),
Weight: pointy.Int32(9),
},
enhance.BonusRate{
Rate: pointy.Float32(2.0),
Weight: pointy.Int32(1),
},
},
}
)
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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CreateRateModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createRateModelMaster(
(new CreateRateModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("character-level")
->withDescription(null)
->withMetadata("CHARACTER_LEVEL")
->withTargetInventoryModelId("grn:inventory:character")
->withAcquireExperienceSuffix(":level")
->withMaterialInventoryModelId("grn:inventory:material")
->withAcquireExperienceHierarchy([
"experience",
])
->withExperienceModelId("grn:experience:level")
->withBonusRates([
(new \Gs2\Enhance\Model\BonusRate())
->withRate(1.0)
->withWeight(90),
(new \Gs2\Enhance\Model\BonusRate())
->withRate(1.5)
->withWeight(9),
(new \Gs2\Enhance\Model\BonusRate())
->withRate(2.0)
->withWeight(1),
])
);
$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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CreateRateModelMasterRequest;
import io.gs2.enhance.result.CreateRateModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
CreateRateModelMasterResult result = client.createRateModelMaster(
new CreateRateModelMasterRequest()
.withNamespaceName("namespace1")
.withName("character-level")
.withDescription(null)
.withMetadata("CHARACTER_LEVEL")
.withTargetInventoryModelId("grn:inventory:character")
.withAcquireExperienceSuffix(":level")
.withMaterialInventoryModelId("grn:inventory:material")
.withAcquireExperienceHierarchy(Arrays.asList(
"experience"
))
.withExperienceModelId("grn:experience:level")
.withBonusRates(Arrays.asList(
new io.gs2.enhance.model.BonusRate()
.withRate(1.0f)
.withWeight(90),
new io.gs2.enhance.model.BonusRate()
.withRate(1.5f)
.withWeight(9),
new io.gs2.enhance.model.BonusRate()
.withRate(2.0f)
.withWeight(1)
))
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.CreateRateModelMasterRequest;
using Gs2.Gs2Enhance.Result.CreateRateModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.CreateRateModelMasterResult> asyncResult = null;
yield return client.CreateRateModelMaster(
new Gs2.Gs2Enhance.Request.CreateRateModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("character-level")
.WithDescription(null)
.WithMetadata("CHARACTER_LEVEL")
.WithTargetInventoryModelId("grn:inventory:character")
.WithAcquireExperienceSuffix(":level")
.WithMaterialInventoryModelId("grn:inventory:material")
.WithAcquireExperienceHierarchy(new string[] {
"experience",
})
.WithExperienceModelId("grn:experience:level")
.WithBonusRates(new Gs2.Gs2Enhance.Model.BonusRate[] {
new Gs2.Gs2Enhance.Model.BonusRate()
.WithRate(1.0f)
.WithWeight(90),
new Gs2.Gs2Enhance.Model.BonusRate()
.WithRate(1.5f)
.WithWeight(9),
new Gs2.Gs2Enhance.Model.BonusRate()
.WithRate(2.0f)
.WithWeight(1),
}),
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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.createRateModelMaster(
new Gs2Enhance.CreateRateModelMasterRequest()
.withNamespaceName("namespace1")
.withName("character-level")
.withDescription(null)
.withMetadata("CHARACTER_LEVEL")
.withTargetInventoryModelId("grn:inventory:character")
.withAcquireExperienceSuffix(":level")
.withMaterialInventoryModelId("grn:inventory:material")
.withAcquireExperienceHierarchy([
"experience",
])
.withExperienceModelId("grn:experience:level")
.withBonusRates([
new Gs2Enhance.model.BonusRate()
.withRate(1.0)
.withWeight(90),
new Gs2Enhance.model.BonusRate()
.withRate(1.5)
.withWeight(9),
new Gs2Enhance.model.BonusRate()
.withRate(2.0)
.withWeight(1),
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.create_rate_model_master(
enhance.CreateRateModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('character-level')
.with_description(None)
.with_metadata('CHARACTER_LEVEL')
.with_target_inventory_model_id('grn:inventory:character')
.with_acquire_experience_suffix(':level')
.with_material_inventory_model_id('grn:inventory:material')
.with_acquire_experience_hierarchy([
'experience',
])
.with_experience_model_id('grn:experience:level')
.with_bonus_rates([
enhance.BonusRate()
.with_rate(1.0)
.with_weight(90),
enhance.BonusRate()
.with_rate(1.5)
.with_weight(9),
enhance.BonusRate()
.with_rate(2.0)
.with_weight(1),
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.create_rate_model_master({
namespaceName="namespace1",
name="character-level",
description=nil,
metadata="CHARACTER_LEVEL",
targetInventoryModelId="grn:inventory:character",
acquireExperienceSuffix=":level",
materialInventoryModelId="grn:inventory:material",
acquireExperienceHierarchy={
"experience"
},
experienceModelId="grn:experience:level",
bonusRates={
{
rate=1.0,
weight=90,
},
{
rate=1.5,
weight=9,
},
{
rate=2.0,
weight=1,
}
},
})
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('enhance')
api_result_handler = client.create_rate_model_master_async({
namespaceName="namespace1",
name="character-level",
description=nil,
metadata="CHARACTER_LEVEL",
targetInventoryModelId="grn:inventory:character",
acquireExperienceSuffix=":level",
materialInventoryModelId="grn:inventory:material",
acquireExperienceHierarchy={
"experience"
},
experienceModelId="grn:experience:level",
bonusRates={
{
rate=1.0,
weight=90,
},
{
rate=1.5,
weight=9,
},
{
rate=2.0,
weight=1,
}
},
})
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;
getRateModelMaster
Get Enhanced Rate Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
rateName | string | ✓ | ~ 128 chars | Enhanced Rate Name |
Result
Type | Description | |
---|---|---|
item | RateModelMaster | Enhanced Rate Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.GetRateModelMaster(
&enhance.GetRateModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
RateName: pointy.String("character-level"),
}
)
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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetRateModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRateModelMaster(
(new GetRateModelMasterRequest())
->withNamespaceName(self::namespace1)
->withRateName("character-level")
);
$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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetRateModelMasterRequest;
import io.gs2.enhance.result.GetRateModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
GetRateModelMasterResult result = client.getRateModelMaster(
new GetRateModelMasterRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.GetRateModelMasterRequest;
using Gs2.Gs2Enhance.Result.GetRateModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.GetRateModelMasterResult> asyncResult = null;
yield return client.GetRateModelMaster(
new Gs2.Gs2Enhance.Request.GetRateModelMasterRequest()
.WithNamespaceName("namespace1")
.WithRateName("character-level"),
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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.getRateModelMaster(
new Gs2Enhance.GetRateModelMasterRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.get_rate_model_master(
enhance.GetRateModelMasterRequest()
.with_namespace_name(self.hash1)
.with_rate_name('character-level')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.get_rate_model_master({
namespaceName="namespace1",
rateName="character-level",
})
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('enhance')
api_result_handler = client.get_rate_model_master_async({
namespaceName="namespace1",
rateName="character-level",
})
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;
updateRateModelMaster
Update Enhanced Rate Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
rateName | string | ✓ | ~ 128 chars | Enhanced Rate Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
targetInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for enhancement targets | ||
acquireExperienceSuffix | string | ✓ | ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience | ||
materialInventoryModelId | string | ✓ | ~ 1024 chars | Inventory available for materials | ||
acquireExperienceHierarchy | List<string> | ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience gained as a result of reinforcement | ||
bonusRates | List<BonusRate> | ~ 1000 items | Experience gain bonus |
Result
Type | Description | |
---|---|---|
item | RateModelMaster | Updated Enhanced Rate Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.UpdateRateModelMaster(
&enhance.UpdateRateModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
RateName: pointy.String("character-level"),
Description: nil,
Metadata: pointy.String("CHARACTER_LEVEL2"),
TargetInventoryModelId: pointy.String("grn:inventory:character2"),
AcquireExperienceSuffix: pointy.String(":level2"),
MaterialInventoryModelId: pointy.String("grn:inventory:material2"),
AcquireExperienceHierarchy: []*string{
pointy.String("experience2"),
},
ExperienceModelId: pointy.String("grn:experience:level2"),
BonusRates: []enhance.BonusRate{
enhance.BonusRate{
Rate: pointy.Float32(1.05),
Weight: pointy.Int32(905),
},
enhance.BonusRate{
Rate: pointy.Float32(1.55),
Weight: pointy.Int32(95),
},
enhance.BonusRate{
Rate: pointy.Float32(2.05),
Weight: pointy.Int32(15),
},
},
}
)
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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UpdateRateModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateRateModelMaster(
(new UpdateRateModelMasterRequest())
->withNamespaceName(self::namespace1)
->withRateName("character-level")
->withDescription(null)
->withMetadata("CHARACTER_LEVEL2")
->withTargetInventoryModelId("grn:inventory:character2")
->withAcquireExperienceSuffix(":level2")
->withMaterialInventoryModelId("grn:inventory:material2")
->withAcquireExperienceHierarchy([
"experience2",
])
->withExperienceModelId("grn:experience:level2")
->withBonusRates([
(new \Gs2\Enhance\Model\BonusRate())
->withRate(1.05)
->withWeight(905),
(new \Gs2\Enhance\Model\BonusRate())
->withRate(1.55)
->withWeight(95),
(new \Gs2\Enhance\Model\BonusRate())
->withRate(2.05)
->withWeight(15),
])
);
$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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UpdateRateModelMasterRequest;
import io.gs2.enhance.result.UpdateRateModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
UpdateRateModelMasterResult result = client.updateRateModelMaster(
new UpdateRateModelMasterRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
.withDescription(null)
.withMetadata("CHARACTER_LEVEL2")
.withTargetInventoryModelId("grn:inventory:character2")
.withAcquireExperienceSuffix(":level2")
.withMaterialInventoryModelId("grn:inventory:material2")
.withAcquireExperienceHierarchy(Arrays.asList(
"experience2"
))
.withExperienceModelId("grn:experience:level2")
.withBonusRates(Arrays.asList(
new io.gs2.enhance.model.BonusRate()
.withRate(1.05f)
.withWeight(905),
new io.gs2.enhance.model.BonusRate()
.withRate(1.55f)
.withWeight(95),
new io.gs2.enhance.model.BonusRate()
.withRate(2.05f)
.withWeight(15)
))
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.UpdateRateModelMasterRequest;
using Gs2.Gs2Enhance.Result.UpdateRateModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.UpdateRateModelMasterResult> asyncResult = null;
yield return client.UpdateRateModelMaster(
new Gs2.Gs2Enhance.Request.UpdateRateModelMasterRequest()
.WithNamespaceName("namespace1")
.WithRateName("character-level")
.WithDescription(null)
.WithMetadata("CHARACTER_LEVEL2")
.WithTargetInventoryModelId("grn:inventory:character2")
.WithAcquireExperienceSuffix(":level2")
.WithMaterialInventoryModelId("grn:inventory:material2")
.WithAcquireExperienceHierarchy(new string[] {
"experience2",
})
.WithExperienceModelId("grn:experience:level2")
.WithBonusRates(new Gs2.Gs2Enhance.Model.BonusRate[] {
new Gs2.Gs2Enhance.Model.BonusRate()
.WithRate(1.05f)
.WithWeight(905),
new Gs2.Gs2Enhance.Model.BonusRate()
.WithRate(1.55f)
.WithWeight(95),
new Gs2.Gs2Enhance.Model.BonusRate()
.WithRate(2.05f)
.WithWeight(15),
}),
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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.updateRateModelMaster(
new Gs2Enhance.UpdateRateModelMasterRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
.withDescription(null)
.withMetadata("CHARACTER_LEVEL2")
.withTargetInventoryModelId("grn:inventory:character2")
.withAcquireExperienceSuffix(":level2")
.withMaterialInventoryModelId("grn:inventory:material2")
.withAcquireExperienceHierarchy([
"experience2",
])
.withExperienceModelId("grn:experience:level2")
.withBonusRates([
new Gs2Enhance.model.BonusRate()
.withRate(1.05)
.withWeight(905),
new Gs2Enhance.model.BonusRate()
.withRate(1.55)
.withWeight(95),
new Gs2Enhance.model.BonusRate()
.withRate(2.05)
.withWeight(15),
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.update_rate_model_master(
enhance.UpdateRateModelMasterRequest()
.with_namespace_name(self.hash1)
.with_rate_name('character-level')
.with_description(None)
.with_metadata('CHARACTER_LEVEL2')
.with_target_inventory_model_id('grn:inventory:character2')
.with_acquire_experience_suffix(':level2')
.with_material_inventory_model_id('grn:inventory:material2')
.with_acquire_experience_hierarchy([
'experience2',
])
.with_experience_model_id('grn:experience:level2')
.with_bonus_rates([
enhance.BonusRate()
.with_rate(1.05)
.with_weight(905),
enhance.BonusRate()
.with_rate(1.55)
.with_weight(95),
enhance.BonusRate()
.with_rate(2.05)
.with_weight(15),
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.update_rate_model_master({
namespaceName="namespace1",
rateName="character-level",
description=nil,
metadata="CHARACTER_LEVEL2",
targetInventoryModelId="grn:inventory:character2",
acquireExperienceSuffix=":level2",
materialInventoryModelId="grn:inventory:material2",
acquireExperienceHierarchy={
"experience2"
},
experienceModelId="grn:experience:level2",
bonusRates={
{
rate=1.05,
weight=905,
},
{
rate=1.55,
weight=95,
},
{
rate=2.05,
weight=15,
}
},
})
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('enhance')
api_result_handler = client.update_rate_model_master_async({
namespaceName="namespace1",
rateName="character-level",
description=nil,
metadata="CHARACTER_LEVEL2",
targetInventoryModelId="grn:inventory:character2",
acquireExperienceSuffix=":level2",
materialInventoryModelId="grn:inventory:material2",
acquireExperienceHierarchy={
"experience2"
},
experienceModelId="grn:experience:level2",
bonusRates={
{
rate=1.05,
weight=905,
},
{
rate=1.55,
weight=95,
},
{
rate=2.05,
weight=15,
}
},
})
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;
deleteRateModelMaster
Delete Enhanced Rate Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
rateName | string | ✓ | ~ 128 chars | Enhanced Rate Name |
Result
Type | Description | |
---|---|---|
item | RateModelMaster | Deleted Enhanced Rate Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.DeleteRateModelMaster(
&enhance.DeleteRateModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
RateName: pointy.String("character-level"),
}
)
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\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DeleteRateModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteRateModelMaster(
(new DeleteRateModelMasterRequest())
->withNamespaceName(self::namespace1)
->withRateName("character-level")
);
$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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DeleteRateModelMasterRequest;
import io.gs2.enhance.result.DeleteRateModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient(session);
try {
DeleteRateModelMasterResult result = client.deleteRateModelMaster(
new DeleteRateModelMasterRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient;
using Gs2.Gs2Enhance.Request.DeleteRateModelMasterRequest;
using Gs2.Gs2Enhance.Result.DeleteRateModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2EnhanceRestClient(session);
AsyncResult<Gs2.Gs2Enhance.Result.DeleteRateModelMasterResult> asyncResult = null;
yield return client.DeleteRateModelMaster(
new Gs2.Gs2Enhance.Request.DeleteRateModelMasterRequest()
.WithNamespaceName("namespace1")
.WithRateName("character-level"),
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 Gs2Enhance from '@/gs2/enhance';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Enhance.Gs2EnhanceRestClient(session);
try {
const result = await client.deleteRateModelMaster(
new Gs2Enhance.DeleteRateModelMasterRequest()
.withNamespaceName("namespace1")
.withRateName("character-level")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import enhance
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = enhance.Gs2EnhanceRestClient(session)
try:
result = client.delete_rate_model_master(
enhance.DeleteRateModelMasterRequest()
.with_namespace_name(self.hash1)
.with_rate_name('character-level')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('enhance')
api_result = client.delete_rate_model_master({
namespaceName="namespace1",
rateName="character-level",
})
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('enhance')
api_result_handler = client.delete_rate_model_master_async({
namespaceName="namespace1",
rateName="character-level",
})
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;
describeUnleashRateModels
Get list of unleash rate models
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<UnleashRateModel> | List of Unleash Rate Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
Session: &session,
}
result, err := client.DescribeUnleashRateModels(