API Reference of GS2-Grade 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 | ||||
changeGradeScript | ScriptSetting | Script to be executed when grade changes | ||||
logSetting | LogSetting | Log output settings | ||||
createdAt | long | ✓ | Datetime of creation | |||
updatedAt | long | ✓ | Datetime of last update | |||
revision | long | 0 | ~ 9223372036854775805 | Revision |
GradeModelMaster
Grade Model Master
An grade model is an entity that sets the threshold of grade required for rank advancement and for each default and maximum rank cap.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
gradeModelId | string | ✓ | ~ 1024 chars | Grade Model Master GRN | ||
name | string | ✓ | ~ 128 chars | Grade Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
defaultGrades | List<DefaultGradeModel> | ~ 100 items | List of Default grade model | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience model GRN to link grade and rank cap | ||
gradeEntries | List<GradeEntryModel> | ~ 100 items | List of Grade entry | |||
acquireActionRates | List<AcquireActionRate> | ~ 100 items | List of Remuneration addition table | |||
createdAt | long | ✓ | Datetime of creation | |||
updatedAt | long | ✓ | Datetime of last update | |||
revision | long | 0 | ~ 9223372036854775805 | Revision |
GradeModel
Grade Model
An grade model is an entity that sets the threshold of grade required for rank advancement and for each default and maximum rank cap.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
gradeModelId | string | ✓ | ~ 1024 chars | Grade Model GRN | ||
name | string | ✓ | ~ 128 chars | Grade Model Name | ||
metadata | string | ~ 2048 chars | metadata | |||
defaultGrades | List<DefaultGradeModel> | ~ 100 items | List of Default grade model | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience model GRN to link grade and rank cap | ||
gradeEntries | List<GradeEntryModel> | ✓ | 1 ~ 100 items | List of Grade entry | ||
acquireActionRates | List<AcquireActionRate> | ~ 100 items | List of Remuneration addition table |
Status
Status
A status is an entity that exists for each property ID and holds the value of the current grade.
The property ID is a status-specific ID and can be set to any value by the developer. It is strongly recommended that the value be the same as the property ID of the GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
statusId | string | ✓ | ~ 1024 chars | Status GRN | ||
gradeName | string | ✓ | ~ 128 chars | Grade Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
propertyId | string | ✓ | ~ 1024 chars | Property ID | ||
gradeValue | long | ✓ | 1 | 1 ~ 9223372036854775805 | Current Grade | |
createdAt | long | ✓ | Datetime of creation | |||
updatedAt | long | ✓ | Datetime of last update | |||
revision | long | 0 | ~ 9223372036854775805 | Revision |
DefaultGradeModel
Default grade model
You can set the default grade value according to the match of the property ID regular expression when creating a new grade.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
propertyIdRegex | string | ✓ | ~ 1024 chars | Regular expression for property ID to which default value is applied | ||
defaultGradeValue | long | ✓ | ~ 9223372036854775805 | Default grade value |
GradeEntryModel
Grade Entry
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
metadata | string | ~ 2048 chars | metadata | |||
rankCapValue | long | ✓ | ~ 9223372036854775805 | Rank cap value to be set in GS2-Experience | ||
propertyIdRegex | string | ✓ | ~ 1024 chars | Regular expression for property ID that can be used for grade up | ||
gradeUpPropertyIdRegex | string | ✓ | ~ 1024 chars | Regular expression for property ID that can be used for grade up |
AcquireActionRate
Remuneration addition table master
You can adjust the amount of rewards according to the rank.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Remuneration addition table name | ||
mode | enum [ “double”, “big” ] | ✓ | “double” | ~ 128 chars | Remuneration addition table type | |
rates | List<double> | {mode} == “double” | ✓ | 1 ~ 1000 items | Amount added per grade (multiplier) | |
bigRates | List<string> | {mode} == “big” | ✓ | 1 ~ 1000 items | Amount added per grade (multiplier) |
CurrentGradeMaster
Currently available master data
GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Please refer to the documentation for the format of the JSON file.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently prize table grade setting GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
AcquireAction
Acquire Action
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 |
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 |
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.DescribeNamespacesRequest;
import io.gs2.grade.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.DescribeNamespacesRequest;
using Gs2.Gs2Grade.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Grade.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 grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.describe_namespaces(
grade.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('grade')
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;
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 | ||||
changeGradeScript | ScriptSetting | Script to be executed when grade changes | ||||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&grade.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
TransactionSetting: nil,
ChangeGradeScript: nil,
LogSetting: &grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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(null)
->withChangeGradeScript(null)
->withLogSetting((new \Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.CreateNamespaceRequest;
import io.gs2.grade.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(null)
.withChangeGradeScript(null)
.withLogSetting(new io.gs2.grade.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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.CreateNamespaceRequest;
using Gs2.Gs2Grade.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Grade.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithTransactionSetting(null)
.WithChangeGradeScript(null)
.WithLogSetting(new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Grade.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(null)
.withChangeGradeScript(null)
.withLogSetting(new Gs2Grade.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 grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.create_namespace(
grade.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_transaction_setting(None)
.with_change_grade_script(None)
.with_log_setting(
grade.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('grade')
api_result = client.create_namespace({
name="namespace1",
description=nil,
transactionSetting=nil,
changeGradeScript=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;
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.GetNamespaceStatusRequest;
import io.gs2.grade.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Grade.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Grade.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.get_namespace_status(
grade.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
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;
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.GetNamespaceRequest;
import io.gs2.grade.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.GetNamespaceRequest;
using Gs2.Gs2Grade.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Grade.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.get_namespace(
grade.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
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;
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 | ||||
changeGradeScript | ScriptSetting | Script to be executed when grade changes | ||||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&grade.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
TransactionSetting: nil,
ChangeGradeScript: &grade.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003"),
},
LogSetting: &grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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(null)
->withChangeGradeScript((new \Gs2\Grade\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1002")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1003"))
->withLogSetting((new \Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.UpdateNamespaceRequest;
import io.gs2.grade.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(null)
.withChangeGradeScript(new io.gs2.grade.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003"))
.withLogSetting(new io.gs2.grade.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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.UpdateNamespaceRequest;
using Gs2.Gs2Grade.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Grade.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithTransactionSetting(null)
.WithChangeGradeScript(new Gs2.Gs2Grade.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003"))
.WithLogSetting(new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Grade.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(null)
.withChangeGradeScript(new Gs2Grade.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003"))
.withLogSetting(new Gs2Grade.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 grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.update_namespace(
grade.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_transaction_setting(None)
.with_change_grade_script(
grade.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003'))
.with_log_setting(
grade.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('grade')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
transactionSetting=nil,
changeGradeScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003",
},
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;
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.DeleteNamespaceRequest;
import io.gs2.grade.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.DeleteNamespaceRequest;
using Gs2.Gs2Grade.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Grade.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.delete_namespace(
grade.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
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;
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.DumpUserDataByUserIdRequest;
import io.gs2.grade.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Grade.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Grade.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.dump_user_data_by_user_id(
grade.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
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
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.grade.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Grade.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Grade.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
grade.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
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;
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.CleanUserDataByUserIdRequest;
import io.gs2.grade.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Grade.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Grade.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.clean_user_data_by_user_id(
grade.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
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
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.grade.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Grade.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Grade.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
grade.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
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
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.grade.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Grade.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Grade.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 grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
grade.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('grade')
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;
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.ImportUserDataByUserIdRequest;
import io.gs2.grade.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Grade.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Grade.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.import_user_data_by_user_id(
grade.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('grade')
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
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&grade.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\Grade\Gs2GradeRestClient;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.CheckImportUserDataByUserIdRequest;
import io.gs2.grade.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Grade.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Grade.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Grade.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 grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
grade.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('grade')
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;
describeGradeModelMasters
Get list of grade model masters
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<GradeModelMaster> | List of Grade Model Masters |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DescribeGradeModelMasters(
&grade.DescribeGradeModelMastersRequest {
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\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\DescribeGradeModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeGradeModelMasters(
(new DescribeGradeModelMastersRequest())
->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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.DescribeGradeModelMastersRequest;
import io.gs2.grade.result.DescribeGradeModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
DescribeGradeModelMastersResult result = client.describeGradeModelMasters(
new DescribeGradeModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<GradeModelMaster> 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.DescribeGradeModelMastersRequest;
using Gs2.Gs2Grade.Result.DescribeGradeModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.DescribeGradeModelMastersResult> asyncResult = null;
yield return client.DescribeGradeModelMasters(
new Gs2.Gs2Grade.Request.DescribeGradeModelMastersRequest()
.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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.describeGradeModelMasters(
new Gs2Grade.DescribeGradeModelMastersRequest()
.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 grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.describe_grade_model_masters(
grade.DescribeGradeModelMastersRequest()
.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('grade')
api_result = client.describe_grade_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;
createGradeModelMaster
Create new grade model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Grade Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
defaultGrades | List<DefaultGradeModel> | ~ 100 items | List of Default grade model | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience model GRN to link grade and rank cap | ||
gradeEntries | List<GradeEntryModel> | ~ 100 items | List of Grade entry | |||
acquireActionRates | List<AcquireActionRate> | ~ 100 items | List of Remuneration addition table |
Result
Type | Description | |
---|---|---|
item | GradeModelMaster | Created Grade Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.CreateGradeModelMaster(
&grade.CreateGradeModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("grade-model-0001"),
Description: nil,
Metadata: nil,
DefaultGrades: []grade.DefaultGradeModel{
grade.DefaultGradeModel{
PropertyIdRegex: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*"),
DefaultGradeValue: pointy.Int64(2),
},
},
ExperienceModelId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001"),
GradeEntries: []grade.GradeEntryModel{
grade.GradeEntryModel{
Metadata: pointy.String("GRADE_ENTRY_METADATA"),
RankCapValue: pointy.Int64(50),
PropertyIdRegex: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*"),
GradeUpPropertyIdRegex: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"),
},
},
AcquireActionRates: []grade.AcquireActionRate{
grade.AcquireActionRate{
Name: pointy.String("rate-0001"),
Rates: []*float64{
pointy.Float64(1.0),
pointy.Float64(1.5),
pointy.Float64(2.0),
},
},
grade.AcquireActionRate{
Name: pointy.String("rate-0002"),
Rates: []*float64{
pointy.Float64(10.0),
pointy.Float64(15.5),
pointy.Float64(20.0),
},
},
},
}
)
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\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\CreateGradeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createGradeModelMaster(
(new CreateGradeModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("grade-model-0001")
->withDescription(null)
->withMetadata(null)
->withDefaultGrades([
(new \Gs2\Grade\Model\DefaultGradeModel())
->withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*")
->withDefaultGradeValue(2),
])
->withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
->withGradeEntries([
(new \Gs2\Grade\Model\GradeEntryModel())
->withMetadata("GRADE_ENTRY_METADATA")
->withRankCapValue(50)
->withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*")
->withGradeUpPropertyIdRegex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*'),
])
->withAcquireActionRates([
(new \Gs2\Grade\Model\AcquireActionRate())
->withName("rate-0001")
->withRates([
1.0,
1.5,
2.0,
]),
(new \Gs2\Grade\Model\AcquireActionRate())
->withName("rate-0002")
->withRates([
10.0,
15.5,
20.0,
]),
])
);
$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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.CreateGradeModelMasterRequest;
import io.gs2.grade.result.CreateGradeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
CreateGradeModelMasterResult result = client.createGradeModelMaster(
new CreateGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withName("grade-model-0001")
.withDescription(null)
.withMetadata(null)
.withDefaultGrades(Arrays.asList(
new io.gs2.grade.model.DefaultGradeModel()
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*")
.withDefaultGradeValue(2L)
))
.withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
.withGradeEntries(Arrays.asList(
new io.gs2.grade.model.GradeEntryModel()
.withMetadata("GRADE_ENTRY_METADATA")
.withRankCapValue(50L)
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*")
.withGradeUpPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*")
))
.withAcquireActionRates(Arrays.asList(
new io.gs2.grade.model.AcquireActionRate()
.withName("rate-0001")
.withRates(Arrays.asList(
1.0,
1.5,
2.0
)),
new io.gs2.grade.model.AcquireActionRate()
.withName("rate-0002")
.withRates(Arrays.asList(
10.0,
15.5,
20.0
))
))
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.CreateGradeModelMasterRequest;
using Gs2.Gs2Grade.Result.CreateGradeModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.CreateGradeModelMasterResult> asyncResult = null;
yield return client.CreateGradeModelMaster(
new Gs2.Gs2Grade.Request.CreateGradeModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("grade-model-0001")
.WithDescription(null)
.WithMetadata(null)
.WithDefaultGrades(new Gs2.Gs2Grade.Model.DefaultGradeModel[] {
new Gs2.Gs2Grade.Model.DefaultGradeModel()
.WithPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*")
.WithDefaultGradeValue(2L),
})
.WithExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
.WithGradeEntries(new Gs2.Gs2Grade.Model.GradeEntryModel[] {
new Gs2.Gs2Grade.Model.GradeEntryModel()
.WithMetadata("GRADE_ENTRY_METADATA")
.WithRankCapValue(50L)
.WithPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*")
.WithGradeUpPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"),
})
.WithAcquireActionRates(new Gs2.Gs2Grade.Model.AcquireActionRate[] {
new Gs2.Gs2Grade.Model.AcquireActionRate()
.WithName("rate-0001")
.WithRates(new double[] {
1.0,
1.5,
2.0,
}),
new Gs2.Gs2Grade.Model.AcquireActionRate()
.WithName("rate-0002")
.WithRates(new double[] {
10.0,
15.5,
20.0,
}),
}),
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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.createGradeModelMaster(
new Gs2Grade.CreateGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withName("grade-model-0001")
.withDescription(null)
.withMetadata(null)
.withDefaultGrades([
new Gs2Grade.model.DefaultGradeModel()
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*")
.withDefaultGradeValue(2),
])
.withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
.withGradeEntries([
new Gs2Grade.model.GradeEntryModel()
.withMetadata("GRADE_ENTRY_METADATA")
.withRankCapValue(50)
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*")
.withGradeUpPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"),
])
.withAcquireActionRates([
new Gs2Grade.model.AcquireActionRate()
.withName("rate-0001")
.withRates([
1.0,
1.5,
2.0,
]),
new Gs2Grade.model.AcquireActionRate()
.withName("rate-0002")
.withRates([
10.0,
15.5,
20.0,
]),
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.create_grade_model_master(
grade.CreateGradeModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('grade-model-0001')
.with_description(None)
.with_metadata(None)
.with_default_grades([
grade.DefaultGradeModel()
.with_property_id_regex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*')
.with_default_grade_value(2),
])
.with_experience_model_id('grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001')
.with_grade_entries([
grade.GradeEntryModel()
.with_metadata('GRADE_ENTRY_METADATA')
.with_rank_cap_value(50)
.with_property_id_regex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*')
.with_grade_up_property_id_regex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*'),
])
.with_acquire_action_rates([
grade.AcquireActionRate()
.with_name('rate-0001')
.with_rates([
1.0,
1.5,
2.0,
]),
grade.AcquireActionRate()
.with_name('rate-0002')
.with_rates([
10.0,
15.5,
20.0,
]),
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
api_result = client.create_grade_model_master({
namespaceName="namespace1",
name="grade-model-0001",
description=nil,
metadata=nil,
defaultGrades={
{
propertyIdRegex="grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*",
defaultGradeValue=2,
}
},
experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001",
gradeEntries={
{
metadata="GRADE_ENTRY_METADATA",
rankCapValue=50,
propertyIdRegex="grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*",
gradeUpPropertyIdRegex="grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*",
}
},
acquireActionRates={
{
name="rate-0001",
rates={
1.0,
1.5,
2.0
},
},
{
name="rate-0002",
rates={
10.0,
15.5,
20.0
},
}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getGradeModelMaster
Get Grade model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
gradeName | string | ✓ | ~ 128 chars | Grade Model Name |
Result
Type | Description | |
---|---|---|
item | GradeModelMaster | Grade Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.GetGradeModelMaster(
&grade.GetGradeModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
GradeName: pointy.String("grade-model-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\GetGradeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getGradeModelMaster(
(new GetGradeModelMasterRequest())
->withNamespaceName(self::namespace1)
->withGradeName("grade-model-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.GetGradeModelMasterRequest;
import io.gs2.grade.result.GetGradeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
GetGradeModelMasterResult result = client.getGradeModelMaster(
new GetGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-model-0001")
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.GetGradeModelMasterRequest;
using Gs2.Gs2Grade.Result.GetGradeModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.GetGradeModelMasterResult> asyncResult = null;
yield return client.GetGradeModelMaster(
new Gs2.Gs2Grade.Request.GetGradeModelMasterRequest()
.WithNamespaceName("namespace1")
.WithGradeName("grade-model-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.getGradeModelMaster(
new Gs2Grade.GetGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-model-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.get_grade_model_master(
grade.GetGradeModelMasterRequest()
.with_namespace_name(self.hash1)
.with_grade_name('grade-model-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
api_result = client.get_grade_model_master({
namespaceName="namespace1",
gradeName="grade-model-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateGradeModelMaster
Update Grade Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
gradeName | string | ✓ | ~ 128 chars | Grade Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
defaultGrades | List<DefaultGradeModel> | ~ 100 items | List of Default grade model | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience model GRN to link grade and rank cap | ||
gradeEntries | List<GradeEntryModel> | ~ 100 items | List of Grade entry | |||
acquireActionRates | List<AcquireActionRate> | ~ 100 items | List of Remuneration addition table |
Result
Type | Description | |
---|---|---|
item | GradeModelMaster | Updated Grade Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.UpdateGradeModelMaster(
&grade.UpdateGradeModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
GradeName: pointy.String("grade-model-0001"),
Description: nil,
Metadata: nil,
DefaultGrades: []grade.DefaultGradeModel{
grade.DefaultGradeModel{
PropertyIdRegex: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*"),
DefaultGradeValue: pointy.Int64(3),
},
},
ExperienceModelId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001"),
GradeEntries: []grade.GradeEntryModel{
grade.GradeEntryModel{
Metadata: pointy.String("GRADE_ENTRY_METADATA1"),
RankCapValue: pointy.Int64(60),
PropertyIdRegex: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*"),
GradeUpPropertyIdRegex: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*"),
},
},
AcquireActionRates: []grade.AcquireActionRate{
grade.AcquireActionRate{
Name: pointy.String("rate-0001"),
Mode: pointy.String("big"),
BigRates: []*string{
pointy.String("100000000000000"),
pointy.String("10000000000000000000000000000"),
pointy.String("1000000000000000000000000000000000000000000"),
},
},
grade.AcquireActionRate{
Name: pointy.String("rate-0002"),
Mode: pointy.String("big"),
BigRates: []*string{
pointy.String("100000000000000"),
pointy.String("10000000000000000000000000000"),
pointy.String("1000000000000000000000000000000000000000000"),
},
},
},
}
)
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\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\UpdateGradeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateGradeModelMaster(
(new UpdateGradeModelMasterRequest())
->withNamespaceName(self::namespace1)
->withGradeName("grade-model-0001")
->withDescription(null)
->withMetadata(null)
->withDefaultGrades([
(new \Gs2\Grade\Model\DefaultGradeModel())
->withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*")
->withDefaultGradeValue(3),
])
->withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
->withGradeEntries([
(new \Gs2\Grade\Model\GradeEntryModel())
->withMetadata("GRADE_ENTRY_METADATA1")
->withRankCapValue(60)
->withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*")
->withGradeUpPropertyIdRegex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*'),
])
->withAcquireActionRates([
(new \Gs2\Grade\Model\AcquireActionRate())
->withName("rate-0001")
->withMode("big")
->withBigRates([
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000",
]),
(new \Gs2\Grade\Model\AcquireActionRate())
->withName("rate-0002")
->withMode("big")
->withBigRates([
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000",
]),
])
);
$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.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.UpdateGradeModelMasterRequest;
import io.gs2.grade.result.UpdateGradeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
UpdateGradeModelMasterResult result = client.updateGradeModelMaster(
new UpdateGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-model-0001")
.withDescription(null)
.withMetadata(null)
.withDefaultGrades(Arrays.asList(
new io.gs2.grade.model.DefaultGradeModel()
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*")
.withDefaultGradeValue(3L)
))
.withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
.withGradeEntries(Arrays.asList(
new io.gs2.grade.model.GradeEntryModel()
.withMetadata("GRADE_ENTRY_METADATA1")
.withRankCapValue(60L)
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*")
.withGradeUpPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*")
))
.withAcquireActionRates(Arrays.asList(
new io.gs2.grade.model.AcquireActionRate()
.withName("rate-0001")
.withMode("big")
.withBigRates(Arrays.asList(
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000"
)),
new io.gs2.grade.model.AcquireActionRate()
.withName("rate-0002")
.withMode("big")
.withBigRates(Arrays.asList(
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000"
))
))
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.UpdateGradeModelMasterRequest;
using Gs2.Gs2Grade.Result.UpdateGradeModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.UpdateGradeModelMasterResult> asyncResult = null;
yield return client.UpdateGradeModelMaster(
new Gs2.Gs2Grade.Request.UpdateGradeModelMasterRequest()
.WithNamespaceName("namespace1")
.WithGradeName("grade-model-0001")
.WithDescription(null)
.WithMetadata(null)
.WithDefaultGrades(new Gs2.Gs2Grade.Model.DefaultGradeModel[] {
new Gs2.Gs2Grade.Model.DefaultGradeModel()
.WithPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*")
.WithDefaultGradeValue(3L),
})
.WithExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
.WithGradeEntries(new Gs2.Gs2Grade.Model.GradeEntryModel[] {
new Gs2.Gs2Grade.Model.GradeEntryModel()
.WithMetadata("GRADE_ENTRY_METADATA1")
.WithRankCapValue(60L)
.WithPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*")
.WithGradeUpPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*"),
})
.WithAcquireActionRates(new Gs2.Gs2Grade.Model.AcquireActionRate[] {
new Gs2.Gs2Grade.Model.AcquireActionRate()
.WithName("rate-0001")
.WithMode("big")
.WithBigRates(new string[] {
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000",
}),
new Gs2.Gs2Grade.Model.AcquireActionRate()
.WithName("rate-0002")
.WithMode("big")
.WithBigRates(new string[] {
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000",
}),
}),
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 Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.updateGradeModelMaster(
new Gs2Grade.UpdateGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-model-0001")
.withDescription(null)
.withMetadata(null)
.withDefaultGrades([
new Gs2Grade.model.DefaultGradeModel()
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*")
.withDefaultGradeValue(3),
])
.withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001")
.withGradeEntries([
new Gs2Grade.model.GradeEntryModel()
.withMetadata("GRADE_ENTRY_METADATA1")
.withRankCapValue(60)
.withPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*")
.withGradeUpPropertyIdRegex("grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*"),
])
.withAcquireActionRates([
new Gs2Grade.model.AcquireActionRate()
.withName("rate-0001")
.withMode("big")
.withBigRates([
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000",
]),
new Gs2Grade.model.AcquireActionRate()
.withName("rate-0002")
.withMode("big")
.withBigRates([
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000",
]),
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.update_grade_model_master(
grade.UpdateGradeModelMasterRequest()
.with_namespace_name(self.hash1)
.with_grade_name('grade-model-0001')
.with_description(None)
.with_metadata(None)
.with_default_grades([
grade.DefaultGradeModel()
.with_property_id_regex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*')
.with_default_grade_value(3),
])
.with_experience_model_id('grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001')
.with_grade_entries([
grade.GradeEntryModel()
.with_metadata('GRADE_ENTRY_METADATA1')
.with_rank_cap_value(60)
.with_property_id_regex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*')
.with_grade_up_property_id_regex('grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*'),
])
.with_acquire_action_rates([
grade.AcquireActionRate()
.with_name('rate-0001')
.with_mode('big')
.with_big_rates([
'100000000000000',
'10000000000000000000000000000',
'1000000000000000000000000000000000000000000',
]),
grade.AcquireActionRate()
.with_name('rate-0002')
.with_mode('big')
.with_big_rates([
'100000000000000',
'10000000000000000000000000000',
'1000000000000000000000000000000000000000000',
]),
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
api_result = client.update_grade_model_master({
namespaceName="namespace1",
gradeName="grade-model-0001",
description=nil,
metadata=nil,
defaultGrades={
{
propertyIdRegex="grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*",
defaultGradeValue=3,
}
},
experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001",
gradeEntries={
{
metadata="GRADE_ENTRY_METADATA1",
rankCapValue=60,
propertyIdRegex="grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*",
gradeUpPropertyIdRegex="grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*",
}
},
acquireActionRates={
{
name="rate-0001",
mode="big",
bigRates={
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000"
},
},
{
name="rate-0002",
mode="big",
bigRates={
"100000000000000",
"10000000000000000000000000000",
"1000000000000000000000000000000000000000000"
},
}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteGradeModelMaster
Delete Grade Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
gradeName | string | ✓ | ~ 128 chars | Grade Model Name |
Result
Type | Description | |
---|---|---|
item | GradeModelMaster | Deleted Grade Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DeleteGradeModelMaster(
&grade.DeleteGradeModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
GradeName: pointy.String("grade-model-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\DeleteGradeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteGradeModelMaster(
(new DeleteGradeModelMasterRequest())
->withNamespaceName(self::namespace1)
->withGradeName("grade-model-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.DeleteGradeModelMasterRequest;
import io.gs2.grade.result.DeleteGradeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
DeleteGradeModelMasterResult result = client.deleteGradeModelMaster(
new DeleteGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-model-0001")
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.DeleteGradeModelMasterRequest;
using Gs2.Gs2Grade.Result.DeleteGradeModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.DeleteGradeModelMasterResult> asyncResult = null;
yield return client.DeleteGradeModelMaster(
new Gs2.Gs2Grade.Request.DeleteGradeModelMasterRequest()
.WithNamespaceName("namespace1")
.WithGradeName("grade-model-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.deleteGradeModelMaster(
new Gs2Grade.DeleteGradeModelMasterRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-model-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.delete_grade_model_master(
grade.DeleteGradeModelMasterRequest()
.with_namespace_name(self.hash1)
.with_grade_name('grade-model-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
api_result = client.delete_grade_model_master({
namespaceName="namespace1",
gradeName="grade-model-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeGradeModels
Get list of grade and rank-up threshold models
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<GradeModel> | List of Grade Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DescribeGradeModels(
&grade.DescribeGradeModelsRequest {
NamespaceName: pointy.String("namespace2"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\DescribeGradeModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeGradeModels(
(new DescribeGradeModelsRequest())
->withNamespaceName(self::namespace2)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.DescribeGradeModelsRequest;
import io.gs2.grade.result.DescribeGradeModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
DescribeGradeModelsResult result = client.describeGradeModels(
new DescribeGradeModelsRequest()
.withNamespaceName("namespace2")
);
List<GradeModel> 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.DescribeGradeModelsRequest;
using Gs2.Gs2Grade.Result.DescribeGradeModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.DescribeGradeModelsResult> asyncResult = null;
yield return client.DescribeGradeModels(
new Gs2.Gs2Grade.Request.DescribeGradeModelsRequest()
.WithNamespaceName("namespace2"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.describeGradeModels(
new Gs2Grade.DescribeGradeModelsRequest()
.withNamespaceName("namespace2")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.describe_grade_models(
grade.DescribeGradeModelsRequest()
.with_namespace_name(self.hash2)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
api_result = client.describe_grade_models({
namespaceName="namespace2",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
getGradeModel
Get Grade Model
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
gradeName | string | ✓ | ~ 128 chars | Grade Model Name |
Result
Type | Description | |
---|---|---|
item | GradeModel | Grade Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.GetGradeModel(
&grade.GetGradeModelRequest {
NamespaceName: pointy.String("namespace2"),
GradeName: pointy.String("grade-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\GetGradeModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getGradeModel(
(new GetGradeModelRequest())
->withNamespaceName(self::namespace2)
->withGradeName("grade-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.GetGradeModelRequest;
import io.gs2.grade.result.GetGradeModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
GetGradeModelResult result = client.getGradeModel(
new GetGradeModelRequest()
.withNamespaceName("namespace2")
.withGradeName("grade-0001")
);
GradeModel 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.GetGradeModelRequest;
using Gs2.Gs2Grade.Result.GetGradeModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.GetGradeModelResult> asyncResult = null;
yield return client.GetGradeModel(
new Gs2.Gs2Grade.Request.GetGradeModelRequest()
.WithNamespaceName("namespace2")
.WithGradeName("grade-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.getGradeModel(
new Gs2Grade.GetGradeModelRequest()
.withNamespaceName("namespace2")
.withGradeName("grade-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.get_grade_model(
grade.GetGradeModelRequest()
.with_namespace_name(self.hash2)
.with_grade_name('grade-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
api_result = client.get_grade_model({
namespaceName="namespace2",
gradeName="grade-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeStatuses
Get list of statuses
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
gradeName | string | ~ 128 chars | Grade Model Name | |||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Status> | List of Status |
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DescribeStatuses(
&grade.DescribeStatusesRequest {
NamespaceName: pointy.String("namespace1"),
GradeName: pointy.String("grade-0001"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Grade\Gs2GradeRestClient;
use Gs2\Grade\Request\DescribeStatusesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStatuses(
(new DescribeStatusesRequest())
->withNamespaceName(self::namespace1)
->withGradeName("grade-0001")
->withAccessToken(self::$accessToken0001)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.grade.rest.Gs2GradeRestClient;
import io.gs2.grade.request.DescribeStatusesRequest;
import io.gs2.grade.result.DescribeStatusesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2GradeRestClient client = new Gs2GradeRestClient(session);
try {
DescribeStatusesResult result = client.describeStatuses(
new DescribeStatusesRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<Status> 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.Gs2Grade.Gs2GradeRestClient;
using Gs2.Gs2Grade.Request.DescribeStatusesRequest;
using Gs2.Gs2Grade.Result.DescribeStatusesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2GradeRestClient(session);
AsyncResult<Gs2.Gs2Grade.Result.DescribeStatusesResult> asyncResult = null;
yield return client.DescribeStatuses(
new Gs2.Gs2Grade.Request.DescribeStatusesRequest()
.WithNamespaceName("namespace1")
.WithGradeName("grade-0001")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Grade from '@/gs2/grade';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Grade.Gs2GradeRestClient(session);
try {
const result = await client.describeStatuses(
new Gs2Grade.DescribeStatusesRequest()
.withNamespaceName("namespace1")
.withGradeName("grade-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import grade
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = grade.Gs2GradeRestClient(session)
try:
result = client.describe_statuses(
grade.DescribeStatusesRequest()
.with_namespace_name(self.hash1)
.with_grade_name('grade-0001')
.with_access_token(self.access_token_0001)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('grade')
api_result = client.describe_statuses({
namespaceName="namespace1",
gradeName="grade-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeStatusesByUserId
Get list of statuses by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
gradeName | string | ~ 128 chars | Grade Model Name | |||
userId | string | ✓ | ~ 128 chars | User Id | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<Status> | List of Status |
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/grade"
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 := grade.Gs2GradeRestClient{
Session: &session,
}
result, err := client.DescribeStatusesByUserId(
&