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 | Require | Default | Limitation | Description |
---|
namespaceId | string | ✓ | | ~ 1024 chars | Namespace GRN |
name | string | ✓ | | ~ 32 chars | Namespace name |
description | string | | | ~ 1024 chars | description of Namespace |
overflowTriggerScript | ScriptSetting | | | | GS2-Script to handle overflow stamina during recovery process |
logSetting | LogSetting | | | | Log output settings |
createdAt | long | ✓ | | | Datetime of creation |
updatedAt | long | ✓ | | | Datetime of last update |
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 | 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 of Namespace |
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 | ✓ | | | Datetime of creation |
updatedAt | long | ✓ | | | Datetime of last update |
MaxStaminaTableMaster
Stamina Maximum Table Master
This entity defines the maximum value of stamina for each rank in GS2-Experience.
| Type | 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 of Namespace |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | List of Maximum Staminas |
createdAt | long | ✓ | | | Datetime of creation |
updatedAt | long | ✓ | | | Datetime of last update |
RecoverIntervalTableMaster
Stamina Recovery Interval Table Master
This entity defines the stamina recovery interval for each rank of GS2-Experience.
| Type | 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 of Namespace |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | Stamina recovery interval table for each rank |
createdAt | long | ✓ | | | Datetime of creation |
updatedAt | long | ✓ | | | Datetime of last update |
RecoverValueTableMaster
Stamina Recovery Value Table Master
This entity defines the amount of stamina recovery for each rank of GS2-Experience.
| Type | 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 of Namespace |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | Stamina recovery value table for each rank |
createdAt | long | ✓ | | | Datetime of creation |
updatedAt | long | ✓ | | | Datetime of last update |
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.
Please refer to the documentation for the format of the JSON file.
| Type | Require | Default | Limitation | Description |
---|
namespaceId | string | ✓ | | ~ 1024 chars | Namespace 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 | 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 | Require | Default | Limitation | Description |
---|
maxStaminaTableId | string | ✓ | | ~ 1024 chars | Maximum Stamina Table GRN |
name | string | ✓ | | ~ 128 chars | Maximum Stamina Value Table Name |
metadata | string | | | ~ 128 chars | metadata |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | List of Maximum Staminas |
RecoverIntervalTable
Stamina Recovery Interval Table
This entity defines the stamina recovery interval for each rank of GS2-Experience.
| Type | Require | Default | Limitation | Description |
---|
recoverIntervalTableId | string | ✓ | | ~ 1024 chars | Stamina Recovery Interval Table GRN |
name | string | ✓ | | ~ 128 chars | Stamina recovery interval table name |
metadata | string | | | ~ 128 chars | metadata |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | 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 | Require | Default | Limitation | Description |
---|
recoverValueTableId | string | ✓ | | ~ 1024 chars | Stamina Recovery Value Table GRN |
name | string | ✓ | | ~ 128 chars | Stamina recovery value table name |
metadata | string | | | ~ 128 chars | metadata |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | 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 | 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 |
lastRecoveredAt | long | ✓ | | | Datetime of creation |
createdAt | long | ✓ | | | Datetime of creation |
updatedAt | long | ✓ | | | Datetime of last update |
GitHubCheckoutSetting
| Type | 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 |
LogSetting
| Type | Require | Default | Limitation | Description |
---|
loggingNamespaceId | string | ✓ | | ~ 1024 chars | Namespace GRN |
ScriptSetting
| Type | 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 |
Methods
describeNamespaces
Get list of namespaces
Request
| Type | 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;
createNamespace
Create a new namespace
Request
| Type | Require | Default | Limitation | Description |
---|
name | string | ✓ | | ~ 32 chars | Namespace name |
description | string | | | ~ 1024 chars | description of Namespace |
overflowTriggerScript | ScriptSetting | | | | 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: &stamina.ScriptSetting{
TriggerScriptId: pointy.String("$script1.scriptId"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1"),
},
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((new \Gs2\Stamina\Model\ScriptSetting())
->withTriggerScriptId(self::$script1.scriptId)
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:queue:\namespace1"))
->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(new io.gs2.stamina.model.ScriptSetting()
.withTriggerScriptId("$script1.scriptId")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1"))
.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(new Gs2.Gs2Stamina.Model.ScriptSetting()
.WithTriggerScriptId("$script1.scriptId")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1"))
.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(new Gs2Stamina.model.ScriptSetting()
.withTriggerScriptId("$script1.scriptId")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1"))
.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(
stamina.ScriptSetting()
.with_trigger_script_id(self.script1.script_id)
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1'))
.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={
triggerScriptId='$script1.scriptId',
doneTriggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1',
},
logSetting={
loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 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;
getNamespace
Get namespace
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
Result
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;
updateNamespace
Update namespace
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
description | string | | | ~ 1024 chars | description of Namespace |
overflowTriggerScript | ScriptSetting | | | | 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;
deleteNamespace
Delete namespace
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 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;
describeStaminaModelMasters
Get list of Stamina Model Masters
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 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;
createStaminaModelMaster
Create new Stamina Model Master
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
name | string | ✓ | | ~ 128 chars | Stamina Model Name |
description | string | | | ~ 1024 chars | description of Namespace |
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
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;
getStaminaModelMaster
Obtained Stamina Model Master
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
staminaName | string | ✓ | | ~ 128 chars | Stamina Model Name |
Result
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;
updateStaminaModelMaster
Update Stamina Model Master
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
staminaName | string | ✓ | | ~ 128 chars | Stamina Model Name |
description | string | | | ~ 1024 chars | description of Namespace |
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
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;
deleteStaminaModelMaster
Delete Stamina Model Master
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
staminaName | string | ✓ | | ~ 128 chars | Stamina Model Name |
Result
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;
describeMaxStaminaTableMasters
Get list of maximum stamina table masters
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 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;
createMaxStaminaTableMaster
Create new maximum stamina table master
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
name | string | ✓ | | ~ 128 chars | Maximum Stamina Value Table Name |
description | string | | | ~ 1024 chars | description of Namespace |
metadata | string | | | ~ 128 chars | metadata |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | List of Maximum Staminas |
Result
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{
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,
},
}
)
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,
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
}),
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.createMaxStaminaTableMaster(
new Gs2Stamina.CreateMaxStaminaTableMasterRequest()
.withNamespaceName("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
])
);
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_max_stamina_table_master(
stamina.CreateMaxStaminaTableMasterRequest()
.with_namespace_name(self.hash1)
.with_name('max-stamina-table-0001')
.with_description(None)
.with_metadata(None)
.with_experience_model_id('experienceModelId-0001')
.with_values([ 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.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.create_max_stamina_table_master({
namespaceName='namespace1',
name='max-stamina-table-0001',
description=nil,
metadata=nil,
experienceModelId='experienceModelId-0001',
values={
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
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getMaxStaminaTableMaster
Get the maximum value table master of stamina
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
maxStaminaTableName | string | ✓ | | ~ 128 chars | Maximum Stamina Value Table Name |
Result
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.GetMaxStaminaTableMaster(
&stamina.GetMaxStaminaTableMasterRequest {
NamespaceName: pointy.String("namespace1"),
MaxStaminaTableName: pointy.String("max-stamina-table-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\GetMaxStaminaTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getMaxStaminaTableMaster(
(new GetMaxStaminaTableMasterRequest())
->withNamespaceName(self::namespace1)
->withMaxStaminaTableName("max-stamina-table-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.GetMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.GetMaxStaminaTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetMaxStaminaTableMasterResult result = client.getMaxStaminaTableMaster(
new GetMaxStaminaTableMasterRequest()
.withNamespaceName("namespace1")
.withMaxStaminaTableName("max-stamina-table-0001")
);
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.GetMaxStaminaTableMasterRequest;
using Gs2.Gs2Stamina.Result.GetMaxStaminaTableMasterResult;
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.GetMaxStaminaTableMasterResult> asyncResult = null;
yield return client.GetMaxStaminaTableMaster(
new Gs2.Gs2Stamina.Request.GetMaxStaminaTableMasterRequest()
.WithNamespaceName("namespace1")
.WithMaxStaminaTableName("max-stamina-table-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.getMaxStaminaTableMaster(
new Gs2Stamina.GetMaxStaminaTableMasterRequest()
.withNamespaceName("namespace1")
.withMaxStaminaTableName("max-stamina-table-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_max_stamina_table_master(
stamina.GetMaxStaminaTableMasterRequest()
.with_namespace_name(self.hash1)
.with_max_stamina_table_name('max-stamina-table-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_max_stamina_table_master({
namespaceName='namespace1',
maxStaminaTableName='max-stamina-table-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateMaxStaminaTableMaster
Update maximum stamina table master
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
maxStaminaTableName | string | ✓ | | ~ 128 chars | Maximum Stamina Value Table Name |
description | string | | | ~ 1024 chars | description of Namespace |
metadata | string | | | ~ 128 chars | metadata |
experienceModelId | string | ✓ | | ~ 1024 chars | Experience Model GRN |
values | List<int> | ✓ | | | List of Maximum Staminas |
Result
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.UpdateMaxStaminaTableMaster(
&stamina.UpdateMaxStaminaTableMasterRequest {
NamespaceName: pointy.String("namespace1"),
MaxStaminaTableName: pointy.String("max-stamina-table-0001"),
Description: pointy.String("description1"),
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-1001"),
Values: []int32{
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900,
},
}
)
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\UpdateMaxStaminaTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateMaxStaminaTableMaster(
(new UpdateMaxStaminaTableMasterRequest())
->withNamespaceName(self::namespace1)
->withMaxStaminaTableName("max-stamina-table-0001")
->withDescription("description1")
->withMetadata(null)
->withExperienceModelId("experienceModelId-1001")
->withValues([ 50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900,
])
);
$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.UpdateMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.UpdateMaxStaminaTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient