API Reference of GS2-Stamina 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 | |||
overflowTriggerScript | string | ~ 1024 chars | GS2-Script to handle overflow stamina during recovery process | |||
logSetting | LogSetting | Log output settings | ||||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
StaminaModelMaster
Stamina Master
Parameters such as maximum stamina value, recovery interval, and recovery amount can be defined. It can also be linked to GS2-Experience to control the maximum value and the amount of recovery.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
staminaModelId | string | ✓ | ~ 1024 chars | Stamina Model Master GRN | ||
name | string | ✓ | ~ 128 chars | Stamina Model Name | ||
metadata | string | ~ 128 chars | metadata | |||
description | string | ~ 1024 chars | Description | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | Speed at which stamina is regained (minutes) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | Amount of recovery after a period of time | |
initialCapacity | int | ✓ | ~ 2147483646 | Initial maximum value of stamina | ||
isOverflow | bool | ✓ | Recover beyond the maximum | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | Maximum value in overflow situation | |
maxStaminaTableName | string | ~ 128 chars | Name of the maximum stamina table that determines the maximum stamina value according to the rank of GS2-Experience | |||
recoverIntervalTableName | string | ~ 128 chars | Name of the recovery interval table that determines the recovery interval of stamina according to the rank of GS2-Experience | |||
recoverValueTableName | string | ~ 128 chars | Name of the recovery table that determines the amount of stamina recovery according to the rank of GS2-Experience | |||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
MaxStaminaTableMaster
Stamina Maximum Table Master
This entity defines the maximum value of stamina for each rank in GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
maxStaminaTableId | string | ✓ | ~ 1024 chars | Maximum Stamina Table Master GRN | ||
name | string | ✓ | ~ 128 chars | Maximum Stamina Value Table Name | ||
metadata | string | ~ 128 chars | metadata | |||
description | string | ~ 1024 chars | Description | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | List of Maximum Staminas | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
RecoverIntervalTableMaster
Stamina Recovery Interval Table Master
This entity defines the stamina recovery interval for each rank of GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
recoverIntervalTableId | string | ✓ | ~ 1024 chars | Stamina Recovery Interval Table Master GRN | ||
name | string | ✓ | ~ 128 chars | Stamina recovery interval table name | ||
metadata | string | ~ 128 chars | metadata | |||
description | string | ~ 1024 chars | Description | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | Stamina recovery interval table for each rank | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
RecoverValueTableMaster
Stamina Recovery Value Table Master
This entity defines the amount of stamina recovery for each rank of GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
recoverValueTableId | string | ✓ | ~ 1024 chars | Stamina Recovery Amount Table Master GRN | ||
name | string | ✓ | ~ 128 chars | Stamina recovery value table name | ||
metadata | string | ~ 128 chars | metadata | |||
description | string | ~ 1024 chars | Description | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | Stamina recovery value table for each rank | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
CurrentStaminaMaster
Currently available master data
GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Stamina for the JSON file format.Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently available Stamina Master GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
StaminaModel
Stamina Model
Parameters such as the maximum value of stamina, recovery interval, and amount of recovery can be defined. You can also control the maximum value and the amount of recovery in conjunction with GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
staminaModelId | string | ✓ | ~ 1024 chars | Stamina Model GRN | ||
name | string | ✓ | ~ 128 chars | Stamina Model Name | ||
metadata | string | ~ 128 chars | metadata | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | Speed at which stamina is regained (minutes) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | Amount of recovery after a period of time | |
initialCapacity | int | ✓ | ~ 2147483646 | Initial maximum value of stamina | ||
isOverflow | bool | ✓ | Recover beyond the maximum | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | Maximum value in overflow situation | |
maxStaminaTable | MaxStaminaTable | Maximum Stamina Table used when working with GS2-Experience | ||||
recoverIntervalTable | RecoverIntervalTable | Recovery interval table used when working with GS2-Experience | ||||
recoverValueTable | RecoverValueTable | Recovery amount table used when working with GS2-Experience |
MaxStaminaTable
Maximum Stamina Table
This entity defines the maximum value of stamina for each rank of GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Maximum Stamina Value Table Name | ||
metadata | string | ~ 128 chars | metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | List of Maximum Staminas |
RecoverIntervalTable
Stamina Recovery Interval Table
This entity defines the stamina recovery interval for each rank of GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Stamina recovery interval table name | ||
metadata | string | ~ 128 chars | metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | Stamina recovery interval table for each rank |
RecoverValueTable
Stamina Recovery Value Table
This entity defines the amount of stamina recovery for each rank of GS2-Experience.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Stamina recovery value table name | ||
metadata | string | ~ 128 chars | metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | Stamina recovery value table for each rank |
Stamina
Stamina
Stamina is a point that is recovered over time in real time. Generally, this stamina is used to limit the number of times a player can play a game per day and to allow the game provider to control the speed of game progression by allowing players to consume stamina to play the game.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
staminaId | string | ✓ | ~ 1024 chars | Stamina GRN | ||
staminaName | string | ✓ | ~ 128 chars | Stamina Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
value | int | ✓ | ~ 2147483646 | Stamina value | ||
maxValue | int | ✓ | 1 ~ 2147483646 | Maximum Stamina | ||
recoverIntervalMinutes | int | 1 ~ 2147483646 | Stamina recovery interval (minutes) | |||
recoverValue | int | 1 ~ 2147483646 | Stamina recovery value | |||
overflowValue | int | ✓ | ~ 2147483646 | Stamina value stored in excess of the maximum stamina value | ||
nextRecoverAt | long | Next time stamina is restored (Unix time unit:milliseconds) | ||||
lastRecoveredAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | ||
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128 chars | Source of code | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024 chars | Commit hash | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name |
Enumeration type definition to specify as referenceType
Enumerator String Definition | Description |
---|---|
commit_hash | Commit hash |
branch | Branch |
tag | Tag |
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 |
ScriptSetting
Script settings
In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.
There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.
On the other hand, asynchronous execution does not block processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API. However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.
There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
triggerScriptId | string | ~ 1024 chars | Script GRN | |||
doneTriggerTargetType | enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128 chars | Notification of Completion | |
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Script GRN | ||
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Namespace GRN |
Enumeration type definition to specify as doneTriggerTargetType
Enumerator String Definition | Description |
---|---|
none | None |
gs2_script | GS2-Script |
aws | Amazon EventBridge |
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/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeNamespacesRequest;
import io.gs2.stamina.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeNamespacesRequest;
using Gs2.Gs2Stamina.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_namespaces(
stamina.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('stamina')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_namespaces_async({
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createNamespace
Create a new namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
overflowTriggerScript | string | ~ 1024 chars | GS2-Script to handle overflow stamina during recovery process | |||
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/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&stamina.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
OverflowTriggerScript: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script"),
LogSetting: &stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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)
->withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script")
->withLogSetting((new \Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateNamespaceRequest;
import io.gs2.stamina.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script")
.withLogSetting(new io.gs2.stamina.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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateNamespaceRequest;
using Gs2.Gs2Stamina.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Stamina.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script")
.WithLogSetting(new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Stamina.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script")
.withLogSetting(new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.create_namespace(
stamina.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_overflow_trigger_script('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script')
.with_log_setting(
stamina.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('stamina')
api_result = client.create_namespace({
name="namespace1",
description=nil,
overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.create_namespace_async({
name="namespace1",
description=nil,
overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
Request
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/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetNamespaceStatusRequest;
import io.gs2.stamina.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Stamina.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Stamina.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_namespace_status(
stamina.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_namespace_status({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('stamina')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
getNamespace
Get namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetNamespaceRequest;
import io.gs2.stamina.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetNamespaceRequest;
using Gs2.Gs2Stamina.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Stamina.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_namespace(
stamina.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.get_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateNamespace
Update namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
overflowTriggerScript | string | ~ 1024 chars | GS2-Script to handle overflow stamina during recovery process | |||
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/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&stamina.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
OverflowTriggerScript: nil,
LogSetting: &stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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")
->withOverflowTriggerScript(null)
->withLogSetting((new \Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateNamespaceRequest;
import io.gs2.stamina.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withOverflowTriggerScript(null)
.withLogSetting(new io.gs2.stamina.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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateNamespaceRequest;
using Gs2.Gs2Stamina.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Stamina.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithOverflowTriggerScript(null)
.WithLogSetting(new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Stamina.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withOverflowTriggerScript(null)
.withLogSetting(new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_namespace(
stamina.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_overflow_trigger_script(None)
.with_log_setting(
stamina.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('stamina')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
overflowTriggerScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.update_namespace_async({
namespaceName="namespace1",
description="description1",
overflowTriggerScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
Delete namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Deleted namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteNamespaceRequest;
import io.gs2.stamina.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteNamespaceRequest;
using Gs2.Gs2Stamina.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Stamina.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_namespace(
stamina.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
Get dump data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DumpUserDataByUserIdRequest;
import io.gs2.stamina.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Stamina.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.dump_user_data_by_user_id(
stamina.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('stamina')
api_result_handler = client.dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkDumpUserDataByUserId
Check if the dump of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL of output data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Stamina.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
stamina.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('stamina')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
cleanUserDataByUserId
Get clean data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CleanUserDataByUserIdRequest;
import io.gs2.stamina.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Stamina.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.clean_user_data_by_user_id(
stamina.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('stamina')
api_result_handler = client.clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkCleanUserDataByUserId
Check if the clean of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Stamina.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
stamina.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.check_clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('stamina')
api_result_handler = client.check_clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
prepareImportUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
uploadToken | string | Token used to reflect results after upload |
uploadUrl | string | URL used to upload user data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.stamina.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
stamina.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('stamina')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('stamina')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
importUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ImportUserDataByUserIdRequest;
import io.gs2.stamina.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Stamina.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.import_user_data_by_user_id(
stamina.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('stamina')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('stamina')
api_result_handler = client.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkImportUserDataByUserId
Check if the import of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL of log data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckImportUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
stamina.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('stamina')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('stamina')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
describeStaminaModelMasters
Get list of Stamina 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<StaminaModelMaster> | List of Stamina 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/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeStaminaModelMasters(
&stamina.DescribeStaminaModelMastersRequest {
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminaModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStaminaModelMasters(
(new DescribeStaminaModelMastersRequest())
->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminaModelMastersRequest;
import io.gs2.stamina.result.DescribeStaminaModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeStaminaModelMastersResult result = client.describeStaminaModelMasters(
new DescribeStaminaModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<StaminaModelMaster> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeStaminaModelMastersRequest;
using Gs2.Gs2Stamina.Result.DescribeStaminaModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminaModelMastersResult> asyncResult = null;
yield return client.DescribeStaminaModelMasters(
new Gs2.Gs2Stamina.Request.DescribeStaminaModelMastersRequest()
.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeStaminaModelMasters(
new Gs2Stamina.DescribeStaminaModelMastersRequest()
.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_stamina_model_masters(
stamina.DescribeStaminaModelMastersRequest()
.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('stamina')
api_result = client.describe_stamina_model_masters({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_stamina_model_masters_async({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createStaminaModelMaster
Create new Stamina Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Stamina Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 128 chars | metadata | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | Speed at which stamina is regained (minutes) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | Amount of recovery after a period of time | |
initialCapacity | int | ✓ | ~ 2147483646 | Initial maximum value of stamina | ||
isOverflow | bool | ✓ | Recover beyond the maximum | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | Maximum value in overflow situation | |
maxStaminaTableName | string | ~ 128 chars | Name of the maximum stamina table that determines the maximum stamina value according to the rank of GS2-Experience | |||
recoverIntervalTableName | string | ~ 128 chars | Name of the recovery interval table that determines the recovery interval of stamina according to the rank of GS2-Experience | |||
recoverValueTableName | string | ~ 128 chars | Name of the recovery table that determines the amount of stamina recovery according to the rank of GS2-Experience |
Result
Type | Description | |
---|---|---|
item | StaminaModelMaster | Created Stamina Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateStaminaModelMaster(
&stamina.CreateStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("stamina-0001"),
Description: nil,
Metadata: nil,
RecoverIntervalMinutes: pointy.Int32(15),
RecoverValue: nil,
InitialCapacity: pointy.Int32(50),
IsOverflow: pointy.Bool(false),
MaxCapacity: nil,
MaxStaminaTableName: pointy.String("$maxStaminaTable1.name"),
RecoverIntervalTableName: pointy.String("$recoverIntervalTable1.name"),
RecoverValueTableName: pointy.String("$recoverValueTable1.name"),
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createStaminaModelMaster(
(new CreateStaminaModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("stamina-0001")
->withDescription(null)
->withMetadata(null)
->withRecoverIntervalMinutes(15)
->withRecoverValue(null)
->withInitialCapacity(50)
->withIsOverflow(False)
->withMaxCapacity(null)
->withMaxStaminaTableName(self::$maxStaminaTable1.name)
->withRecoverIntervalTableName(self::$recoverIntervalTable1.name)
->withRecoverValueTableName(self::$recoverValueTable1.name)
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateStaminaModelMasterRequest;
import io.gs2.stamina.result.CreateStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateStaminaModelMasterResult result = client.createStaminaModelMaster(
new CreateStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withName("stamina-0001")
.withDescription(null)
.withMetadata(null)
.withRecoverIntervalMinutes(15)
.withRecoverValue(null)
.withInitialCapacity(50)
.withIsOverflow(false)
.withMaxCapacity(null)
.withMaxStaminaTableName("$maxStaminaTable1.name")
.withRecoverIntervalTableName("$recoverIntervalTable1.name")
.withRecoverValueTableName("$recoverValueTable1.name")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.CreateStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateStaminaModelMasterResult> asyncResult = null;
yield return client.CreateStaminaModelMaster(
new Gs2.Gs2Stamina.Request.CreateStaminaModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("stamina-0001")
.WithDescription(null)
.WithMetadata(null)
.WithRecoverIntervalMinutes(15)
.WithRecoverValue(null)
.WithInitialCapacity(50)
.WithIsOverflow(false)
.WithMaxCapacity(null)
.WithMaxStaminaTableName("$maxStaminaTable1.name")
.WithRecoverIntervalTableName("$recoverIntervalTable1.name")
.WithRecoverValueTableName("$recoverValueTable1.name"),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.createStaminaModelMaster(
new Gs2Stamina.CreateStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withName("stamina-0001")
.withDescription(null)
.withMetadata(null)
.withRecoverIntervalMinutes(15)
.withRecoverValue(null)
.withInitialCapacity(50)
.withIsOverflow(false)
.withMaxCapacity(null)
.withMaxStaminaTableName("$maxStaminaTable1.name")
.withRecoverIntervalTableName("$recoverIntervalTable1.name")
.withRecoverValueTableName("$recoverValueTable1.name")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.create_stamina_model_master(
stamina.CreateStaminaModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('stamina-0001')
.with_description(None)
.with_metadata(None)
.with_recover_interval_minutes(15)
.with_recover_value(None)
.with_initial_capacity(50)
.with_is_overflow(False)
.with_max_capacity(None)
.with_max_stamina_table_name(self.max_stamina_table1.name)
.with_recover_interval_table_name(self.recover_interval_table1.name)
.with_recover_value_table_name(self.recover_value_table1.name)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.create_stamina_model_master({
namespaceName="namespace1",
name="stamina-0001",
description=nil,
metadata=nil,
recoverIntervalMinutes=15,
recoverValue=nil,
initialCapacity=50,
isOverflow=false,
maxCapacity=nil,
maxStaminaTableName="$maxStaminaTable1.name",
recoverIntervalTableName="$recoverIntervalTable1.name",
recoverValueTableName="$recoverValueTable1.name",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.create_stamina_model_master_async({
namespaceName="namespace1",
name="stamina-0001",
description=nil,
metadata=nil,
recoverIntervalMinutes=15,
recoverValue=nil,
initialCapacity=50,
isOverflow=false,
maxCapacity=nil,
maxStaminaTableName="$maxStaminaTable1.name",
recoverIntervalTableName="$recoverIntervalTable1.name",
recoverValueTableName="$recoverValueTable1.name",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getStaminaModelMaster
Obtained Stamina Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
staminaName | string | ✓ | ~ 128 chars | Stamina Model Name |
Result
Type | Description | |
---|---|---|
item | StaminaModelMaster | Stamina Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetStaminaModelMaster(
&stamina.GetStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStaminaModelMaster(
(new GetStaminaModelMasterRequest())
->withNamespaceName(self::namespace1)
->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaModelMasterRequest;
import io.gs2.stamina.result.GetStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetStaminaModelMasterResult result = client.getStaminaModelMaster(
new GetStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withStaminaName("stamina-0001")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.GetStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaModelMasterResult> asyncResult = null;
yield return client.GetStaminaModelMaster(
new Gs2.Gs2Stamina.Request.GetStaminaModelMasterRequest()
.WithNamespaceName("namespace1")
.WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getStaminaModelMaster(
new Gs2Stamina.GetStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withStaminaName("stamina-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_stamina_model_master(
stamina.GetStaminaModelMasterRequest()
.with_namespace_name(self.hash1)
.with_stamina_name('stamina-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_stamina_model_master({
namespaceName="namespace1",
staminaName="stamina-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.get_stamina_model_master_async({
namespaceName="namespace1",
staminaName="stamina-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateStaminaModelMaster
Update Stamina Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
staminaName | string | ✓ | ~ 128 chars | Stamina Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 128 chars | metadata | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | Speed at which stamina is regained (minutes) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | Amount of recovery after a period of time | |
initialCapacity | int | ✓ | ~ 2147483646 | Initial maximum value of stamina | ||
isOverflow | bool | ✓ | Recover beyond the maximum | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | Maximum value in overflow situation | |
maxStaminaTableName | string | ~ 128 chars | Name of the maximum stamina table that determines the maximum stamina value according to the rank of GS2-Experience | |||
recoverIntervalTableName | string | ~ 128 chars | Name of the recovery interval table that determines the recovery interval of stamina according to the rank of GS2-Experience | |||
recoverValueTableName | string | ~ 128 chars | Name of the recovery table that determines the amount of stamina recovery according to the rank of GS2-Experience |
Result
Type | Description | |
---|---|---|
item | StaminaModelMaster | Updated Stamina Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateStaminaModelMaster(
&stamina.UpdateStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
StaminaName: pointy.String("stamina-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("STAMINA_MODEL_MASTER_0001"),
RecoverIntervalMinutes: pointy.Int32(20),
RecoverValue: pointy.Int32(2),
InitialCapacity: pointy.Int32(60),
IsOverflow: pointy.Bool(true),
MaxCapacity: pointy.Int32(999),
MaxStaminaTableName: pointy.String("$maxStaminaTable2.name"),
RecoverIntervalTableName: pointy.String("$recoverIntervalTable2.name"),
RecoverValueTableName: pointy.String("$recoverValueTable2.name"),
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateStaminaModelMaster(
(new UpdateStaminaModelMasterRequest())
->withNamespaceName(self::namespace1)
->withStaminaName("stamina-0001")
->withDescription("description1")
->withMetadata("STAMINA_MODEL_MASTER_0001")
->withRecoverIntervalMinutes(20)
->withRecoverValue(2)
->withInitialCapacity(60)
->withIsOverflow(True)
->withMaxCapacity(999)
->withMaxStaminaTableName(self::$maxStaminaTable2.name)
->withRecoverIntervalTableName(self::$recoverIntervalTable2.name)
->withRecoverValueTableName(self::$recoverValueTable2.name)
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateStaminaModelMasterRequest;
import io.gs2.stamina.result.UpdateStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateStaminaModelMasterResult result = client.updateStaminaModelMaster(
new UpdateStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withStaminaName("stamina-0001")
.withDescription("description1")
.withMetadata("STAMINA_MODEL_MASTER_0001")
.withRecoverIntervalMinutes(20)
.withRecoverValue(2)
.withInitialCapacity(60)
.withIsOverflow(true)
.withMaxCapacity(999)
.withMaxStaminaTableName("$maxStaminaTable2.name")
.withRecoverIntervalTableName("$recoverIntervalTable2.name")
.withRecoverValueTableName("$recoverValueTable2.name")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.UpdateStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateStaminaModelMasterResult> asyncResult = null;
yield return client.UpdateStaminaModelMaster(
new Gs2.Gs2Stamina.Request.UpdateStaminaModelMasterRequest()
.WithNamespaceName("namespace1")
.WithStaminaName("stamina-0001")
.WithDescription("description1")
.WithMetadata("STAMINA_MODEL_MASTER_0001")
.WithRecoverIntervalMinutes(20)
.WithRecoverValue(2)
.WithInitialCapacity(60)
.WithIsOverflow(true)
.WithMaxCapacity(999)
.WithMaxStaminaTableName("$maxStaminaTable2.name")
.WithRecoverIntervalTableName("$recoverIntervalTable2.name")
.WithRecoverValueTableName("$recoverValueTable2.name"),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateStaminaModelMaster(
new Gs2Stamina.UpdateStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withStaminaName("stamina-0001")
.withDescription("description1")
.withMetadata("STAMINA_MODEL_MASTER_0001")
.withRecoverIntervalMinutes(20)
.withRecoverValue(2)
.withInitialCapacity(60)
.withIsOverflow(true)
.withMaxCapacity(999)
.withMaxStaminaTableName("$maxStaminaTable2.name")
.withRecoverIntervalTableName("$recoverIntervalTable2.name")
.withRecoverValueTableName("$recoverValueTable2.name")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_stamina_model_master(
stamina.UpdateStaminaModelMasterRequest()
.with_namespace_name(self.hash1)
.with_stamina_name('stamina-0001')
.with_description('description1')
.with_metadata('STAMINA_MODEL_MASTER_0001')
.with_recover_interval_minutes(20)
.with_recover_value(2)
.with_initial_capacity(60)
.with_is_overflow(True)
.with_max_capacity(999)
.with_max_stamina_table_name(self.max_stamina_table2.name)
.with_recover_interval_table_name(self.recover_interval_table2.name)
.with_recover_value_table_name(self.recover_value_table2.name)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_stamina_model_master({
namespaceName="namespace1",
staminaName="stamina-0001",
description="description1",
metadata="STAMINA_MODEL_MASTER_0001",
recoverIntervalMinutes=20,
recoverValue=2,
initialCapacity=60,
isOverflow=true,
maxCapacity=999,
maxStaminaTableName="$maxStaminaTable2.name",
recoverIntervalTableName="$recoverIntervalTable2.name",
recoverValueTableName="$recoverValueTable2.name",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.update_stamina_model_master_async({
namespaceName="namespace1",
staminaName="stamina-0001",
description="description1",
metadata="STAMINA_MODEL_MASTER_0001",
recoverIntervalMinutes=20,
recoverValue=2,
initialCapacity=60,
isOverflow=true,
maxCapacity=999,
maxStaminaTableName="$maxStaminaTable2.name",
recoverIntervalTableName="$recoverIntervalTable2.name",
recoverValueTableName="$recoverValueTable2.name",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteStaminaModelMaster
Delete Stamina Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
staminaName | string | ✓ | ~ 128 chars | Stamina Model Name |
Result
Type | Description | |
---|---|---|
item | StaminaModelMaster | Deleted Stamina Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteStaminaModelMaster(
&stamina.DeleteStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteStaminaModelMaster(
(new DeleteStaminaModelMasterRequest())
->withNamespaceName(self::namespace1)
->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteStaminaModelMasterRequest;
import io.gs2.stamina.result.DeleteStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DeleteStaminaModelMasterResult result = client.deleteStaminaModelMaster(
new DeleteStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withStaminaName("stamina-0001")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.DeleteStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteStaminaModelMasterResult> asyncResult = null;
yield return client.DeleteStaminaModelMaster(
new Gs2.Gs2Stamina.Request.DeleteStaminaModelMasterRequest()
.WithNamespaceName("namespace1")
.WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteStaminaModelMaster(
new Gs2Stamina.DeleteStaminaModelMasterRequest()
.withNamespaceName("namespace1")
.withStaminaName("stamina-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_stamina_model_master(
stamina.DeleteStaminaModelMasterRequest()
.with_namespace_name(self.hash1)
.with_stamina_name('stamina-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_stamina_model_master({
namespaceName="namespace1",
staminaName="stamina-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.delete_stamina_model_master_async({
namespaceName="namespace1",
staminaName="stamina-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeMaxStaminaTableMasters
Get list of maximum stamina table 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<MaxStaminaTableMaster> | List of Maximum Stamina Table 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/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeMaxStaminaTableMasters(
&stamina.DescribeMaxStaminaTableMastersRequest {
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeMaxStaminaTableMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeMaxStaminaTableMasters(
(new DescribeMaxStaminaTableMastersRequest())
->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeMaxStaminaTableMastersRequest;
import io.gs2.stamina.result.DescribeMaxStaminaTableMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeMaxStaminaTableMastersResult result = client.describeMaxStaminaTableMasters(
new DescribeMaxStaminaTableMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<MaxStaminaTableMaster> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeMaxStaminaTableMastersRequest;
using Gs2.Gs2Stamina.Result.DescribeMaxStaminaTableMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeMaxStaminaTableMastersResult> asyncResult = null;
yield return client.DescribeMaxStaminaTableMasters(
new Gs2.Gs2Stamina.Request.DescribeMaxStaminaTableMastersRequest()
.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeMaxStaminaTableMasters(
new Gs2Stamina.DescribeMaxStaminaTableMastersRequest()
.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_max_stamina_table_masters(
stamina.DescribeMaxStaminaTableMastersRequest()
.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('stamina')
api_result = client.describe_max_stamina_table_masters({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_max_stamina_table_masters_async({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createMaxStaminaTableMaster
Create new maximum stamina table master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Maximum Stamina Value Table Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 128 chars | metadata | |||
experienceModelId | string | ✓ | ~ 1024 chars | Experience Model GRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | List of Maximum Staminas |
Result
Type | Description | |
---|---|---|
item | MaxStaminaTableMaster | Maximum Stamina table master created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateMaxStaminaTableMaster(
&stamina.CreateMaxStaminaTableMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("max-stamina-table-0001"),
Description: nil,
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-0001"),
Values: []*int32{
pointy.Int32(50),
pointy.Int32(150),
pointy.Int32(250),
pointy.Int32(350),
pointy.Int32(450),
pointy.Int32(550),
pointy.Int32(650),
pointy.Int32(750),
pointy.Int32(850),
pointy.Int32(950),
pointy.Int32(1050),
pointy.Int32(1150),
pointy.Int32(1250),
pointy.Int32(1350),
pointy.Int32(1450),
pointy.Int32(1550),
pointy.Int32(1650),
pointy.Int32(1750),
pointy.Int32(1850),
pointy.Int32(1950),
pointy.Int32(2050),
pointy.Int32(2150),
pointy.Int32(2250),
pointy.Int32(2350),
pointy.Int32(2450),
pointy.Int32(2550),
pointy.Int32(2650),
pointy.Int32(2750),
pointy.Int32(2850),
pointy.Int32(2950),
pointy.Int32(3050),
pointy.Int32(3150),
pointy.Int32(3250),
pointy.Int32(3350),
pointy.Int32(3450),
pointy.Int32(3550),
pointy.Int32(3650),
pointy.Int32(3750),
pointy.Int32(3850),
pointy.Int32(3950),
pointy.Int32(4050),
pointy.Int32(4150),
pointy.Int32(4250),
pointy.Int32(4350),
pointy.Int32(4450),
pointy.Int32(4550),
pointy.Int32(4650),
pointy.Int32(4750),
pointy.Int32(4850),
pointy.Int32(4950),
pointy.Int32(5050),
pointy.Int32(5150),
pointy.Int32(5250),
pointy.Int32(5350),
pointy.Int32(5450),
pointy.Int32(5550),
pointy.Int32(5650),
pointy.Int32(5750),
pointy.Int32(5850),
pointy.Int32(5950),
pointy.Int32(6050),
pointy.Int32(6150),
pointy.Int32(6250),
pointy.Int32(6350),
pointy.Int32(6450),
pointy.Int32(6550),
pointy.Int32(6650),
pointy.Int32(6750),
pointy.Int32(6850),
pointy.Int32(6950),
pointy.Int32(7050),
pointy.Int32(7150),
pointy.Int32(7250),
pointy.Int32(7350),
pointy.Int32(7450),
pointy.Int32(7550),
pointy.Int32(7650),
pointy.Int32(7750),
pointy.Int32(7850),
pointy.Int32(7950),
pointy.Int32(8050),
pointy.Int32(8150),
pointy.Int32(8250),
pointy.Int32(8350),
pointy.Int32(8450),
pointy.Int32(8550),
pointy.Int32(8650),
pointy.Int32(8750),
pointy.Int32(8850),
pointy.Int32(8950),
pointy.Int32(9050),
pointy.Int32(9150),
pointy.Int32(9250),
pointy.Int32(9350),
pointy.Int32(9450),
pointy.Int32(9550),
pointy.Int32(9650),
pointy.Int32(9750),
pointy.Int32(9850),
pointy.Int32(9950),
},
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateMaxStaminaTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createMaxStaminaTableMaster(
(new CreateMaxStaminaTableMasterRequest())
->withNamespaceName(self::namespace1)
->withName("max-stamina-table-0001")
->withDescription(null)
->withMetadata(null)
->withExperienceModelId("experienceModelId-0001")
->withValues([
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950,
])
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.CreateMaxStaminaTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateMaxStaminaTableMasterResult result = client.createMaxStaminaTableMaster(
new CreateMaxStaminaTableMasterRequest()
.withNamespaceName("namespace1")
.withName("max-stamina-table-0001")
.withDescription(null)
.withMetadata(null)
.withExperienceModelId("experienceModelId-0001")
.withValues(Arrays.asList(
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950
))
);
MaxStaminaTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateMaxStaminaTableMasterRequest;
using Gs2.Gs2Stamina.Result.CreateMaxStaminaTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateMaxStaminaTableMasterResult> asyncResult = null;
yield return client.CreateMaxStaminaTableMaster(
new Gs2.Gs2Stamina.Request.CreateMaxStaminaTableMasterRequest()
.WithNamespaceName("namespace1")
.WithName("max-stamina-table-0001")
.WithDescription(null)
.WithMetadata(null)
.WithExperienceModelId("experienceModelId-0001")
.WithValues(new int[] {
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950