GS2-Stamina SDK API Reference

Specification of models and API references for GS2-Stamina SDK for various programming languages

Models

Namespace

Namespace

A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a namespace before you can start using each service.

Details
Type Condition Required Default Value Limits Description
namespaceId string
*
~ 1024 chars Namespace GRN
* Set automatically by the server
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Setting
Configuration for controlling how transactions are processed when executing stamina operations.
overflowTriggerScript string ~ 1024 chars Overflow Trigger Script
GRN of a GS2-Script to invoke when stamina overflows during recovery.
This script is triggered when time-based recovery would push stamina above the maximum value, allowing custom handling of the excess (e.g., converting overflow to items).
Script Trigger Reference - overflow
logSetting LogSetting Log Output Setting
Configuration for logging stamina-related operations such as consume, recover, and overflow events to GS2-Log.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

TransactionSetting

Transaction Setting

Transaction Setting controls execution methods, consistency, asynchronous processing, and conflict avoidance mechanisms of transactions. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous processing of Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.

Details
Type Condition Required Default Value Limits Description
enableAutoRun bool false Whether to automatically execute issued transactions on the server side
enableAtomicCommit bool {enableAutoRun} == true false Whether to commit the execution of transactions atomically
* Enabled only if enableAutoRun is true
transactionUseDistributor bool {enableAtomicCommit} == true false Whether to execute transactions asynchronously
* Enabled only if enableAtomicCommit is true
commitScriptResultInUseDistributor bool {transactionUseDistributor} == true false Whether to execute the commit processing of the script result asynchronously
* Enabled only if transactionUseDistributor is true
acquireActionUseJobQueue bool {enableAtomicCommit} == true false Whether to use GS2-JobQueue to execute the acquire action
* Enabled only if enableAtomicCommit is true
distributorNamespaceId string “grn:gs2:{region}:{ownerId}:distributor:default” ~ 1024 chars GS2-Distributor Namespace GRN used to execute transactions
queueNamespaceId string “grn:gs2:{region}:{ownerId}:queue:default” ~ 1024 chars GS2-JobQueue Namespace GRN used to execute transactions

ScriptSetting

Script Setting

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Because synchronous execution blocks processing until the script finishes executing, you can use the script result to stop the API execution or control the API response.

In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

Details
Type Condition Required Default Value Limits Description
triggerScriptId string ~ 1024 chars GS2-Script script GRN executed synchronously when the API is executed
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetType string (enum)
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none” How to execute asynchronous scripts
Specifies the type of script to use for asynchronous execution.
You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
DefinitionDescription
“none”None
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars GS2-Script script GRN for asynchronous execution
Must be specified in GRN format starting with “grn:gs2:”.
* Enabled only if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars GS2-JobQueue namespace GRN to execute asynchronous execution scripts
If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN.
There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason.
* Enabled only if doneTriggerTargetType is “gs2_script”

LogSetting

Log Output Setting

Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID), which is used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.

Details
Type Condition Required Default Value Limits Description
loggingNamespaceId string
~ 1024 chars GS2-Log namespace GRN to output logs
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setting for checking out master data from GitHub

Details
Type Condition Required Default Value Limits Description
apiKeyId string
~ 1024 chars GitHub API Key GRN
repositoryName string
~ 1024 chars Repository Name
sourcePath string
~ 1024 chars Master data (JSON) file path
referenceType string (enum)
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHash string {referenceType} == “commit_hash”
✓*
~ 1024 chars Commit hash
* Required if referenceType is “commit_hash”
branchName string {referenceType} == “branch”
✓*
~ 1024 chars Branch Name
* Required if referenceType is “branch”
tagName string {referenceType} == “tag”
✓*
~ 1024 chars Tag Name
* Required if referenceType is “tag”

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.

Details
Type Condition Required Default Value Limits Description
staminaId string
*
~ 1024 chars Stamina GRN
* Set automatically by the server
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
value int
0 ~ 2147483646 Stamina Value
The current stamina amount for this user, excluding any overflow.
This value increases automatically over time based on the recovery interval and recovery value, up to maxValue.
It is computed from the elapsed time since lastRecoveredAt using the formula: recoverSteps = elapsedMinutes / recoverIntervalMinutes.
maxValue int
1 ~ 2147483646 Maximum Stamina
The per-user maximum stamina value, resolved from the StaminaModel and optionally overridden by a MaxStaminaTable based on the player’s GS2-Experience rank.
When overflow is disabled, this value is floored at initialCapacity. When overflow is enabled, it is capped at maxCapacity.
Natural time-based recovery stops at this value.
recoverIntervalMinutes int 1 ~ 2147483646 Stamina Recovery Interval (Minutes)
The per-user recovery interval in minutes, resolved from the StaminaModel and optionally overridden by a RecoverIntervalTable based on the player’s GS2-Experience rank.
If no table is configured, the value falls back to the model’s default recoverIntervalMinutes.
recoverValue int 1 ~ 2147483646 Stamina Recovery Amount
The per-user recovery amount per tick, resolved from the StaminaModel and optionally overridden by a RecoverValueTable based on the player’s GS2-Experience rank.
If no table is configured, the value falls back to the model’s default recoverValue.
overflowValue int
0 ~ 2147483646 Overflow Value
The amount of stamina stored in excess of the normal maximum (maxValue).
This is only used when the StaminaModel has isOverflow enabled. The total effective stamina is value + overflowValue, capped at maxCapacity.
When stamina is consumed, overflow is consumed first before the base value.
nextRecoverAt long Next Recovery Time
The Unix timestamp (in milliseconds) when the next stamina recovery tick will occur.
Calculated as lastRecoveredAt + recoverIntervalMinutes (in ms). When stamina is already at maxValue, this field may be unset.
lastRecoveredAt long
*
Current time Datetime of last recovery
Unix time, milliseconds
*Automatically configured on the server
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

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.

Details
Type Condition Required Default Value Limits Description
staminaModelId string
*
~ 1024 chars Stamina Model GRN
* Set automatically by the server
name string
~ 128 chars Stamina Model name
Stamina Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
recoverIntervalMinutes int
0 ~ 2147483646 Recover Interval Minutes
The number of minutes between each stamina recovery tick.
Every time this interval elapses, the player’s stamina increases by the recover value amount.
Can be overridden per-user via GS2-Experience rank using a RecoverIntervalTable.
Set to 0 to disable automatic time-based recovery.
recoverValue int 1 0 ~ 2147483646 Recover Value
The amount of stamina recovered per recovery tick.
Each time the recover interval elapses, stamina increases by this value until the maximum is reached.
Can be overridden per-user via GS2-Experience rank using a RecoverValueTable.
Defaults to 1.
initialCapacity int
0 ~ 2147483646 Initial Capacity
The default maximum stamina value for all players.
When overflow is disabled, this serves as the floor for the per-user maximum value.
Can be overridden per-user via GS2-Experience rank using a MaxStaminaTable.
isOverflow bool
Is Overflow
Whether stamina can exceed the initial capacity through means such as item usage.
When enabled, stamina can be set above initialCapacity up to maxCapacity. Natural time-based recovery still caps at the normal maximum.
When disabled, the per-user maximum value is clamped to at least initialCapacity.
maxCapacity int {isOverflow} == true
✓*
0 ~ 2147483646 Max Capacity
The absolute upper limit of stamina when overflow is enabled.
Even with overflow, stamina cannot exceed this value. Only shown when isOverflow is true.
For example, if initialCapacity is 100 and maxCapacity is 200, items can boost stamina up to 200 but natural recovery stops at 100.
* Required if isOverflow is true
maxStaminaTable MaxStaminaTable Max Stamina Table
Reference to a MaxStaminaTable that dynamically determines the maximum stamina value based on the player’s GS2-Experience rank.
When set, the player’s max stamina is looked up from the table using their current rank index, overriding initialCapacity.
If not set, all players share the same initialCapacity as their maximum.
recoverIntervalTable RecoverIntervalTable Recover Interval Table
Reference to a RecoverIntervalTable that dynamically determines the recovery interval based on the player’s GS2-Experience rank.
When set, the player’s recovery interval is looked up from the table using their current rank index, overriding recoverIntervalMinutes.
If not set, all players share the same recoverIntervalMinutes.
recoverValueTable RecoverValueTable Recover Value Table
Reference to a RecoverValueTable that dynamically determines the recovery amount based on the player’s GS2-Experience rank.
When set, the player’s recovery value is looked up from the table using their current rank index, overriding recoverValue.
If not set, all players share the same recoverValue.

MaxStaminaTable

Maximum Stamina Table

This entity defines the maximum value of stamina for each rank of GS2-Experience.

Details
Type Condition Required Default Value Limits Description
name string
~ 128 chars Maximum Stamina Table Name
Maximum Stamina Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user maximum stamina.
values List<int>
1 ~ 1024 items Maximum Stamina Values by Rank
An array of maximum stamina values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the maximum stamina for players at rank i. The array length should match the number of ranks defined in the referenced ExperienceModel.

RecoverIntervalTable

Recovery Interval Table

This entity defines the stamina recovery interval for each rank of GS2-Experience.

Details
Type Condition Required Default Value Limits Description
name string
~ 128 chars Stamina recovery interval table name
Stamina recovery interval table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery interval.
values List<int>
1 ~ 1024 items Recovery Interval Values by Rank
An array of recovery interval values (in minutes) indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery interval for players at rank i, overriding the model’s default recoverIntervalMinutes.

RecoverValueTable

Stamina Recovery Amount Table

This entity defines the amount of stamina recovery for each rank of GS2-Experience.

Details
Type Condition Required Default Value Limits Description
name string
~ 128 chars Stamina Recovery Amount Table name
Stamina Recovery Amount Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery amount.
values List<int>
1 ~ 1024 items Recovery Amount Values by Rank
An array of recovery amount values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery amount per tick for players at rank i, overriding the model’s default recoverValue.

CurrentStaminaMaster

Currently active Stamina Model master data

This master data defines the Stamina Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data are updated on the server.

To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.

Details
Type Condition Required Default Value Limits Description
namespaceId string
*
~ 1024 chars Namespace GRN
* Set automatically by the server
settings string
~ 5242880 bytes (5MB) Master Data

StaminaModelMaster

Stamina Model Master

Stamina Model Master is data used to edit and manage Stamina Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Stamina Model actually referenced by the game.

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.

Details
Type Condition Required Default Value Limits Description
staminaModelId string
*
~ 1024 chars Stamina Model Master GRN
* Set automatically by the server
name string
~ 128 chars Stamina Model name
Stamina Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
description string ~ 1024 chars Description
recoverIntervalMinutes int
0 ~ 2147483646 Recover Interval Minutes
The number of minutes between each stamina recovery tick.
Every time this interval elapses, the player’s stamina increases by the recover value amount.
Can be overridden per-user via GS2-Experience rank using a RecoverIntervalTable.
Set to 0 to disable automatic time-based recovery.
recoverValue int 1 0 ~ 2147483646 Recover Value
The amount of stamina recovered per recovery tick.
Each time the recover interval elapses, stamina increases by this value until the maximum is reached.
Can be overridden per-user via GS2-Experience rank using a RecoverValueTable.
Defaults to 1.
initialCapacity int
0 ~ 2147483646 Initial Capacity
The default maximum stamina value for all players.
When overflow is disabled, this serves as the floor for the per-user maximum value.
Can be overridden per-user via GS2-Experience rank using a MaxStaminaTable.
isOverflow bool
Is Overflow
Whether stamina can exceed the initial capacity through means such as item usage.
When enabled, stamina can be set above initialCapacity up to maxCapacity. Natural time-based recovery still caps at the normal maximum.
When disabled, the per-user maximum value is clamped to at least initialCapacity.
maxCapacity int {isOverflow} == true
✓*
0 ~ 2147483646 Max Capacity
The absolute upper limit of stamina when overflow is enabled.
Even with overflow, stamina cannot exceed this value. Only shown when isOverflow is true.
* Required if isOverflow is true
maxStaminaTableName string ~ 128 chars Max Stamina Table Name
Name of the MaxStaminaTable that dynamically determines the maximum stamina value based on the player’s GS2-Experience rank.
When set, the player’s max stamina is looked up from the table using their current rank index, overriding initialCapacity.
recoverIntervalTableName string ~ 128 chars Recover Interval Table Name
Name of the RecoverIntervalTable that dynamically determines the recovery interval based on the player’s GS2-Experience rank.
When set, the player’s recovery interval is looked up from the table, overriding recoverIntervalMinutes.
recoverValueTableName string ~ 128 chars Recover Value Table Name
Name of the RecoverValueTable that dynamically determines the recovery amount based on the player’s GS2-Experience rank.
When set, the player’s recovery value is looked up from the table, overriding recoverValue.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

MaxStaminaTableMaster

Maximum Stamina Table Master

Maximum Stamina Table Master is data used to edit and manage maximum stamina table within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as maximum stamina table actually referenced by the game.

This entity defines the maximum value of stamina for each rank in GS2-Experience.

Details
Type Condition Required Default Value Limits Description
maxStaminaTableId string
*
~ 1024 chars Maximum Stamina Table Master GRN
* Set automatically by the server
name string
~ 128 chars Maximum Stamina Value Table Name
Maximum Stamina Value Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
description string ~ 1024 chars Description
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user maximum stamina.
values List<int>
1 ~ 1024 items Maximum Stamina Values by Rank
An array of maximum stamina values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the maximum stamina for players at rank i. The array length should match the number of ranks defined in the referenced ExperienceModel.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

RecoverIntervalTableMaster

Recovery Interval Table Master

Recovery Interval Table Master is data used to edit and manage Recovery Interval Table within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Recovery Interval Table actually referenced by the game.

This entity defines the stamina recovery interval for each rank of GS2-Experience.

Details
Type Condition Required Default Value Limits Description
recoverIntervalTableId string
*
~ 1024 chars Recovery Interval Table Master GRN
* Set automatically by the server
name string
~ 128 chars Recovery Interval Table name
Recovery Interval Table-specific name.-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
description string ~ 1024 chars Description
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery interval.
values List<int>
1 ~ 1024 items Recovery Interval Values by Rank
An array of recovery interval values (in minutes) indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery interval for players at rank i, overriding the model’s default recoverIntervalMinutes.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

RecoverValueTableMaster

Stamina Recovery Amount Table Master

Stamina Recovery Amount Table Master is data used to edit and manage Stamina Recovery Amount Table within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Stamina Recovery Amount Table actually referenced by the game.

This entity defines the amount of stamina recovery for each rank of GS2-Experience.

Details
Type Condition Required Default Value Limits Description
recoverValueTableId string
*
~ 1024 chars Stamina Recovery Amount Table Master GRN
* Set automatically by the server
name string
~ 128 chars Stamina Recovery Amount Table name
Stamina Recovery Amount Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
description string ~ 1024 chars Description
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery amount.
values List<int>
1 ~ 1024 items Recovery Amount Values by Rank
An array of recovery amount values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery amount per tick for players at rank i, overriding the model’s default recoverValue.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

Methods

describeNamespaces

Get a list of Namespaces

Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.

Details

Request

Type Condition Required Default Value Limits Description
namePrefix string ~ 64 chars Filter by Namespace name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<Namespace> List of Namespaces
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 {
        NamePrefix: nil,
        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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->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()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Stamina.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .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()
            .withNamePrefix(null)
            .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_name_prefix(None)
            .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({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createNamespace

Create a new Namespace

You must specify detailed information including the name, description, and various settings of the namespace.

Details

Request

Type Condition Required Default Value Limits Description
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Setting
Configuration for controlling how transactions are processed when executing stamina operations.
overflowTriggerScript string ~ 1024 chars Overflow Trigger Script
GRN of a GS2-Script to invoke when stamina overflows during recovery.
This script is triggered when time-based recovery would push stamina above the maximum value, allowing custom handling of the excess (e.g., converting overflow to items).
Script Trigger Reference - overflow
logSetting LogSetting Log Output Setting
Configuration for logging stamina-related operations such as consume, recover, and overflow events to GS2-Log.

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("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        OverflowTriggerScript: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script"),
        LogSetting: &stamina.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
            ->withLogSetting((new \Gs2\Stamina\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
            .withLogSetting(new io.gs2.stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Stamina.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
        .WithLogSetting(new Gs2.Gs2Stamina.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
            .withLogSetting(new Gs2Stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_overflow_trigger_script('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script')
            .with_log_setting(
                stamina.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Get Namespace status

Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

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("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Stamina.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
    );
    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('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;
client = gs2('stamina')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;

getNamespace

Get a Namespace

Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item Namespace Namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &stamina.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Stamina.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-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_namespace(
        stamina.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateNamespace

Update Namespace

Update the settings of the specified Namespace. You can change the description and other settings of the Namespace.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Setting
Configuration for controlling how transactions are processed when executing stamina operations.
overflowTriggerScript string ~ 1024 chars Overflow Trigger Script
GRN of a GS2-Script to invoke when stamina overflows during recovery.
This script is triggered when time-based recovery would push stamina above the maximum value, allowing custom handling of the excess (e.g., converting overflow to items).
Script Trigger Reference - overflow
logSetting LogSetting Log Output Setting
Configuration for logging stamina-related operations such as consume, recover, and overflow events to GS2-Log.

Result

Type Description
item Namespace Namespace updated

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("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        OverflowTriggerScript: nil,
        LogSetting: &stamina.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withOverflowTriggerScript(null)
            ->withLogSetting((new \Gs2\Stamina\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withOverflowTriggerScript(null)
            .withLogSetting(new io.gs2.stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Stamina.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithOverflowTriggerScript(null)
        .WithLogSetting(new Gs2.Gs2Stamina.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withOverflowTriggerScript(null)
            .withLogSetting(new Gs2Stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_overflow_trigger_script(None)
            .with_log_setting(
                stamina.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    overflowTriggerScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    overflowTriggerScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete Namespace

Delete the specified Namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item Namespace The 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("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Stamina.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-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_namespace(
        stamina.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.delete_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getServiceVersion

Get the microservice version

Details

Request

Request parameters: None

Result

Type Description
item string Version

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.GetServiceVersion(
    &stamina.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetServiceVersionRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetServiceVersionRequest;
import io.gs2.stamina.result.GetServiceVersionResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Stamina.Request.GetServiceVersionRequest(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getServiceVersion(
        new Gs2Stamina.GetServiceVersionRequest()
    );
    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_service_version(
        stamina.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_service_version({
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_service_version_async({
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

dumpUserDataByUserId

Dump data associated with the specified user ID

Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &stamina.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DumpUserDataByUserIdRequest;
import io.gs2.stamina.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Stamina.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Stamina.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.dump_user_data_by_user_id(
        stamina.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('stamina')

api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
url string URL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &stamina.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CheckDumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Stamina.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Stamina.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.check_dump_user_data_by_user_id(
        stamina.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('stamina')

api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

cleanUserDataByUserId

Delete user data

Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &stamina.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CleanUserDataByUserIdRequest;
import io.gs2.stamina.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Stamina.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Stamina.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.clean_user_data_by_user_id(
        stamina.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('stamina')

api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkCleanUserDataByUserId

Check if the clean of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &stamina.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CheckCleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Stamina.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Stamina.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.check_clean_user_data_by_user_id(
        stamina.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('stamina')

api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

prepareImportUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
uploadToken string Token used to reflect results after upload
uploadUrl string URL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &stamina.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\PrepareImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.stamina.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Stamina.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Stamina.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.prepare_import_user_data_by_user_id(
        stamina.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('stamina')

api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
uploadToken string
~ 1024 chars Token received in preparation for upload
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &stamina.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ImportUserDataByUserIdRequest;
import io.gs2.stamina.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Stamina.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);

try {
    const result = await client.importUserDataByUserId(
        new Gs2Stamina.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.import_user_data_by_user_id(
        stamina.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('stamina')

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
uploadToken string
~ 1024 chars Token received in preparation for upload
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
url string URL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &stamina.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CheckImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckImportUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Stamina.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Stamina.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.check_import_user_data_by_user_id(
        stamina.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('stamina')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

describeStaminas

Get a list of Stamina

Retrieves a paginated list of all stamina resources for the requesting user. Each stamina entry contains the current value, maximum value, recovery settings, and overflow amount.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<Stamina> List of Staminas
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.DescribeStaminas(
    &stamina.DescribeStaminasRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminasRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeStaminas(
        (new DescribeStaminasRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminasRequest;
import io.gs2.stamina.result.DescribeStaminasResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DescribeStaminasResult result = client.describeStaminas(
        new DescribeStaminasRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Stamina> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminasResult> asyncResult = null;
yield return client.DescribeStaminas(
    new Gs2.Gs2Stamina.Request.DescribeStaminasRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeStaminas(
        new Gs2Stamina.DescribeStaminasRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_staminas(
        stamina.DescribeStaminasRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_staminas({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')

api_result_handler = client.describe_staminas_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeStaminasByUserId

Get Stamina list by specifying a user ID

Retrieves a paginated list of all stamina resources for the specified user. Each stamina entry contains the current value, maximum value, recovery settings, and overflow amount.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<Stamina> List of Staminas
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.DescribeStaminasByUserId(
    &stamina.DescribeStaminasByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminasByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeStaminasByUserId(
        (new DescribeStaminasByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminasByUserIdRequest;
import io.gs2.stamina.result.DescribeStaminasByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DescribeStaminasByUserIdResult result = client.describeStaminasByUserId(
        new DescribeStaminasByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Stamina> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminasByUserIdResult> asyncResult = null;
yield return client.DescribeStaminasByUserId(
    new Gs2.Gs2Stamina.Request.DescribeStaminasByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeStaminasByUserId(
        new Gs2Stamina.DescribeStaminasByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_staminas_by_user_id(
        stamina.DescribeStaminasByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_staminas_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')

api_result_handler = client.describe_staminas_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getStamina

Get Stamina

Retrieves the specified stamina resource along with its stamina model. Returns the current stamina value, maximum value, recovery interval, recovery value, and overflow amount.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
accessToken string
~ 128 chars Access token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.GetStamina(
    &stamina.GetStaminaRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\GetStaminaRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStamina(
        (new GetStaminaRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.GetStaminaRequest;
import io.gs2.stamina.result.GetStaminaResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    GetStaminaResult result = client.getStamina(
        new GetStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaResult> asyncResult = null;
yield return client.GetStamina(
    new Gs2.Gs2Stamina.Request.GetStaminaRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.getStamina(
        new Gs2Stamina.GetStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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(
        stamina.GetStaminaRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_stamina({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.get_stamina_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

getStaminaByUserId

Get Stamina by specifying a user ID

Retrieves the specified stamina resource along with its stamina model for the given user. Returns the current stamina value, maximum value, recovery interval, recovery value, and overflow amount.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.GetStaminaByUserId(
    &stamina.GetStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\GetStaminaByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStaminaByUserId(
        (new GetStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.GetStaminaByUserIdRequest;
import io.gs2.stamina.result.GetStaminaByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    GetStaminaByUserIdResult result = client.getStaminaByUserId(
        new GetStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaByUserIdResult> asyncResult = null;
yield return client.GetStaminaByUserId(
    new Gs2.Gs2Stamina.Request.GetStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.getStaminaByUserId(
        new Gs2Stamina.GetStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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_by_user_id(
        stamina.GetStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.get_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

updateStaminaByUserId

Create and update Stamina by specifying a user ID

Manually sets all stamina properties at once including current value, maximum value, recovery interval, and recovery value. This is an administrative operation for direct overrides, preserving the current overflow and last recovered timestamp.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
value int
0 ~ 2147483646 Stamina Value
The current stamina amount for this user, excluding any overflow.
This value increases automatically over time based on the recovery interval and recovery value, up to maxValue.
It is computed from the elapsed time since lastRecoveredAt using the formula: recoverSteps = elapsedMinutes / recoverIntervalMinutes.
maxValue int
1 ~ 2147483646 Maximum Stamina
The per-user maximum stamina value, resolved from the StaminaModel and optionally overridden by a MaxStaminaTable based on the player’s GS2-Experience rank.
When overflow is disabled, this value is floored at initialCapacity. When overflow is enabled, it is capped at maxCapacity.
Natural time-based recovery stops at this value.
recoverIntervalMinutes int 1 ~ 2147483646 Stamina Recovery Interval (Minutes)
The per-user recovery interval in minutes, resolved from the StaminaModel and optionally overridden by a RecoverIntervalTable based on the player’s GS2-Experience rank.
If no table is configured, the value falls back to the model’s default recoverIntervalMinutes.
recoverValue int 1 ~ 2147483646 Stamina Recovery Amount
The per-user recovery amount per tick, resolved from the StaminaModel and optionally overridden by a RecoverValueTable based on the player’s GS2-Experience rank.
If no table is configured, the value falls back to the model’s default recoverValue.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.UpdateStaminaByUserId(
    &stamina.UpdateStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        Value: pointy.Int32(50),
        MaxValue: pointy.Int32(100),
        RecoverIntervalMinutes: nil,
        RecoverValue: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\UpdateStaminaByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateStaminaByUserId(
        (new UpdateStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withValue(50)
            ->withMaxValue(100)
            ->withRecoverIntervalMinutes(null)
            ->withRecoverValue(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.UpdateStaminaByUserIdRequest;
import io.gs2.stamina.result.UpdateStaminaByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    UpdateStaminaByUserIdResult result = client.updateStaminaByUserId(
        new UpdateStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withValue(50)
            .withMaxValue(100)
            .withRecoverIntervalMinutes(null)
            .withRecoverValue(null)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateStaminaByUserIdResult> asyncResult = null;
yield return client.UpdateStaminaByUserId(
    new Gs2.Gs2Stamina.Request.UpdateStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithValue(50)
        .WithMaxValue(100)
        .WithRecoverIntervalMinutes(null)
        .WithRecoverValue(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.updateStaminaByUserId(
        new Gs2Stamina.UpdateStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withValue(50)
            .withMaxValue(100)
            .withRecoverIntervalMinutes(null)
            .withRecoverValue(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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_by_user_id(
        stamina.UpdateStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_value(50)
            .with_max_value(100)
            .with_recover_interval_minutes(None)
            .with_recover_value(None)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    value=50,
    maxValue=100,
    recoverIntervalMinutes=nil,
    recoverValue=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.update_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    value=50,
    maxValue=100,
    recoverIntervalMinutes=nil,
    recoverValue=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

consumeStamina

Consume Stamina

Deducts the specified amount from the current stamina value. Returns an Insufficient error if the current stamina value is less than the consume amount.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
accessToken string
~ 128 chars Access token
consumeValue int
1 ~ 2147483646 Amount of stamina consumed

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.ConsumeStamina(
    &stamina.ConsumeStaminaRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ConsumeValue: pointy.Int32(50),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\ConsumeStaminaRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->consumeStamina(
        (new ConsumeStaminaRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withConsumeValue(50)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.ConsumeStaminaRequest;
import io.gs2.stamina.result.ConsumeStaminaResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    ConsumeStaminaResult result = client.consumeStamina(
        new ConsumeStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withConsumeValue(50)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.ConsumeStaminaResult> asyncResult = null;
yield return client.ConsumeStamina(
    new Gs2.Gs2Stamina.Request.ConsumeStaminaRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithConsumeValue(50),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.consumeStamina(
        new Gs2Stamina.ConsumeStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withConsumeValue(50)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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.consume_stamina(
        stamina.ConsumeStaminaRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_consume_value(50)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.consume_stamina({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    consumeValue=50,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.consume_stamina_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    consumeValue=50,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

consumeStaminaByUserId

Consume Stamina by specifying a user ID

Deducts the specified amount from the current stamina value for the given user. Returns an Insufficient error if the current stamina value is less than the consume amount.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
consumeValue int
1 ~ 2147483646 Amount of stamina consumed
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.ConsumeStaminaByUserId(
    &stamina.ConsumeStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        ConsumeValue: pointy.Int32(50),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\ConsumeStaminaByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->consumeStaminaByUserId(
        (new ConsumeStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withConsumeValue(50)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.ConsumeStaminaByUserIdRequest;
import io.gs2.stamina.result.ConsumeStaminaByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    ConsumeStaminaByUserIdResult result = client.consumeStaminaByUserId(
        new ConsumeStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withConsumeValue(50)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.ConsumeStaminaByUserIdResult> asyncResult = null;
yield return client.ConsumeStaminaByUserId(
    new Gs2.Gs2Stamina.Request.ConsumeStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithConsumeValue(50)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.consumeStaminaByUserId(
        new Gs2Stamina.ConsumeStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withConsumeValue(50)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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.consume_stamina_by_user_id(
        stamina.ConsumeStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_consume_value(50)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.consume_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    consumeValue=50,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.consume_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    consumeValue=50,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

applyStamina

Apply the natural recovery amount of the current stamina

Computes and applies the time-based automatic stamina recovery. The recovery amount is calculated based on the elapsed time since the last recovery, the recovery interval, and the recovery value configured in the stamina model.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
accessToken string
~ 128 chars Access token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.ApplyStamina(
    &stamina.ApplyStaminaRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\ApplyStaminaRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->applyStamina(
        (new ApplyStaminaRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.ApplyStaminaRequest;
import io.gs2.stamina.result.ApplyStaminaResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    ApplyStaminaResult result = client.applyStamina(
        new ApplyStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.ApplyStaminaResult> asyncResult = null;
yield return client.ApplyStamina(
    new Gs2.Gs2Stamina.Request.ApplyStaminaRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.applyStamina(
        new Gs2Stamina.ApplyStaminaRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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.apply_stamina(
        stamina.ApplyStaminaRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.apply_stamina({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.apply_stamina_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

applyStaminaByUserId

Apply the natural recovery amount of the current stamina by specifying the user ID

Computes and applies the time-based automatic stamina recovery for the specified user. The recovery amount is calculated based on the elapsed time since the last recovery, the recovery interval, and the recovery value configured in the stamina model.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.ApplyStaminaByUserId(
    &stamina.ApplyStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\ApplyStaminaByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->applyStaminaByUserId(
        (new ApplyStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.ApplyStaminaByUserIdRequest;
import io.gs2.stamina.result.ApplyStaminaByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    ApplyStaminaByUserIdResult result = client.applyStaminaByUserId(
        new ApplyStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.ApplyStaminaByUserIdResult> asyncResult = null;
yield return client.ApplyStaminaByUserId(
    new Gs2.Gs2Stamina.Request.ApplyStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.applyStaminaByUserId(
        new Gs2Stamina.ApplyStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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.apply_stamina_by_user_id(
        stamina.ApplyStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.apply_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.apply_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

recoverStaminaByUserId

Recover Stamina by specifying a user ID

Recovers stamina by the specified amount up to the maximum capacity. If the recovery causes the value to exceed the maximum and overflow mode is enabled, the excess is tracked as an overflow value.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
recoverValue int
1 ~ 2147483646 Amount of stamina recovery
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model
overflowValue int Stamina value transferred to GS2-Inbox without receiving more than the maximum Stamina value

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.RecoverStaminaByUserId(
    &stamina.RecoverStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RecoverValue: pointy.Int32(50),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
overflowValue := result.OverflowValue
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\RecoverStaminaByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->recoverStaminaByUserId(
        (new RecoverStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRecoverValue(50)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
    $overflowValue = $result->getOverflowValue();
} 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.RecoverStaminaByUserIdRequest;
import io.gs2.stamina.result.RecoverStaminaByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    RecoverStaminaByUserIdResult result = client.recoverStaminaByUserId(
        new RecoverStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
    int overflowValue = result.getOverflowValue();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.RecoverStaminaByUserIdResult> asyncResult = null;
yield return client.RecoverStaminaByUserId(
    new Gs2.Gs2Stamina.Request.RecoverStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRecoverValue(50)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
var overflowValue = result.OverflowValue;
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.recoverStaminaByUserId(
        new Gs2Stamina.RecoverStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
    const overflowValue = result.getOverflowValue();
} 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.recover_stamina_by_user_id(
        stamina.RecoverStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_recover_value(50)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
    overflow_value = result.overflow_value
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.recover_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
overflowValue = result.overflowValue;
client = gs2('stamina')

api_result_handler = client.recover_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
overflowValue = result.overflowValue;

raiseMaxValueByUserId

Add the maximum value of stamina by specifying the user ID

Permanently increases the maximum stamina capacity by the specified amount. Used for permanent stat increases such as level-up rewards or item effects.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
raiseValue int
0 ~ 2147483646 Maximum amount of stamina to be increased
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.RaiseMaxValueByUserId(
    &stamina.RaiseMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RaiseValue: pointy.Int32(10),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\RaiseMaxValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->raiseMaxValueByUserId(
        (new RaiseMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRaiseValue(10)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.RaiseMaxValueByUserIdRequest;
import io.gs2.stamina.result.RaiseMaxValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    RaiseMaxValueByUserIdResult result = client.raiseMaxValueByUserId(
        new RaiseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRaiseValue(10)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.RaiseMaxValueByUserIdResult> asyncResult = null;
yield return client.RaiseMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.RaiseMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRaiseValue(10)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.raiseMaxValueByUserId(
        new Gs2Stamina.RaiseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRaiseValue(10)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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.raise_max_value_by_user_id(
        stamina.RaiseMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_raise_value(10)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.raise_max_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    raiseValue=10,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.raise_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    raiseValue=10,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

decreaseMaxValue

Subtract the maximum value of stamina

Reduces the maximum stamina capacity by the specified amount. May be used to apply debuffs or penalties to stamina capacity.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
accessToken string
~ 128 chars Access token
decreaseValue int
0 ~ 2147483646 Maximum amount of stamina to be decreased

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.DecreaseMaxValue(
    &stamina.DecreaseMaxValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        DecreaseValue: pointy.Int32(10),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\DecreaseMaxValueRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->decreaseMaxValue(
        (new DecreaseMaxValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withDecreaseValue(10)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.DecreaseMaxValueRequest;
import io.gs2.stamina.result.DecreaseMaxValueResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DecreaseMaxValueResult result = client.decreaseMaxValue(
        new DecreaseMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withDecreaseValue(10)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DecreaseMaxValueResult> asyncResult = null;
yield return client.DecreaseMaxValue(
    new Gs2.Gs2Stamina.Request.DecreaseMaxValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithDecreaseValue(10),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.decreaseMaxValue(
        new Gs2Stamina.DecreaseMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withDecreaseValue(10)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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.decrease_max_value(
        stamina.DecreaseMaxValueRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_decrease_value(10)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.decrease_max_value({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    decreaseValue=10,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.decrease_max_value_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    decreaseValue=10,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

decreaseMaxValueByUserId

Subtract the maximum value of stamina by specifying the user ID

Reduces the maximum stamina capacity by the specified amount for the given user. May be used to apply debuffs or penalties to stamina capacity.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
decreaseValue int
0 ~ 2147483646 Maximum amount of stamina to be decreased
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
staminaModel StaminaModel Stamina Model

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.DecreaseMaxValueByUserId(
    &stamina.DecreaseMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        DecreaseValue: pointy.Int32(10),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
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\DecreaseMaxValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->decreaseMaxValueByUserId(
        (new DecreaseMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withDecreaseValue(10)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
} 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.DecreaseMaxValueByUserIdRequest;
import io.gs2.stamina.result.DecreaseMaxValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DecreaseMaxValueByUserIdResult result = client.decreaseMaxValueByUserId(
        new DecreaseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withDecreaseValue(10)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DecreaseMaxValueByUserIdResult> asyncResult = null;
yield return client.DecreaseMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.DecreaseMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithDecreaseValue(10)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
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.decreaseMaxValueByUserId(
        new Gs2Stamina.DecreaseMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withDecreaseValue(10)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
} 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.decrease_max_value_by_user_id(
        stamina.DecreaseMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_decrease_value(10)
            .with_time_offset_token(None)
    )
    item = result.item
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.decrease_max_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    decreaseValue=10,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.decrease_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    decreaseValue=10,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

setMaxValueByUserId

Update the maximum value of stamina by specifying a user ID

Sets the maximum stamina capacity to the specified value. The old stamina state is preserved in the response for audit purposes. Used for administrative overrides or special event adjustments.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
maxValue int
1 ~ 2147483646 Maximum Stamina
The per-user maximum stamina value, resolved from the StaminaModel and optionally overridden by a MaxStaminaTable based on the player’s GS2-Experience rank.
When overflow is disabled, this value is floored at initialCapacity. When overflow is enabled, it is capped at maxCapacity.
Natural time-based recovery stops at this value.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
old Stamina Stamina
staminaModel StaminaModel Stamina Model

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.SetMaxValueByUserId(
    &stamina.SetMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        MaxValue: pointy.Int32(100),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
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\SetMaxValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setMaxValueByUserId(
        (new SetMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withMaxValue(100)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} 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.SetMaxValueByUserIdRequest;
import io.gs2.stamina.result.SetMaxValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetMaxValueByUserIdResult result = client.setMaxValueByUserId(
        new SetMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withMaxValue(100)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.SetMaxValueByUserIdResult> asyncResult = null;
yield return client.SetMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.SetMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithMaxValue(100)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
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.setMaxValueByUserId(
        new Gs2Stamina.SetMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withMaxValue(100)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} 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.set_max_value_by_user_id(
        stamina.SetMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_max_value(100)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.set_max_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    maxValue=100,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.set_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    maxValue=100,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

setRecoverIntervalByUserId

Update stamina recovery interval (minutes) by specifying a user ID

Sets the stamina recovery interval to the specified value in minutes. The old stamina state is preserved in the response for audit purposes. Controls how frequently the stamina recovers automatically.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
recoverIntervalMinutes int
1 ~ 2147483646 Stamina recovery interval (minutes)
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
old Stamina Stamina
staminaModel StaminaModel Stamina Model

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.SetRecoverIntervalByUserId(
    &stamina.SetRecoverIntervalByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RecoverIntervalMinutes: pointy.Int32(10),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
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\SetRecoverIntervalByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverIntervalByUserId(
        (new SetRecoverIntervalByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRecoverIntervalMinutes(10)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} 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.SetRecoverIntervalByUserIdRequest;
import io.gs2.stamina.result.SetRecoverIntervalByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetRecoverIntervalByUserIdResult result = client.setRecoverIntervalByUserId(
        new SetRecoverIntervalByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverIntervalMinutes(10)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverIntervalByUserIdResult> asyncResult = null;
yield return client.SetRecoverIntervalByUserId(
    new Gs2.Gs2Stamina.Request.SetRecoverIntervalByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRecoverIntervalMinutes(10)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
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.setRecoverIntervalByUserId(
        new Gs2Stamina.SetRecoverIntervalByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverIntervalMinutes(10)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} 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.set_recover_interval_by_user_id(
        stamina.SetRecoverIntervalByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_recover_interval_minutes(10)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.set_recover_interval_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverIntervalMinutes=10,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.set_recover_interval_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverIntervalMinutes=10,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

setRecoverValueByUserId

Set the amount of stamina recovery by specifying the user ID

Sets the stamina recovery amount to the specified value. The old stamina state is preserved in the response for audit purposes. Controls how much stamina is recovered per recovery interval.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
recoverValue int
1 ~ 2147483646 Amount of stamina recovery
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina
old Stamina Stamina
staminaModel StaminaModel Stamina Model

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.SetRecoverValueByUserId(
    &stamina.SetRecoverValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        RecoverValue: pointy.Int32(50),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
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\SetRecoverValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverValueByUserId(
        (new SetRecoverValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withRecoverValue(50)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} 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.SetRecoverValueByUserIdRequest;
import io.gs2.stamina.result.SetRecoverValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetRecoverValueByUserIdResult result = client.setRecoverValueByUserId(
        new SetRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverValueByUserIdResult> asyncResult = null;
yield return client.SetRecoverValueByUserId(
    new Gs2.Gs2Stamina.Request.SetRecoverValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithRecoverValue(50)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
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.setRecoverValueByUserId(
        new Gs2Stamina.SetRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withRecoverValue(50)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} 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.set_recover_value_by_user_id(
        stamina.SetRecoverValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_recover_value(50)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.set_recover_value_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.set_recover_value_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    recoverValue=50,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

setMaxValueByStatus

Update maximum stamina using GS2-Experience status

Sets the maximum stamina capacity based on the rank value from a signed GS2-Experience status. The signed status body and signature are verified using the specified key, then the rank value is used to look up the corresponding maximum stamina from the max stamina table.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
accessToken string
~ 128 chars Access token
keyId string “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024 chars Encryption Key GRN
signedStatusBody string
~ 524288 chars GS2-Experience status body to be signed
signedStatusSignature string
~ 128 chars GS2-Experience Status Signature

Result

Type Description
item Stamina Stamina
old Stamina Stamina
staminaModel StaminaModel Stamina Model

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.SetMaxValueByStatus(
    &stamina.SetMaxValueByStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        KeyId: pointy.String("key-0001"),
        SignedStatusBody: pointy.String("statusBody..."),
        SignedStatusSignature: pointy.String("statusSignature..."),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
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\SetMaxValueByStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setMaxValueByStatus(
        (new SetMaxValueByStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withKeyId("key-0001")
            ->withSignedStatusBody("statusBody...")
            ->withSignedStatusSignature("statusSignature...")
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} 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.SetMaxValueByStatusRequest;
import io.gs2.stamina.result.SetMaxValueByStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetMaxValueByStatusResult result = client.setMaxValueByStatus(
        new SetMaxValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.SetMaxValueByStatusResult> asyncResult = null;
yield return client.SetMaxValueByStatus(
    new Gs2.Gs2Stamina.Request.SetMaxValueByStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithKeyId("key-0001")
        .WithSignedStatusBody("statusBody...")
        .WithSignedStatusSignature("statusSignature..."),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
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.setMaxValueByStatus(
        new Gs2Stamina.SetMaxValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} 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.set_max_value_by_status(
        stamina.SetMaxValueByStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_key_id('key-0001')
            .with_signed_status_body('statusBody...')
            .with_signed_status_signature('statusSignature...')
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.set_max_value_by_status({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.set_max_value_by_status_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

setRecoverIntervalByStatus

Update stamina recovery interval using GS2-Experience status

Sets the stamina recovery interval based on the rank value from a signed GS2-Experience status. The signed status body and signature are verified using the specified key, then the rank value is used to look up the corresponding recovery interval from the recover interval table.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
accessToken string
~ 128 chars Access token
keyId string “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024 chars Encryption Key GRN
signedStatusBody string
~ 524288 chars GS2-Experience status body to be signed
signedStatusSignature string
~ 128 chars GS2-Experience Status Signature

Result

Type Description
item Stamina Stamina
old Stamina Stamina
staminaModel StaminaModel Stamina Model

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.SetRecoverIntervalByStatus(
    &stamina.SetRecoverIntervalByStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        KeyId: pointy.String("key-0001"),
        SignedStatusBody: pointy.String("statusBody..."),
        SignedStatusSignature: pointy.String("statusSignature..."),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
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\SetRecoverIntervalByStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverIntervalByStatus(
        (new SetRecoverIntervalByStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withKeyId("key-0001")
            ->withSignedStatusBody("statusBody...")
            ->withSignedStatusSignature("statusSignature...")
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} 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.SetRecoverIntervalByStatusRequest;
import io.gs2.stamina.result.SetRecoverIntervalByStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetRecoverIntervalByStatusResult result = client.setRecoverIntervalByStatus(
        new SetRecoverIntervalByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverIntervalByStatusResult> asyncResult = null;
yield return client.SetRecoverIntervalByStatus(
    new Gs2.Gs2Stamina.Request.SetRecoverIntervalByStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithKeyId("key-0001")
        .WithSignedStatusBody("statusBody...")
        .WithSignedStatusSignature("statusSignature..."),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
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.setRecoverIntervalByStatus(
        new Gs2Stamina.SetRecoverIntervalByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} 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.set_recover_interval_by_status(
        stamina.SetRecoverIntervalByStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_key_id('key-0001')
            .with_signed_status_body('statusBody...')
            .with_signed_status_signature('statusSignature...')
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.set_recover_interval_by_status({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.set_recover_interval_by_status_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

setRecoverValueByStatus

Update stamina recovery amount using GS2-Experience status

Sets the stamina recovery amount based on the rank value from a signed GS2-Experience status. The signed status body and signature are verified using the specified key, then the rank value is used to look up the corresponding recovery amount from the recover value table.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
accessToken string
~ 128 chars Access token
keyId string “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024 chars Encryption Key GRN
signedStatusBody string
~ 524288 chars GS2-Experience status body to be signed
signedStatusSignature string
~ 128 chars GS2-Experience Status Signature

Result

Type Description
item Stamina Stamina
old Stamina Stamina
staminaModel StaminaModel Stamina Model

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.SetRecoverValueByStatus(
    &stamina.SetRecoverValueByStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        KeyId: pointy.String("key-0001"),
        SignedStatusBody: pointy.String("statusBody..."),
        SignedStatusSignature: pointy.String("statusSignature..."),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
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\SetRecoverValueByStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->setRecoverValueByStatus(
        (new SetRecoverValueByStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withAccessToken("accessToken-0001")
            ->withKeyId("key-0001")
            ->withSignedStatusBody("statusBody...")
            ->withSignedStatusSignature("statusSignature...")
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $staminaModel = $result->getStaminaModel();
} 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.SetRecoverValueByStatusRequest;
import io.gs2.stamina.result.SetRecoverValueByStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetRecoverValueByStatusResult result = client.setRecoverValueByStatus(
        new SetRecoverValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    Stamina item = result.getItem();
    Stamina old = result.getOld();
    StaminaModel staminaModel = result.getStaminaModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverValueByStatusResult> asyncResult = null;
yield return client.SetRecoverValueByStatus(
    new Gs2.Gs2Stamina.Request.SetRecoverValueByStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithAccessToken("accessToken-0001")
        .WithKeyId("key-0001")
        .WithSignedStatusBody("statusBody...")
        .WithSignedStatusSignature("statusSignature..."),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
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.setRecoverValueByStatus(
        new Gs2Stamina.SetRecoverValueByStatusRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withAccessToken("accessToken-0001")
            .withKeyId("key-0001")
            .withSignedStatusBody("statusBody...")
            .withSignedStatusSignature("statusSignature...")
    );
    const item = result.getItem();
    const old = result.getOld();
    const staminaModel = result.getStaminaModel();
} 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.set_recover_value_by_status(
        stamina.SetRecoverValueByStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_access_token('accessToken-0001')
            .with_key_id('key-0001')
            .with_signed_status_body('statusBody...')
            .with_signed_status_signature('statusSignature...')
    )
    item = result.item
    old = result.old
    stamina_model = result.stamina_model
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.set_recover_value_by_status({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')

api_result_handler = client.set_recover_value_by_status_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    accessToken="accessToken-0001",
    keyId="key-0001",
    signedStatusBody="statusBody...",
    signedStatusSignature="statusSignature...",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

deleteStaminaByUserId

Delete Stamina by specifying a user ID

Permanently deletes the specified stamina resource for the given user. This removes the stamina record entirely including its current value, recovery settings, and overflow amount.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina deleted

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.DeleteStaminaByUserId(
    &stamina.DeleteStaminaByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        StaminaName: pointy.String("stamina-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteStaminaByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteStaminaByUserId(
        (new DeleteStaminaByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteStaminaByUserIdRequest;
import io.gs2.stamina.result.DeleteStaminaByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DeleteStaminaByUserIdResult result = client.deleteStaminaByUserId(
        new DeleteStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteStaminaByUserIdResult> asyncResult = null;
yield return client.DeleteStaminaByUserId(
    new Gs2.Gs2Stamina.Request.DeleteStaminaByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.deleteStaminaByUserId(
        new Gs2Stamina.DeleteStaminaByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    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_by_user_id(
        stamina.DeleteStaminaByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.delete_stamina_by_user_id({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.delete_stamina_by_user_id_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaValue

Verify the value of the current stamina

Validates that the current stamina value meets the specified condition (less, lessEqual, greater, greaterEqual, equal, notEqual) against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item Stamina Stamina

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.VerifyStaminaValue(
    &stamina.VerifyStaminaValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaValueRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaValue(
        (new VerifyStaminaValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaValueRequest;
import io.gs2.stamina.result.VerifyStaminaValueResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaValueResult result = client.verifyStaminaValue(
        new VerifyStaminaValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaValueResult> asyncResult = null;
yield return client.VerifyStaminaValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaValue(
        new Gs2Stamina.VerifyStaminaValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    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.verify_stamina_value(
        stamina.VerifyStaminaValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaValueByUserId

Verify the value of the current Stamina by specifying a user ID

Validates that the current stamina value for the specified user meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina

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.VerifyStaminaValueByUserId(
    &stamina.VerifyStaminaValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaValueByUserId(
        (new VerifyStaminaValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaValueByUserIdResult result = client.verifyStaminaValueByUserId(
        new VerifyStaminaValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaValueByUserId(
        new Gs2Stamina.VerifyStaminaValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    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.verify_stamina_value_by_user_id(
        stamina.VerifyStaminaValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaMaxValue

Verify the value of the max stamina

Validates that the maximum stamina capacity (including buff modifications) meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item Stamina Stamina

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.VerifyStaminaMaxValue(
    &stamina.VerifyStaminaMaxValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaMaxValueRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaMaxValue(
        (new VerifyStaminaMaxValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaMaxValueRequest;
import io.gs2.stamina.result.VerifyStaminaMaxValueResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaMaxValueResult result = client.verifyStaminaMaxValue(
        new VerifyStaminaMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueResult> asyncResult = null;
yield return client.VerifyStaminaMaxValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaMaxValue(
        new Gs2Stamina.VerifyStaminaMaxValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    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.verify_stamina_max_value(
        stamina.VerifyStaminaMaxValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_max_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_max_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaMaxValueByUserId

Verify the value of the max stamina by specifying a user ID

Validates that the maximum stamina capacity (including buff modifications) for the specified user meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina

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.VerifyStaminaMaxValueByUserId(
    &stamina.VerifyStaminaMaxValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaMaxValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaMaxValueByUserId(
        (new VerifyStaminaMaxValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaMaxValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaMaxValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaMaxValueByUserIdResult result = client.verifyStaminaMaxValueByUserId(
        new VerifyStaminaMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaMaxValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaMaxValueByUserId(
        new Gs2Stamina.VerifyStaminaMaxValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    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.verify_stamina_max_value_by_user_id(
        stamina.VerifyStaminaMaxValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_max_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_max_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaRecoverIntervalMinutes

Verify the value of the recovery interval minutes

Validates that the stamina recovery interval (minutes) meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item Stamina Stamina

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.VerifyStaminaRecoverIntervalMinutes(
    &stamina.VerifyStaminaRecoverIntervalMinutesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverIntervalMinutesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverIntervalMinutes(
        (new VerifyStaminaRecoverIntervalMinutesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverIntervalMinutesRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverIntervalMinutesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaRecoverIntervalMinutesResult result = client.verifyStaminaRecoverIntervalMinutes(
        new VerifyStaminaRecoverIntervalMinutesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesResult> asyncResult = null;
yield return client.VerifyStaminaRecoverIntervalMinutes(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaRecoverIntervalMinutes(
        new Gs2Stamina.VerifyStaminaRecoverIntervalMinutesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    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.verify_stamina_recover_interval_minutes(
        stamina.VerifyStaminaRecoverIntervalMinutesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_recover_interval_minutes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_interval_minutes_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaRecoverIntervalMinutesByUserId

Verify the value of the recovery interval minutes by specifying a user ID

Validates that the stamina recovery interval (minutes) for the specified user meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina

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.VerifyStaminaRecoverIntervalMinutesByUserId(
    &stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverIntervalMinutesByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverIntervalMinutesByUserId(
        (new VerifyStaminaRecoverIntervalMinutesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverIntervalMinutesByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverIntervalMinutesByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaRecoverIntervalMinutesByUserIdResult result = client.verifyStaminaRecoverIntervalMinutesByUserId(
        new VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaRecoverIntervalMinutesByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaRecoverIntervalMinutesByUserId(
        new Gs2Stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    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.verify_stamina_recover_interval_minutes_by_user_id(
        stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_recover_interval_minutes_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_interval_minutes_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaRecoverValue

Verify the value of the recovery value

Validates that the stamina recovery amount (including buff modifications) meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item Stamina Stamina

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.VerifyStaminaRecoverValue(
    &stamina.VerifyStaminaRecoverValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverValueRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverValue(
        (new VerifyStaminaRecoverValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverValueRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverValueResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaRecoverValueResult result = client.verifyStaminaRecoverValue(
        new VerifyStaminaRecoverValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueResult> asyncResult = null;
yield return client.VerifyStaminaRecoverValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaRecoverValue(
        new Gs2Stamina.VerifyStaminaRecoverValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    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.verify_stamina_recover_value(
        stamina.VerifyStaminaRecoverValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_recover_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaRecoverValueByUserId

Verify the value of the recovery value by specifying a user ID

Validates that the stamina recovery amount (including buff modifications) for the specified user meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina

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.VerifyStaminaRecoverValueByUserId(
    &stamina.VerifyStaminaRecoverValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaRecoverValueByUserId(
        (new VerifyStaminaRecoverValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaRecoverValueByUserIdResult result = client.verifyStaminaRecoverValueByUserId(
        new VerifyStaminaRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaRecoverValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaRecoverValueByUserId(
        new Gs2Stamina.VerifyStaminaRecoverValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    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.verify_stamina_recover_value_by_user_id(
        stamina.VerifyStaminaRecoverValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_recover_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_recover_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaOverflowValue

Verify the value of the overflow value

Validates that the stamina overflow amount (excess stamina beyond maximum capacity) meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item Stamina Stamina

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.VerifyStaminaOverflowValue(
    &stamina.VerifyStaminaOverflowValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaOverflowValueRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaOverflowValue(
        (new VerifyStaminaOverflowValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaOverflowValueRequest;
import io.gs2.stamina.result.VerifyStaminaOverflowValueResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaOverflowValueResult result = client.verifyStaminaOverflowValue(
        new VerifyStaminaOverflowValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueResult> asyncResult = null;
yield return client.VerifyStaminaOverflowValue(
    new Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaOverflowValue(
        new Gs2Stamina.VerifyStaminaOverflowValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    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.verify_stamina_overflow_value(
        stamina.VerifyStaminaOverflowValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_overflow_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_overflow_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyStaminaOverflowValueByUserId

Verify the value of the overflow value by specifying a user ID

Validates that the stamina overflow amount for the specified user meets the specified condition against the given threshold without modifying any state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
staminaName string
~ 128 chars Stamina Model Name
The name of the StaminaModel that defines the recovery parameters, capacity, and table references for this stamina instance.
This links the per-user stamina state to its corresponding model definition.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Value is less than the specified value
“lessEqual”Value is less than or equal to the specified value
“greater”Value is greater than the specified value
“greaterEqual”Value is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
value int
0 ~ 2147483646 Value to be verified
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Stamina Stamina

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.VerifyStaminaOverflowValueByUserId(
    &stamina.VerifyStaminaOverflowValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        StaminaName: pointy.String("stamina-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaOverflowValueByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->verifyStaminaOverflowValueByUserId(
        (new VerifyStaminaOverflowValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withStaminaName("stamina-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaOverflowValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaOverflowValueByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    VerifyStaminaOverflowValueByUserIdResult result = client.verifyStaminaOverflowValueByUserId(
        new VerifyStaminaOverflowValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Stamina item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaOverflowValueByUserId(
    new Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithStaminaName("stamina-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.verifyStaminaOverflowValueByUserId(
        new Gs2Stamina.VerifyStaminaOverflowValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withStaminaName("stamina-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    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.verify_stamina_overflow_value_by_user_id(
        stamina.VerifyStaminaOverflowValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_stamina_name('stamina-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.verify_stamina_overflow_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.verify_stamina_overflow_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    staminaName="stamina-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeStaminaModels

Get a list of Stamina Models

Retrieves the list of active stamina models. Each stamina model defines recovery interval, recovery value, initial capacity, overflow settings, and optional lookup tables for level-based stamina parameters.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
items List<StaminaModel> List of Stamina Models

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.DescribeStaminaModels(
    &stamina.DescribeStaminaModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminaModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeStaminaModels(
        (new DescribeStaminaModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminaModelsRequest;
import io.gs2.stamina.result.DescribeStaminaModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DescribeStaminaModelsResult result = client.describeStaminaModels(
        new DescribeStaminaModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<StaminaModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminaModelsResult> asyncResult = null;
yield return client.DescribeStaminaModels(
    new Gs2.Gs2Stamina.Request.DescribeStaminaModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeStaminaModels(
        new Gs2Stamina.DescribeStaminaModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} 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_models(
        stamina.DescribeStaminaModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_stamina_models({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('stamina')

api_result_handler = client.describe_stamina_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

getStaminaModel

Get Stamina Model

Retrieves the specified stamina model including its recovery interval, recovery value, initial capacity, overflow configuration, and linked lookup table names.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model name
Stamina Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item StaminaModel Stamina Model

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.GetStaminaModel(
    &stamina.GetStaminaModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\GetStaminaModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStaminaModel(
        (new GetStaminaModelRequest())
            ->withNamespaceName("namespace-0001")
            ->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.GetStaminaModelRequest;
import io.gs2.stamina.result.GetStaminaModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    GetStaminaModelResult result = client.getStaminaModel(
        new GetStaminaModelRequest()
            .withNamespaceName("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    StaminaModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaModelResult> asyncResult = null;
yield return client.GetStaminaModel(
    new Gs2.Gs2Stamina.Request.GetStaminaModelRequest()
        .WithNamespaceName("namespace-0001")
        .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.getStaminaModel(
        new Gs2Stamina.GetStaminaModelRequest()
            .withNamespaceName("namespace-0001")
            .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(
        stamina.GetStaminaModelRequest()
            .with_namespace_name('namespace-0001')
            .with_stamina_name('stamina-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_stamina_model({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_stamina_model_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

exportMaster

Export Stamina Model Master in a master data format that can be activated

Exports the currently registered stamina model masters in an activatable master data format. The exported data contains all stamina model, maximum stamina table, recovery interval table, and recovery amount table definitions.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item CurrentStaminaMaster Stamina Model master data that can be activated

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.ExportMaster(
    &stamina.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ExportMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ExportMasterRequest;
import io.gs2.stamina.result.ExportMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentStaminaMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Stamina.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.exportMaster(
        new Gs2Stamina.ExportMasterRequest()
            .withNamespaceName("namespace-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.export_master(
        stamina.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.export_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.export_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getCurrentStaminaMaster

Get currently active Stamina Model master data

Retrieves the currently active stamina model master data including all stamina model, maximum stamina table, recovery interval table, and recovery amount table definitions that are being used.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item CurrentStaminaMaster Currently active Stamina Model master data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetCurrentStaminaMaster(
    &stamina.GetCurrentStaminaMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetCurrentStaminaMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getCurrentStaminaMaster(
        (new GetCurrentStaminaMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetCurrentStaminaMasterRequest;
import io.gs2.stamina.result.GetCurrentStaminaMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    GetCurrentStaminaMasterResult result = client.getCurrentStaminaMaster(
        new GetCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentStaminaMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetCurrentStaminaMasterResult> asyncResult = null;
yield return client.GetCurrentStaminaMaster(
    new Gs2.Gs2Stamina.Request.GetCurrentStaminaMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getCurrentStaminaMaster(
        new Gs2Stamina.GetCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-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_current_stamina_master(
        stamina.GetCurrentStaminaMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_current_stamina_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_current_stamina_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

preUpdateCurrentStaminaMaster

Update currently active Stamina Model master data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.
Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
uploadToken string Token used to reflect results after upload
uploadUrl string URL used to upload

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.PreUpdateCurrentStaminaMaster(
    &stamina.PreUpdateCurrentStaminaMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\PreUpdateCurrentStaminaMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentStaminaMaster(
        (new PreUpdateCurrentStaminaMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.PreUpdateCurrentStaminaMasterRequest;
import io.gs2.stamina.result.PreUpdateCurrentStaminaMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    PreUpdateCurrentStaminaMasterResult result = client.preUpdateCurrentStaminaMaster(
        new PreUpdateCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.PreUpdateCurrentStaminaMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentStaminaMaster(
    new Gs2.Gs2Stamina.Request.PreUpdateCurrentStaminaMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as 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.preUpdateCurrentStaminaMaster(
        new Gs2Stamina.PreUpdateCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import stamina

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)

try:
    result = client.pre_update_current_stamina_master(
        stamina.PreUpdateCurrentStaminaMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.pre_update_current_stamina_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('stamina')

api_result_handler = client.pre_update_current_stamina_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

updateCurrentStaminaMaster

Update currently active Stamina Model master data

Updates the currently active stamina model master data. Supports both direct update mode and pre-upload mode for handling large master data. In pre-upload mode, the settings are read using the upload token obtained from the PreUpdate API.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
mode string (enum)
enum {
  “direct”,
  “preUpload”
}
“direct” Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settings string {mode} == “direct”
✓*
~ 5242880 chars Master Data
* Required if mode is “direct”
uploadToken string {mode} == “preUpload”
✓*
~ 1024 chars Token obtained by pre-upload
Used to apply the uploaded master data.
* Required if mode is “preUpload”

Result

Type Description
item CurrentStaminaMaster Updated master data of the currently active Stamina Models

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.UpdateCurrentStaminaMaster(
    &stamina.UpdateCurrentStaminaMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateCurrentStaminaMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateCurrentStaminaMaster(
        (new UpdateCurrentStaminaMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
            ->withUploadToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateCurrentStaminaMasterRequest;
import io.gs2.stamina.result.UpdateCurrentStaminaMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    UpdateCurrentStaminaMasterResult result = client.updateCurrentStaminaMaster(
        new UpdateCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    CurrentStaminaMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterResult> asyncResult = null;
yield return client.UpdateCurrentStaminaMaster(
    new Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
        .WithUploadToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentStaminaMaster(
        new Gs2Stamina.UpdateCurrentStaminaMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    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_current_stamina_master(
        stamina.UpdateCurrentStaminaMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2019-02-14",\n  "staminaModels": [\n    {\n      "name": "quest",\n      "metadata": "QUEST",\n      "recoverIntervalMinutes": 15,\n      "recoverValue": 1,\n      "initialCapacity": 50,\n      "isOverflow": true,\n      "maxCapacity": 999,\n      "maxStaminaTable": {\n        "name": "playerLevel",\n        "metadata": "PLAYER_LEVEL",\n        "experienceModelId": "playerLevel",\n        "values": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      "recoverIntervalTable": {\n        "name": "staminaRecoverInterval",\n        "metadata": "STAMINA_RECOVER_INTERVAL",\n        "experienceModelId": "playerLevel",\n        "values": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      "recoverValueTable": {\n        "name": "staminaRecoverValue",\n        "metadata": "STAMINA_RECOVER_VALUE",\n        "experienceModelId": "playerLevel",\n        "values": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      "name": "raidBattle",\n      "metadata": "RAID_BATTLE",\n      "recoverIntervalMinutes": 60,\n      "recoverValue": 1,\n      "initialCapacity": 10,\n      "isOverflow": false\n    },\n    {\n      "name": "special",\n      "metadata": "SPECIAL",\n      "recoverIntervalMinutes": 30,\n      "recoverValue": 3,\n      "initialCapacity": 100,\n      "isOverflow": true,\n      "maxCapacity": 999,\n      "maxStaminaTable": {\n        "name": "special",\n        "metadata": "SPECIAL",\n        "experienceModelId": "special",\n        "values": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_current_stamina_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}",
    uploadToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.update_current_stamina_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-02-14\",\n  \"staminaModels\": [\n    {\n      \"name\": \"quest\",\n      \"metadata\": \"QUEST\",\n      \"recoverIntervalMinutes\": 15,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 50,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"playerLevel\",\n        \"metadata\": \"PLAYER_LEVEL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129\n        ]\n      },\n      \"recoverIntervalTable\": {\n        \"name\": \"staminaRecoverInterval\",\n        \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109,\n          110,\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119\n        ]\n      },\n      \"recoverValueTable\": {\n        \"name\": \"staminaRecoverValue\",\n        \"metadata\": \"STAMINA_RECOVER_VALUE\",\n        \"experienceModelId\": \"playerLevel\",\n        \"values\": [\n          31,\n          32,\n          33,\n          34,\n          35,\n          36,\n          37,\n          38,\n          39,\n          40,\n          41,\n          42,\n          43,\n          44,\n          45,\n          46,\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n          67,\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n          88,\n          89,\n          90,\n          91,\n          92,\n          93,\n          94,\n          95,\n          96,\n          97,\n          98,\n          99,\n          100,\n          101,\n          102,\n          103,\n          104,\n          105,\n          106,\n          107,\n          108,\n          109\n        ]\n      }\n    },\n    {\n      \"name\": \"raidBattle\",\n      \"metadata\": \"RAID_BATTLE\",\n      \"recoverIntervalMinutes\": 60,\n      \"recoverValue\": 1,\n      \"initialCapacity\": 10,\n      \"isOverflow\": false\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"recoverIntervalMinutes\": 30,\n      \"recoverValue\": 3,\n      \"initialCapacity\": 100,\n      \"isOverflow\": true,\n      \"maxCapacity\": 999,\n      \"maxStaminaTable\": {\n        \"name\": \"special\",\n        \"metadata\": \"SPECIAL\",\n        \"experienceModelId\": \"special\",\n        \"values\": [\n          102,\n          104,\n          106,\n          108,\n          110,\n          112,\n          114,\n          116,\n          118,\n          120,\n          122,\n          124,\n          126,\n          128,\n          130,\n          132,\n          134,\n          136,\n          138,\n          140,\n          142,\n          144,\n          146,\n          148,\n          150,\n          152,\n          154,\n          156,\n          158,\n          160,\n          162,\n          164,\n          166,\n          168,\n          170,\n          172,\n          174,\n          176,\n          178,\n          180,\n          182,\n          184,\n          186,\n          188,\n          190,\n          192,\n          194,\n          196,\n          198,\n          200,\n          202,\n          204,\n          206,\n          208,\n          210,\n          212,\n          214,\n          216,\n          218,\n          220,\n          222,\n          224,\n          226,\n          228,\n          230,\n          232,\n          234,\n          236,\n          238,\n          240,\n          242,\n          244,\n          246,\n          248,\n          250,\n          252,\n          254,\n          256,\n          258\n        ]\n      }\n    }\n  ]\n}",
    uploadToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateCurrentStaminaMasterFromGitHub

Update currently active Stamina Model master data from GitHub

Updates the currently active stamina model master data by checking out master data from a GitHub repository using the specified checkout settings. The API key is decrypted via the key service to authenticate with GitHub.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSetting GitHubCheckoutSetting
Setting for checking out master data from GitHub

Result

Type Description
item CurrentStaminaMaster Updated master data of the currently active Stamina Models

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.UpdateCurrentStaminaMasterFromGitHub(
    &stamina.UpdateCurrentStaminaMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &stamina.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateCurrentStaminaMasterFromGitHubRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateCurrentStaminaMasterFromGitHub(
        (new UpdateCurrentStaminaMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateCurrentStaminaMasterFromGitHubRequest;
import io.gs2.stamina.result.UpdateCurrentStaminaMasterFromGitHubResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    UpdateCurrentStaminaMasterFromGitHubResult result = client.updateCurrentStaminaMasterFromGitHub(
        new UpdateCurrentStaminaMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentStaminaMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentStaminaMasterFromGitHub(
    new Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Stamina.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentStaminaMasterFromGitHub(
        new Gs2Stamina.UpdateCurrentStaminaMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Stamina.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_current_stamina_master_from_git_hub(
        stamina.UpdateCurrentStaminaMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(stamina.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_current_stamina_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.update_current_stamina_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeStaminaModelMasters

Get a list of Stamina Model Masters

Retrieves a paginated list of stamina model masters. Can filter by name prefix. Stamina model masters define recovery interval, recovery value, initial capacity, overflow settings, and optional lookup table associations.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefix string ~ 64 chars Filter by Stamina Model name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

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("namespace-0001"),
        NamePrefix: nil,
        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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeStaminaModelMasters(
        (new DescribeStaminaModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->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("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<StaminaModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminaModelMastersResult> asyncResult = null;
yield return client.DescribeStaminaModelMasters(
    new Gs2.Gs2Stamina.Request.DescribeStaminaModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .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("namespace-0001")
            .withNamePrefix(null)
            .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('namespace-0001')
            .with_name_prefix(None)
            .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="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')

api_result_handler = client.describe_stamina_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createStaminaModelMaster

Create a new Stamina Model Master

Creates a new stamina model master with recovery interval (minutes), recovery value, initial capacity, overflow mode setting, maximum capacity, and optional associations to max stamina table, recover interval table, and recover value table for level-based parameter scaling.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Stamina Model name
Stamina Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
recoverIntervalMinutes int
0 ~ 2147483646 Recover Interval Minutes
The number of minutes between each stamina recovery tick.
Every time this interval elapses, the player’s stamina increases by the recover value amount.
Can be overridden per-user via GS2-Experience rank using a RecoverIntervalTable.
Set to 0 to disable automatic time-based recovery.
recoverValue int 1 0 ~ 2147483646 Recover Value
The amount of stamina recovered per recovery tick.
Each time the recover interval elapses, stamina increases by this value until the maximum is reached.
Can be overridden per-user via GS2-Experience rank using a RecoverValueTable.
Defaults to 1.
initialCapacity int
0 ~ 2147483646 Initial Capacity
The default maximum stamina value for all players.
When overflow is disabled, this serves as the floor for the per-user maximum value.
Can be overridden per-user via GS2-Experience rank using a MaxStaminaTable.
isOverflow bool
Is Overflow
Whether stamina can exceed the initial capacity through means such as item usage.
When enabled, stamina can be set above initialCapacity up to maxCapacity. Natural time-based recovery still caps at the normal maximum.
When disabled, the per-user maximum value is clamped to at least initialCapacity.
maxCapacity int {isOverflow} == true
✓*
0 ~ 2147483646 Max Capacity
The absolute upper limit of stamina when overflow is enabled.
Even with overflow, stamina cannot exceed this value. Only shown when isOverflow is true.
* Required if isOverflow is true
maxStaminaTableName string ~ 128 chars Max Stamina Table Name
Name of the MaxStaminaTable that dynamically determines the maximum stamina value based on the player’s GS2-Experience rank.
When set, the player’s max stamina is looked up from the table using their current rank index, overriding initialCapacity.
recoverIntervalTableName string ~ 128 chars Recover Interval Table Name
Name of the RecoverIntervalTable that dynamically determines the recovery interval based on the player’s GS2-Experience rank.
When set, the player’s recovery interval is looked up from the table, overriding recoverIntervalMinutes.
recoverValueTableName string ~ 128 chars Recover Value Table Name
Name of the RecoverValueTable that dynamically determines the recovery amount based on the player’s GS2-Experience rank.
When set, the player’s recovery value is looked up from the table, overriding recoverValue.

Result

Type Description
item StaminaModelMaster Stamina Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateStaminaModelMaster(
    &stamina.CreateStaminaModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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("maxStaminaTable-0001"),
        RecoverIntervalTableName: pointy.String("recoverIntervalTable-0001"),
        RecoverValueTableName: pointy.String("recoverValueTable-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\CreateStaminaModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createStaminaModelMaster(
        (new CreateStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("stamina-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withRecoverIntervalMinutes(15)
            ->withRecoverValue(null)
            ->withInitialCapacity(50)
            ->withIsOverflow(false)
            ->withMaxCapacity(null)
            ->withMaxStaminaTableName("maxStaminaTable-0001")
            ->withRecoverIntervalTableName("recoverIntervalTable-0001")
            ->withRecoverValueTableName("recoverValueTable-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.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("namespace-0001")
            .withName("stamina-0001")
            .withDescription(null)
            .withMetadata(null)
            .withRecoverIntervalMinutes(15)
            .withRecoverValue(null)
            .withInitialCapacity(50)
            .withIsOverflow(false)
            .withMaxCapacity(null)
            .withMaxStaminaTableName("maxStaminaTable-0001")
            .withRecoverIntervalTableName("recoverIntervalTable-0001")
            .withRecoverValueTableName("recoverValueTable-0001")
    );
    StaminaModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateStaminaModelMasterResult> asyncResult = null;
yield return client.CreateStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.CreateStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("stamina-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithRecoverIntervalMinutes(15)
        .WithRecoverValue(null)
        .WithInitialCapacity(50)
        .WithIsOverflow(false)
        .WithMaxCapacity(null)
        .WithMaxStaminaTableName("maxStaminaTable-0001")
        .WithRecoverIntervalTableName("recoverIntervalTable-0001")
        .WithRecoverValueTableName("recoverValueTable-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.createStaminaModelMaster(
        new Gs2Stamina.CreateStaminaModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("stamina-0001")
            .withDescription(null)
            .withMetadata(null)
            .withRecoverIntervalMinutes(15)
            .withRecoverValue(null)
            .withInitialCapacity(50)
            .withIsOverflow(false)
            .withMaxCapacity(null)
            .withMaxStaminaTableName("maxStaminaTable-0001")
            .withRecoverIntervalTableName("recoverIntervalTable-0001")
            .withRecoverValueTableName("recoverValueTable-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.create_stamina_model_master(
        stamina.CreateStaminaModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .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('maxStaminaTable-0001')
            .with_recover_interval_table_name('recover_interval_table-0001')
            .with_recover_value_table_name('recoverValueTable-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.create_stamina_model_master({
    namespaceName="namespace-0001",
    name="stamina-0001",
    description=nil,
    metadata=nil,
    recoverIntervalMinutes=15,
    recoverValue=nil,
    initialCapacity=50,
    isOverflow=false,
    maxCapacity=nil,
    maxStaminaTableName="maxStaminaTable-0001",
    recoverIntervalTableName="recoverIntervalTable-0001",
    recoverValueTableName="recoverValueTable-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.create_stamina_model_master_async({
    namespaceName="namespace-0001",
    name="stamina-0001",
    description=nil,
    metadata=nil,
    recoverIntervalMinutes=15,
    recoverValue=nil,
    initialCapacity=50,
    isOverflow=false,
    maxCapacity=nil,
    maxStaminaTableName="maxStaminaTable-0001",
    recoverIntervalTableName="recoverIntervalTable-0001",
    recoverValueTableName="recoverValueTable-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getStaminaModelMaster

Get Stamina Model Master

Retrieves the specified stamina model master including its recovery settings, capacity configuration, overflow mode, and linked lookup table names.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model name
Stamina Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item StaminaModelMaster Stamina Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetStaminaModelMaster(
    &stamina.GetStaminaModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getStaminaModelMaster(
        (new GetStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    StaminaModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaModelMasterResult> asyncResult = null;
yield return client.GetStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.GetStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    staminaName="stamina-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_stamina_model_master_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateStaminaModelMaster

Update Stamina Model Master

Updates the specified stamina model master’s description, metadata, recovery interval, recovery value, initial capacity, overflow settings, maximum capacity, and lookup table associations.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model name
Stamina Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
recoverIntervalMinutes int
0 ~ 2147483646 Recover Interval Minutes
The number of minutes between each stamina recovery tick.
Every time this interval elapses, the player’s stamina increases by the recover value amount.
Can be overridden per-user via GS2-Experience rank using a RecoverIntervalTable.
Set to 0 to disable automatic time-based recovery.
recoverValue int 1 0 ~ 2147483646 Recover Value
The amount of stamina recovered per recovery tick.
Each time the recover interval elapses, stamina increases by this value until the maximum is reached.
Can be overridden per-user via GS2-Experience rank using a RecoverValueTable.
Defaults to 1.
initialCapacity int
0 ~ 2147483646 Initial Capacity
The default maximum stamina value for all players.
When overflow is disabled, this serves as the floor for the per-user maximum value.
Can be overridden per-user via GS2-Experience rank using a MaxStaminaTable.
isOverflow bool
Is Overflow
Whether stamina can exceed the initial capacity through means such as item usage.
When enabled, stamina can be set above initialCapacity up to maxCapacity. Natural time-based recovery still caps at the normal maximum.
When disabled, the per-user maximum value is clamped to at least initialCapacity.
maxCapacity int {isOverflow} == true
✓*
0 ~ 2147483646 Max Capacity
The absolute upper limit of stamina when overflow is enabled.
Even with overflow, stamina cannot exceed this value. Only shown when isOverflow is true.
* Required if isOverflow is true
maxStaminaTableName string ~ 128 chars Max Stamina Table Name
Name of the MaxStaminaTable that dynamically determines the maximum stamina value based on the player’s GS2-Experience rank.
When set, the player’s max stamina is looked up from the table using their current rank index, overriding initialCapacity.
recoverIntervalTableName string ~ 128 chars Recover Interval Table Name
Name of the RecoverIntervalTable that dynamically determines the recovery interval based on the player’s GS2-Experience rank.
When set, the player’s recovery interval is looked up from the table, overriding recoverIntervalMinutes.
recoverValueTableName string ~ 128 chars Recover Value Table Name
Name of the RecoverValueTable that dynamically determines the recovery amount based on the player’s GS2-Experience rank.
When set, the player’s recovery value is looked up from the table, overriding recoverValue.

Result

Type Description
item StaminaModelMaster Stamina Model Master updated

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("namespace-0001"),
        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("maxStaminaTable-0002"),
        RecoverIntervalTableName: pointy.String("recoverIntervalTable-0002"),
        RecoverValueTableName: pointy.String("recoverValueTable-0002"),
    }
)
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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateStaminaModelMaster(
        (new UpdateStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withStaminaName("stamina-0001")
            ->withDescription("description1")
            ->withMetadata("STAMINA_MODEL_MASTER_0001")
            ->withRecoverIntervalMinutes(20)
            ->withRecoverValue(2)
            ->withInitialCapacity(60)
            ->withIsOverflow(true)
            ->withMaxCapacity(999)
            ->withMaxStaminaTableName("maxStaminaTable-0002")
            ->withRecoverIntervalTableName("recoverIntervalTable-0002")
            ->withRecoverValueTableName("recoverValueTable-0002")
    );
    $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("namespace-0001")
            .withStaminaName("stamina-0001")
            .withDescription("description1")
            .withMetadata("STAMINA_MODEL_MASTER_0001")
            .withRecoverIntervalMinutes(20)
            .withRecoverValue(2)
            .withInitialCapacity(60)
            .withIsOverflow(true)
            .withMaxCapacity(999)
            .withMaxStaminaTableName("maxStaminaTable-0002")
            .withRecoverIntervalTableName("recoverIntervalTable-0002")
            .withRecoverValueTableName("recoverValueTable-0002")
    );
    StaminaModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateStaminaModelMasterResult> asyncResult = null;
yield return client.UpdateStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.UpdateStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithStaminaName("stamina-0001")
        .WithDescription("description1")
        .WithMetadata("STAMINA_MODEL_MASTER_0001")
        .WithRecoverIntervalMinutes(20)
        .WithRecoverValue(2)
        .WithInitialCapacity(60)
        .WithIsOverflow(true)
        .WithMaxCapacity(999)
        .WithMaxStaminaTableName("maxStaminaTable-0002")
        .WithRecoverIntervalTableName("recoverIntervalTable-0002")
        .WithRecoverValueTableName("recoverValueTable-0002"),
    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("namespace-0001")
            .withStaminaName("stamina-0001")
            .withDescription("description1")
            .withMetadata("STAMINA_MODEL_MASTER_0001")
            .withRecoverIntervalMinutes(20)
            .withRecoverValue(2)
            .withInitialCapacity(60)
            .withIsOverflow(true)
            .withMaxCapacity(999)
            .withMaxStaminaTableName("maxStaminaTable-0002")
            .withRecoverIntervalTableName("recoverIntervalTable-0002")
            .withRecoverValueTableName("recoverValueTable-0002")
    );
    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('namespace-0001')
            .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('maxStaminaTable-0002')
            .with_recover_interval_table_name('recover_interval_table-0002')
            .with_recover_value_table_name('recoverValueTable-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_stamina_model_master({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    description="description1",
    metadata="STAMINA_MODEL_MASTER_0001",
    recoverIntervalMinutes=20,
    recoverValue=2,
    initialCapacity=60,
    isOverflow=true,
    maxCapacity=999,
    maxStaminaTableName="maxStaminaTable-0002",
    recoverIntervalTableName="recoverIntervalTable-0002",
    recoverValueTableName="recoverValueTable-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.update_stamina_model_master_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
    description="description1",
    metadata="STAMINA_MODEL_MASTER_0001",
    recoverIntervalMinutes=20,
    recoverValue=2,
    initialCapacity=60,
    isOverflow=true,
    maxCapacity=999,
    maxStaminaTableName="maxStaminaTable-0002",
    recoverIntervalTableName="recoverIntervalTable-0002",
    recoverValueTableName="recoverValueTable-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteStaminaModelMaster

Delete Stamina Model Master

Deletes the specified stamina model master. This only removes the master definition and does not affect the currently active stamina configuration.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
staminaName string
~ 128 chars Stamina Model name
Stamina Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item StaminaModelMaster Stamina Model Master deleted

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("namespace-0001"),
        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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteStaminaModelMaster(
        (new DeleteStaminaModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withStaminaName("stamina-0001")
    );
    StaminaModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteStaminaModelMasterResult> asyncResult = null;
yield return client.DeleteStaminaModelMaster(
    new Gs2.Gs2Stamina.Request.DeleteStaminaModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    staminaName="stamina-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.delete_stamina_model_master_async({
    namespaceName="namespace-0001",
    staminaName="stamina-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeMaxStaminaTableMasters

Get a list of Maximum Stamina Table Masters

Retrieves a paginated list of maximum stamina table masters. These tables map experience rank values to maximum stamina capacity, enabling level-based stamina scaling.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

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("namespace-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeMaxStaminaTableMasters(
        (new DescribeMaxStaminaTableMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<MaxStaminaTableMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeMaxStaminaTableMastersResult> asyncResult = null;
yield return client.DescribeMaxStaminaTableMasters(
    new Gs2.Gs2Stamina.Request.DescribeMaxStaminaTableMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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('namespace-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_max_stamina_table_masters({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')

api_result_handler = client.describe_max_stamina_table_masters_async({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createMaxStaminaTableMaster

Create a new Maximum Stamina Table Master

Creates a new maximum stamina table master with an experience model ID and a values array. The values array is indexed by experience rank, mapping each rank to the corresponding maximum stamina capacity.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Maximum Stamina Value Table Name
Maximum Stamina Value Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user maximum stamina.
values List<int>
1 ~ 1024 items Maximum Stamina Values by Rank
An array of maximum stamina values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the maximum stamina for players at rank i. The array length should match the number of ranks defined in the referenced ExperienceModel.

Result

Type Description
item MaxStaminaTableMaster Maximum Stamina Table Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateMaxStaminaTableMaster(
    &stamina.CreateMaxStaminaTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("max-stamina-table-0001"),
        Description: nil,
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-0001"),
        Values: []*int32{
            pointy.Int32(50),
            pointy.Int32(150),
            pointy.Int32(250),
            pointy.Int32(350),
            pointy.Int32(450),
            pointy.Int32(550),
            pointy.Int32(650),
            pointy.Int32(750),
            pointy.Int32(850),
            pointy.Int32(950),
            pointy.Int32(1050),
            pointy.Int32(1150),
            pointy.Int32(1250),
            pointy.Int32(1350),
            pointy.Int32(1450),
            pointy.Int32(1550),
            pointy.Int32(1650),
            pointy.Int32(1750),
            pointy.Int32(1850),
            pointy.Int32(1950),
            pointy.Int32(2050),
            pointy.Int32(2150),
            pointy.Int32(2250),
            pointy.Int32(2350),
            pointy.Int32(2450),
            pointy.Int32(2550),
            pointy.Int32(2650),
            pointy.Int32(2750),
            pointy.Int32(2850),
            pointy.Int32(2950),
            pointy.Int32(3050),
            pointy.Int32(3150),
            pointy.Int32(3250),
            pointy.Int32(3350),
            pointy.Int32(3450),
            pointy.Int32(3550),
            pointy.Int32(3650),
            pointy.Int32(3750),
            pointy.Int32(3850),
            pointy.Int32(3950),
            pointy.Int32(4050),
            pointy.Int32(4150),
            pointy.Int32(4250),
            pointy.Int32(4350),
            pointy.Int32(4450),
            pointy.Int32(4550),
            pointy.Int32(4650),
            pointy.Int32(4750),
            pointy.Int32(4850),
            pointy.Int32(4950),
            pointy.Int32(5050),
            pointy.Int32(5150),
            pointy.Int32(5250),
            pointy.Int32(5350),
            pointy.Int32(5450),
            pointy.Int32(5550),
            pointy.Int32(5650),
            pointy.Int32(5750),
            pointy.Int32(5850),
            pointy.Int32(5950),
            pointy.Int32(6050),
            pointy.Int32(6150),
            pointy.Int32(6250),
            pointy.Int32(6350),
            pointy.Int32(6450),
            pointy.Int32(6550),
            pointy.Int32(6650),
            pointy.Int32(6750),
            pointy.Int32(6850),
            pointy.Int32(6950),
            pointy.Int32(7050),
            pointy.Int32(7150),
            pointy.Int32(7250),
            pointy.Int32(7350),
            pointy.Int32(7450),
            pointy.Int32(7550),
            pointy.Int32(7650),
            pointy.Int32(7750),
            pointy.Int32(7850),
            pointy.Int32(7950),
            pointy.Int32(8050),
            pointy.Int32(8150),
            pointy.Int32(8250),
            pointy.Int32(8350),
            pointy.Int32(8450),
            pointy.Int32(8550),
            pointy.Int32(8650),
            pointy.Int32(8750),
            pointy.Int32(8850),
            pointy.Int32(8950),
            pointy.Int32(9050),
            pointy.Int32(9150),
            pointy.Int32(9250),
            pointy.Int32(9350),
            pointy.Int32(9450),
            pointy.Int32(9550),
            pointy.Int32(9650),
            pointy.Int32(9750),
            pointy.Int32(9850),
            pointy.Int32(9950),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateMaxStaminaTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createMaxStaminaTableMaster(
        (new CreateMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateMaxStaminaTableMasterResult> asyncResult = null;
yield return client.CreateMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.CreateMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.create_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    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
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getMaxStaminaTableMaster

Get Maximum Stamina Table Master

Retrieves the specified maximum stamina table master including its experience model association and rank-to-capacity values mapping.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
maxStaminaTableName string
~ 128 chars Maximum Stamina Value Table Name
Maximum Stamina Value Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item MaxStaminaTableMaster Maximum Stamina Table Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetMaxStaminaTableMaster(
    &stamina.GetMaxStaminaTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getMaxStaminaTableMaster(
        (new GetMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
    );
    MaxStaminaTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetMaxStaminaTableMasterResult> asyncResult = null;
yield return client.GetMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.GetMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateMaxStaminaTableMaster

Update Maximum Stamina Table Master

Updates the specified maximum stamina table master’s description, metadata, experience model association, and rank-to-capacity values mapping.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
maxStaminaTableName string
~ 128 chars Maximum Stamina Value Table Name
Maximum Stamina Value Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user maximum stamina.
values List<int>
1 ~ 1024 items Maximum Stamina Values by Rank
An array of maximum stamina values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the maximum stamina for players at rank i. The array length should match the number of ranks defined in the referenced ExperienceModel.

Result

Type Description
item MaxStaminaTableMaster Maximum Stamina Table Master updated

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("namespace-0001"),
        MaxStaminaTableName: pointy.String("max-stamina-table-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-1001"),
        Values: []*int32{
            pointy.Int32(50),
            pointy.Int32(200),
            pointy.Int32(350),
            pointy.Int32(500),
            pointy.Int32(650),
            pointy.Int32(800),
            pointy.Int32(950),
            pointy.Int32(1100),
            pointy.Int32(1250),
            pointy.Int32(1400),
            pointy.Int32(1550),
            pointy.Int32(1700),
            pointy.Int32(1850),
            pointy.Int32(2000),
            pointy.Int32(2150),
            pointy.Int32(2300),
            pointy.Int32(2450),
            pointy.Int32(2600),
            pointy.Int32(2750),
            pointy.Int32(2900),
            pointy.Int32(3050),
            pointy.Int32(3200),
            pointy.Int32(3350),
            pointy.Int32(3500),
            pointy.Int32(3650),
            pointy.Int32(3800),
            pointy.Int32(3950),
            pointy.Int32(4100),
            pointy.Int32(4250),
            pointy.Int32(4400),
            pointy.Int32(4550),
            pointy.Int32(4700),
            pointy.Int32(4850),
            pointy.Int32(5000),
            pointy.Int32(5150),
            pointy.Int32(5300),
            pointy.Int32(5450),
            pointy.Int32(5600),
            pointy.Int32(5750),
            pointy.Int32(5900),
            pointy.Int32(6050),
            pointy.Int32(6200),
            pointy.Int32(6350),
            pointy.Int32(6500),
            pointy.Int32(6650),
            pointy.Int32(6800),
            pointy.Int32(6950),
            pointy.Int32(7100),
            pointy.Int32(7250),
            pointy.Int32(7400),
            pointy.Int32(7550),
            pointy.Int32(7700),
            pointy.Int32(7850),
            pointy.Int32(8000),
            pointy.Int32(8150),
            pointy.Int32(8300),
            pointy.Int32(8450),
            pointy.Int32(8600),
            pointy.Int32(8750),
            pointy.Int32(8900),
            pointy.Int32(9050),
            pointy.Int32(9200),
            pointy.Int32(9350),
            pointy.Int32(9500),
            pointy.Int32(9650),
            pointy.Int32(9800),
            pointy.Int32(9950),
            pointy.Int32(10100),
            pointy.Int32(10250),
            pointy.Int32(10400),
            pointy.Int32(10550),
            pointy.Int32(10700),
            pointy.Int32(10850),
            pointy.Int32(11000),
            pointy.Int32(11150),
            pointy.Int32(11300),
            pointy.Int32(11450),
            pointy.Int32(11600),
            pointy.Int32(11750),
            pointy.Int32(11900),
            pointy.Int32(12050),
            pointy.Int32(12200),
            pointy.Int32(12350),
            pointy.Int32(12500),
            pointy.Int32(12650),
            pointy.Int32(12800),
            pointy.Int32(12950),
            pointy.Int32(13100),
            pointy.Int32(13250),
            pointy.Int32(13400),
            pointy.Int32(13550),
            pointy.Int32(13700),
            pointy.Int32(13850),
            pointy.Int32(14000),
            pointy.Int32(14150),
            pointy.Int32(14300),
            pointy.Int32(14450),
            pointy.Int32(14600),
            pointy.Int32(14750),
            pointy.Int32(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 Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateMaxStaminaTableMaster(
        (new UpdateMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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 client = new Gs2StaminaRestClient(session);

try {
    UpdateMaxStaminaTableMasterResult result = client.updateMaxStaminaTableMaster(
        new UpdateMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues(Arrays.asList(
                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
            ))
    );
    MaxStaminaTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateMaxStaminaTableMasterResult> asyncResult = null;
yield return client.UpdateMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.UpdateMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMaxStaminaTableName("max-stamina-table-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-1001")
        .WithValues(new int[] {
            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,
        }),
    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.updateMaxStaminaTableMaster(
        new Gs2Stamina.UpdateMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .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,
            ])
    );
    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_max_stamina_table_master(
        stamina.UpdateMaxStaminaTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_max_stamina_table_name('max-stamina-table-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-1001')
            .with_values([
                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.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_max_stamina_table_master({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        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(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.update_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        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
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteMaxStaminaTableMaster

Delete Maximum Stamina Table Master

Deletes the specified maximum stamina table master. This only removes the master definition and does not affect the currently active stamina configuration.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
maxStaminaTableName string
~ 128 chars Maximum Stamina Value Table Name
Maximum Stamina Value Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item MaxStaminaTableMaster Maximum Stamina Table Master deleted

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.DeleteMaxStaminaTableMaster(
    &stamina.DeleteMaxStaminaTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\DeleteMaxStaminaTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteMaxStaminaTableMaster(
        (new DeleteMaxStaminaTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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.DeleteMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.DeleteMaxStaminaTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DeleteMaxStaminaTableMasterResult result = client.deleteMaxStaminaTableMaster(
        new DeleteMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMaxStaminaTableName("max-stamina-table-0001")
    );
    MaxStaminaTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteMaxStaminaTableMasterResult> asyncResult = null;
yield return client.DeleteMaxStaminaTableMaster(
    new Gs2.Gs2Stamina.Request.DeleteMaxStaminaTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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.deleteMaxStaminaTableMaster(
        new Gs2Stamina.DeleteMaxStaminaTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .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.delete_max_stamina_table_master(
        stamina.DeleteMaxStaminaTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .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.delete_max_stamina_table_master({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.delete_max_stamina_table_master_async({
    namespaceName="namespace-0001",
    maxStaminaTableName="max-stamina-table-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeRecoverIntervalTableMasters

Get a list of Recovery Interval Table Masters

Retrieves a paginated list of recovery interval table masters. Can filter by name prefix. These tables map experience rank values to stamina recovery interval (minutes), enabling level-based recovery speed scaling.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefix string ~ 64 chars Filter by Recovery Interval Table name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<RecoverIntervalTableMaster> List of Recovery Interval 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.DescribeRecoverIntervalTableMasters(
    &stamina.DescribeRecoverIntervalTableMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        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\DescribeRecoverIntervalTableMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeRecoverIntervalTableMasters(
        (new DescribeRecoverIntervalTableMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->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.DescribeRecoverIntervalTableMastersRequest;
import io.gs2.stamina.result.DescribeRecoverIntervalTableMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DescribeRecoverIntervalTableMastersResult result = client.describeRecoverIntervalTableMasters(
        new DescribeRecoverIntervalTableMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RecoverIntervalTableMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeRecoverIntervalTableMastersResult> asyncResult = null;
yield return client.DescribeRecoverIntervalTableMasters(
    new Gs2.Gs2Stamina.Request.DescribeRecoverIntervalTableMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .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.describeRecoverIntervalTableMasters(
        new Gs2Stamina.DescribeRecoverIntervalTableMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .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_recover_interval_table_masters(
        stamina.DescribeRecoverIntervalTableMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .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_recover_interval_table_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')

api_result_handler = client.describe_recover_interval_table_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createRecoverIntervalTableMaster

Create a new Recovery Interval Table Master

Creates a new recovery interval table master with an experience model ID and a values array. The values array is indexed by experience rank, mapping each rank to the corresponding recovery interval in minutes.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Recovery Interval Table name
Recovery Interval Table-specific name.-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery interval.
values List<int>
1 ~ 1024 items Recovery Interval Values by Rank
An array of recovery interval values (in minutes) indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery interval for players at rank i, overriding the model’s default recoverIntervalMinutes.

Result

Type Description
item RecoverIntervalTableMaster Recovery Interval Table Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateRecoverIntervalTableMaster(
    &stamina.CreateRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("recover-interval-table-0001"),
        Description: nil,
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-0001"),
        Values: []*int32{
            pointy.Int32(40),
            pointy.Int32(140),
            pointy.Int32(240),
            pointy.Int32(340),
            pointy.Int32(440),
            pointy.Int32(540),
            pointy.Int32(640),
            pointy.Int32(740),
            pointy.Int32(840),
            pointy.Int32(940),
            pointy.Int32(1040),
            pointy.Int32(1140),
            pointy.Int32(1240),
            pointy.Int32(1340),
            pointy.Int32(1440),
            pointy.Int32(1540),
            pointy.Int32(1640),
            pointy.Int32(1740),
            pointy.Int32(1840),
            pointy.Int32(1940),
            pointy.Int32(2040),
            pointy.Int32(2140),
            pointy.Int32(2240),
            pointy.Int32(2340),
            pointy.Int32(2440),
            pointy.Int32(2540),
            pointy.Int32(2640),
            pointy.Int32(2740),
            pointy.Int32(2840),
            pointy.Int32(2940),
            pointy.Int32(3040),
            pointy.Int32(3140),
            pointy.Int32(3240),
            pointy.Int32(3340),
            pointy.Int32(3440),
            pointy.Int32(3540),
            pointy.Int32(3640),
            pointy.Int32(3740),
            pointy.Int32(3840),
            pointy.Int32(3940),
            pointy.Int32(4040),
            pointy.Int32(4140),
            pointy.Int32(4240),
            pointy.Int32(4340),
            pointy.Int32(4440),
            pointy.Int32(4540),
            pointy.Int32(4640),
            pointy.Int32(4740),
            pointy.Int32(4840),
            pointy.Int32(4940),
            pointy.Int32(5040),
            pointy.Int32(5140),
            pointy.Int32(5240),
            pointy.Int32(5340),
            pointy.Int32(5440),
            pointy.Int32(5540),
            pointy.Int32(5640),
            pointy.Int32(5740),
            pointy.Int32(5840),
            pointy.Int32(5940),
            pointy.Int32(6040),
            pointy.Int32(6140),
            pointy.Int32(6240),
            pointy.Int32(6340),
            pointy.Int32(6440),
            pointy.Int32(6540),
            pointy.Int32(6640),
            pointy.Int32(6740),
            pointy.Int32(6840),
            pointy.Int32(6940),
            pointy.Int32(7040),
            pointy.Int32(7140),
            pointy.Int32(7240),
            pointy.Int32(7340),
            pointy.Int32(7440),
            pointy.Int32(7540),
            pointy.Int32(7640),
            pointy.Int32(7740),
            pointy.Int32(7840),
            pointy.Int32(7940),
            pointy.Int32(8040),
            pointy.Int32(8140),
            pointy.Int32(8240),
            pointy.Int32(8340),
            pointy.Int32(8440),
            pointy.Int32(8540),
            pointy.Int32(8640),
            pointy.Int32(8740),
            pointy.Int32(8840),
            pointy.Int32(8940),
            pointy.Int32(9040),
            pointy.Int32(9140),
            pointy.Int32(9240),
            pointy.Int32(9340),
            pointy.Int32(9440),
            pointy.Int32(9540),
            pointy.Int32(9640),
            pointy.Int32(9740),
            pointy.Int32(9840),
            pointy.Int32(9940),
        },
    }
)
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\CreateRecoverIntervalTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createRecoverIntervalTableMaster(
        (new CreateRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("recover-interval-table-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-0001")
            ->withValues([
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940,
            ])
    );
    $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.CreateRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.CreateRecoverIntervalTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    CreateRecoverIntervalTableMasterResult result = client.createRecoverIntervalTableMaster(
        new CreateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-interval-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues(Arrays.asList(
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940
            ))
    );
    RecoverIntervalTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.CreateRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.CreateRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("recover-interval-table-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-0001")
        .WithValues(new int[] {
            40,
            140,
            240,
            340,
            440,
            540,
            640,
            740,
            840,
            940,
            1040,
            1140,
            1240,
            1340,
            1440,
            1540,
            1640,
            1740,
            1840,
            1940,
            2040,
            2140,
            2240,
            2340,
            2440,
            2540,
            2640,
            2740,
            2840,
            2940,
            3040,
            3140,
            3240,
            3340,
            3440,
            3540,
            3640,
            3740,
            3840,
            3940,
            4040,
            4140,
            4240,
            4340,
            4440,
            4540,
            4640,
            4740,
            4840,
            4940,
            5040,
            5140,
            5240,
            5340,
            5440,
            5540,
            5640,
            5740,
            5840,
            5940,
            6040,
            6140,
            6240,
            6340,
            6440,
            6540,
            6640,
            6740,
            6840,
            6940,
            7040,
            7140,
            7240,
            7340,
            7440,
            7540,
            7640,
            7740,
            7840,
            7940,
            8040,
            8140,
            8240,
            8340,
            8440,
            8540,
            8640,
            8740,
            8840,
            8940,
            9040,
            9140,
            9240,
            9340,
            9440,
            9540,
            9640,
            9740,
            9840,
            9940,
        }),
    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.createRecoverIntervalTableMaster(
        new Gs2Stamina.CreateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-interval-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues([
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940,
            ])
    );
    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_recover_interval_table_master(
        stamina.CreateRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('recover-interval-table-0001')
            .with_description(None)
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-0001')
            .with_values([
                40,
                140,
                240,
                340,
                440,
                540,
                640,
                740,
                840,
                940,
                1040,
                1140,
                1240,
                1340,
                1440,
                1540,
                1640,
                1740,
                1840,
                1940,
                2040,
                2140,
                2240,
                2340,
                2440,
                2540,
                2640,
                2740,
                2840,
                2940,
                3040,
                3140,
                3240,
                3340,
                3440,
                3540,
                3640,
                3740,
                3840,
                3940,
                4040,
                4140,
                4240,
                4340,
                4440,
                4540,
                4640,
                4740,
                4840,
                4940,
                5040,
                5140,
                5240,
                5340,
                5440,
                5540,
                5640,
                5740,
                5840,
                5940,
                6040,
                6140,
                6240,
                6340,
                6440,
                6540,
                6640,
                6740,
                6840,
                6940,
                7040,
                7140,
                7240,
                7340,
                7440,
                7540,
                7640,
                7740,
                7840,
                7940,
                8040,
                8140,
                8240,
                8340,
                8440,
                8540,
                8640,
                8740,
                8840,
                8940,
                9040,
                9140,
                9240,
                9340,
                9440,
                9540,
                9640,
                9740,
                9840,
                9940,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.create_recover_interval_table_master({
    namespaceName="namespace-0001",
    name="recover-interval-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        40,
        140,
        240,
        340,
        440,
        540,
        640,
        740,
        840,
        940,
        1040,
        1140,
        1240,
        1340,
        1440,
        1540,
        1640,
        1740,
        1840,
        1940,
        2040,
        2140,
        2240,
        2340,
        2440,
        2540,
        2640,
        2740,
        2840,
        2940,
        3040,
        3140,
        3240,
        3340,
        3440,
        3540,
        3640,
        3740,
        3840,
        3940,
        4040,
        4140,
        4240,
        4340,
        4440,
        4540,
        4640,
        4740,
        4840,
        4940,
        5040,
        5140,
        5240,
        5340,
        5440,
        5540,
        5640,
        5740,
        5840,
        5940,
        6040,
        6140,
        6240,
        6340,
        6440,
        6540,
        6640,
        6740,
        6840,
        6940,
        7040,
        7140,
        7240,
        7340,
        7440,
        7540,
        7640,
        7740,
        7840,
        7940,
        8040,
        8140,
        8240,
        8340,
        8440,
        8540,
        8640,
        8740,
        8840,
        8940,
        9040,
        9140,
        9240,
        9340,
        9440,
        9540,
        9640,
        9740,
        9840,
        9940
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.create_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    name="recover-interval-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        40,
        140,
        240,
        340,
        440,
        540,
        640,
        740,
        840,
        940,
        1040,
        1140,
        1240,
        1340,
        1440,
        1540,
        1640,
        1740,
        1840,
        1940,
        2040,
        2140,
        2240,
        2340,
        2440,
        2540,
        2640,
        2740,
        2840,
        2940,
        3040,
        3140,
        3240,
        3340,
        3440,
        3540,
        3640,
        3740,
        3840,
        3940,
        4040,
        4140,
        4240,
        4340,
        4440,
        4540,
        4640,
        4740,
        4840,
        4940,
        5040,
        5140,
        5240,
        5340,
        5440,
        5540,
        5640,
        5740,
        5840,
        5940,
        6040,
        6140,
        6240,
        6340,
        6440,
        6540,
        6640,
        6740,
        6840,
        6940,
        7040,
        7140,
        7240,
        7340,
        7440,
        7540,
        7640,
        7740,
        7840,
        7940,
        8040,
        8140,
        8240,
        8340,
        8440,
        8540,
        8640,
        8740,
        8840,
        8940,
        9040,
        9140,
        9240,
        9340,
        9440,
        9540,
        9640,
        9740,
        9840,
        9940
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getRecoverIntervalTableMaster

Get Recovery Interval Table Master

Retrieves the specified recovery interval table master including its experience model association and rank-to-interval values mapping.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
recoverIntervalTableName string
~ 128 chars Recovery Interval Table name
Recovery Interval Table-specific name.-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item RecoverIntervalTableMaster Stamina recovery interval table master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetRecoverIntervalTableMaster(
    &stamina.GetRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverIntervalTableName: pointy.String("recover-interval-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\GetRecoverIntervalTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getRecoverIntervalTableMaster(
        (new GetRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverIntervalTableName("recover-interval-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.GetRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.GetRecoverIntervalTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    GetRecoverIntervalTableMasterResult result = client.getRecoverIntervalTableMaster(
        new GetRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
    );
    RecoverIntervalTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.GetRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.GetRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverIntervalTableName("recover-interval-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.getRecoverIntervalTableMaster(
        new Gs2Stamina.GetRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-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_recover_interval_table_master(
        stamina.GetRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_interval_table_name('recover-interval-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_recover_interval_table_master({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateRecoverIntervalTableMaster

Update Recovery Interval Table Master

Updates the specified recovery interval table master’s description, metadata, experience model association, and rank-to-interval values mapping.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
recoverIntervalTableName string
~ 128 chars Recovery Interval Table name
Recovery Interval Table-specific name.-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery interval.
values List<int>
1 ~ 1024 items Recovery Interval Values by Rank
An array of recovery interval values (in minutes) indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery interval for players at rank i, overriding the model’s default recoverIntervalMinutes.

Result

Type Description
item RecoverIntervalTableMaster Recovery Interval Table Master updated

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.UpdateRecoverIntervalTableMaster(
    &stamina.UpdateRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverIntervalTableName: pointy.String("recover-interval-table-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-1001"),
        Values: []*int32{
            pointy.Int32(40),
            pointy.Int32(190),
            pointy.Int32(340),
            pointy.Int32(490),
            pointy.Int32(640),
            pointy.Int32(790),
            pointy.Int32(940),
            pointy.Int32(1090),
            pointy.Int32(1240),
            pointy.Int32(1390),
            pointy.Int32(1540),
            pointy.Int32(1690),
            pointy.Int32(1840),
            pointy.Int32(1990),
            pointy.Int32(2140),
            pointy.Int32(2290),
            pointy.Int32(2440),
            pointy.Int32(2590),
            pointy.Int32(2740),
            pointy.Int32(2890),
            pointy.Int32(3040),
            pointy.Int32(3190),
            pointy.Int32(3340),
            pointy.Int32(3490),
            pointy.Int32(3640),
            pointy.Int32(3790),
            pointy.Int32(3940),
            pointy.Int32(4090),
            pointy.Int32(4240),
            pointy.Int32(4390),
            pointy.Int32(4540),
            pointy.Int32(4690),
            pointy.Int32(4840),
            pointy.Int32(4990),
            pointy.Int32(5140),
            pointy.Int32(5290),
            pointy.Int32(5440),
            pointy.Int32(5590),
            pointy.Int32(5740),
            pointy.Int32(5890),
            pointy.Int32(6040),
            pointy.Int32(6190),
            pointy.Int32(6340),
            pointy.Int32(6490),
            pointy.Int32(6640),
            pointy.Int32(6790),
            pointy.Int32(6940),
            pointy.Int32(7090),
            pointy.Int32(7240),
            pointy.Int32(7390),
            pointy.Int32(7540),
            pointy.Int32(7690),
            pointy.Int32(7840),
            pointy.Int32(7990),
            pointy.Int32(8140),
            pointy.Int32(8290),
            pointy.Int32(8440),
            pointy.Int32(8590),
            pointy.Int32(8740),
            pointy.Int32(8890),
            pointy.Int32(9040),
            pointy.Int32(9190),
            pointy.Int32(9340),
            pointy.Int32(9490),
            pointy.Int32(9640),
            pointy.Int32(9790),
            pointy.Int32(9940),
            pointy.Int32(10090),
            pointy.Int32(10240),
            pointy.Int32(10390),
            pointy.Int32(10540),
            pointy.Int32(10690),
            pointy.Int32(10840),
            pointy.Int32(10990),
            pointy.Int32(11140),
            pointy.Int32(11290),
            pointy.Int32(11440),
            pointy.Int32(11590),
            pointy.Int32(11740),
            pointy.Int32(11890),
            pointy.Int32(12040),
            pointy.Int32(12190),
            pointy.Int32(12340),
            pointy.Int32(12490),
            pointy.Int32(12640),
            pointy.Int32(12790),
            pointy.Int32(12940),
            pointy.Int32(13090),
            pointy.Int32(13240),
            pointy.Int32(13390),
            pointy.Int32(13540),
            pointy.Int32(13690),
            pointy.Int32(13840),
            pointy.Int32(13990),
            pointy.Int32(14140),
            pointy.Int32(14290),
            pointy.Int32(14440),
            pointy.Int32(14590),
            pointy.Int32(14740),
            pointy.Int32(14890),
        },
    }
)
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\UpdateRecoverIntervalTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateRecoverIntervalTableMaster(
        (new UpdateRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverIntervalTableName("recover-interval-table-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-1001")
            ->withValues([
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890,
            ])
    );
    $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.UpdateRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.UpdateRecoverIntervalTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    UpdateRecoverIntervalTableMasterResult result = client.updateRecoverIntervalTableMaster(
        new UpdateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues(Arrays.asList(
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890
            ))
    );
    RecoverIntervalTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.UpdateRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.UpdateRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverIntervalTableName("recover-interval-table-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-1001")
        .WithValues(new int[] {
            40,
            190,
            340,
            490,
            640,
            790,
            940,
            1090,
            1240,
            1390,
            1540,
            1690,
            1840,
            1990,
            2140,
            2290,
            2440,
            2590,
            2740,
            2890,
            3040,
            3190,
            3340,
            3490,
            3640,
            3790,
            3940,
            4090,
            4240,
            4390,
            4540,
            4690,
            4840,
            4990,
            5140,
            5290,
            5440,
            5590,
            5740,
            5890,
            6040,
            6190,
            6340,
            6490,
            6640,
            6790,
            6940,
            7090,
            7240,
            7390,
            7540,
            7690,
            7840,
            7990,
            8140,
            8290,
            8440,
            8590,
            8740,
            8890,
            9040,
            9190,
            9340,
            9490,
            9640,
            9790,
            9940,
            10090,
            10240,
            10390,
            10540,
            10690,
            10840,
            10990,
            11140,
            11290,
            11440,
            11590,
            11740,
            11890,
            12040,
            12190,
            12340,
            12490,
            12640,
            12790,
            12940,
            13090,
            13240,
            13390,
            13540,
            13690,
            13840,
            13990,
            14140,
            14290,
            14440,
            14590,
            14740,
            14890,
        }),
    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.updateRecoverIntervalTableMaster(
        new Gs2Stamina.UpdateRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues([
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890,
            ])
    );
    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_recover_interval_table_master(
        stamina.UpdateRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_interval_table_name('recover-interval-table-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-1001')
            .with_values([
                40,
                190,
                340,
                490,
                640,
                790,
                940,
                1090,
                1240,
                1390,
                1540,
                1690,
                1840,
                1990,
                2140,
                2290,
                2440,
                2590,
                2740,
                2890,
                3040,
                3190,
                3340,
                3490,
                3640,
                3790,
                3940,
                4090,
                4240,
                4390,
                4540,
                4690,
                4840,
                4990,
                5140,
                5290,
                5440,
                5590,
                5740,
                5890,
                6040,
                6190,
                6340,
                6490,
                6640,
                6790,
                6940,
                7090,
                7240,
                7390,
                7540,
                7690,
                7840,
                7990,
                8140,
                8290,
                8440,
                8590,
                8740,
                8890,
                9040,
                9190,
                9340,
                9490,
                9640,
                9790,
                9940,
                10090,
                10240,
                10390,
                10540,
                10690,
                10840,
                10990,
                11140,
                11290,
                11440,
                11590,
                11740,
                11890,
                12040,
                12190,
                12340,
                12490,
                12640,
                12790,
                12940,
                13090,
                13240,
                13390,
                13540,
                13690,
                13840,
                13990,
                14140,
                14290,
                14440,
                14590,
                14740,
                14890,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_recover_interval_table_master({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        40,
        190,
        340,
        490,
        640,
        790,
        940,
        1090,
        1240,
        1390,
        1540,
        1690,
        1840,
        1990,
        2140,
        2290,
        2440,
        2590,
        2740,
        2890,
        3040,
        3190,
        3340,
        3490,
        3640,
        3790,
        3940,
        4090,
        4240,
        4390,
        4540,
        4690,
        4840,
        4990,
        5140,
        5290,
        5440,
        5590,
        5740,
        5890,
        6040,
        6190,
        6340,
        6490,
        6640,
        6790,
        6940,
        7090,
        7240,
        7390,
        7540,
        7690,
        7840,
        7990,
        8140,
        8290,
        8440,
        8590,
        8740,
        8890,
        9040,
        9190,
        9340,
        9490,
        9640,
        9790,
        9940,
        10090,
        10240,
        10390,
        10540,
        10690,
        10840,
        10990,
        11140,
        11290,
        11440,
        11590,
        11740,
        11890,
        12040,
        12190,
        12340,
        12490,
        12640,
        12790,
        12940,
        13090,
        13240,
        13390,
        13540,
        13690,
        13840,
        13990,
        14140,
        14290,
        14440,
        14590,
        14740,
        14890
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.update_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        40,
        190,
        340,
        490,
        640,
        790,
        940,
        1090,
        1240,
        1390,
        1540,
        1690,
        1840,
        1990,
        2140,
        2290,
        2440,
        2590,
        2740,
        2890,
        3040,
        3190,
        3340,
        3490,
        3640,
        3790,
        3940,
        4090,
        4240,
        4390,
        4540,
        4690,
        4840,
        4990,
        5140,
        5290,
        5440,
        5590,
        5740,
        5890,
        6040,
        6190,
        6340,
        6490,
        6640,
        6790,
        6940,
        7090,
        7240,
        7390,
        7540,
        7690,
        7840,
        7990,
        8140,
        8290,
        8440,
        8590,
        8740,
        8890,
        9040,
        9190,
        9340,
        9490,
        9640,
        9790,
        9940,
        10090,
        10240,
        10390,
        10540,
        10690,
        10840,
        10990,
        11140,
        11290,
        11440,
        11590,
        11740,
        11890,
        12040,
        12190,
        12340,
        12490,
        12640,
        12790,
        12940,
        13090,
        13240,
        13390,
        13540,
        13690,
        13840,
        13990,
        14140,
        14290,
        14440,
        14590,
        14740,
        14890
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteRecoverIntervalTableMaster

Delete Recovery Interval Table Master

Deletes the specified recovery interval table master. This only removes the master definition and does not affect the currently active stamina configuration.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
recoverIntervalTableName string
~ 128 chars Recovery Interval Table name
Recovery Interval Table-specific name.-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item RecoverIntervalTableMaster Recovery Interval Table Master deleted

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.DeleteRecoverIntervalTableMaster(
    &stamina.DeleteRecoverIntervalTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverIntervalTableName: pointy.String("recover-interval-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\DeleteRecoverIntervalTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteRecoverIntervalTableMaster(
        (new DeleteRecoverIntervalTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverIntervalTableName("recover-interval-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.DeleteRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.DeleteRecoverIntervalTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DeleteRecoverIntervalTableMasterResult result = client.deleteRecoverIntervalTableMaster(
        new DeleteRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-table-0001")
    );
    RecoverIntervalTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.DeleteRecoverIntervalTableMaster(
    new Gs2.Gs2Stamina.Request.DeleteRecoverIntervalTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverIntervalTableName("recover-interval-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.deleteRecoverIntervalTableMaster(
        new Gs2Stamina.DeleteRecoverIntervalTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverIntervalTableName("recover-interval-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.delete_recover_interval_table_master(
        stamina.DeleteRecoverIntervalTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_interval_table_name('recover-interval-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.delete_recover_interval_table_master({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.delete_recover_interval_table_master_async({
    namespaceName="namespace-0001",
    recoverIntervalTableName="recover-interval-table-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeRecoverValueTableMasters

Get a list of Stamina Recovery Amount Table Masters

Retrieves a paginated list of stamina recovery amount table masters. Can filter by name prefix. These tables map experience rank values to stamina recovery amounts per interval, enabling level-based recovery amount scaling.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefix string ~ 64 chars Filter by stamina recovery amount table name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<RecoverValueTableMaster> List of Stamina Recovery Amount 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.DescribeRecoverValueTableMasters(
    &stamina.DescribeRecoverValueTableMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        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\DescribeRecoverValueTableMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->describeRecoverValueTableMasters(
        (new DescribeRecoverValueTableMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->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.DescribeRecoverValueTableMastersRequest;
import io.gs2.stamina.result.DescribeRecoverValueTableMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DescribeRecoverValueTableMastersResult result = client.describeRecoverValueTableMasters(
        new DescribeRecoverValueTableMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RecoverValueTableMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DescribeRecoverValueTableMastersResult> asyncResult = null;
yield return client.DescribeRecoverValueTableMasters(
    new Gs2.Gs2Stamina.Request.DescribeRecoverValueTableMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .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.describeRecoverValueTableMasters(
        new Gs2Stamina.DescribeRecoverValueTableMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .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_recover_value_table_masters(
        stamina.DescribeRecoverValueTableMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .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_recover_value_table_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')

api_result_handler = client.describe_recover_value_table_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createRecoverValueTableMaster

Create a new Stamina Recovery Amount Table Master

Creates a new stamina recovery amount table master with an experience model ID and a values array. The values array is indexed by experience rank, mapping each rank to the corresponding recovery amount per interval.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Stamina Recovery Amount Table name
Stamina Recovery Amount Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery amount.
values List<int>
1 ~ 1024 items Recovery Amount Values by Rank
An array of recovery amount values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery amount per tick for players at rank i, overriding the model’s default recoverValue.

Result

Type Description
item RecoverValueTableMaster Stamina Recovery Amount Table Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.CreateRecoverValueTableMaster(
    &stamina.CreateRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("recover-value-table-0001"),
        Description: nil,
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-0001"),
        Values: []*int32{
            pointy.Int32(30),
            pointy.Int32(130),
            pointy.Int32(230),
            pointy.Int32(330),
            pointy.Int32(430),
            pointy.Int32(530),
            pointy.Int32(630),
            pointy.Int32(730),
            pointy.Int32(830),
            pointy.Int32(930),
            pointy.Int32(1030),
            pointy.Int32(1130),
            pointy.Int32(1230),
            pointy.Int32(1330),
            pointy.Int32(1430),
            pointy.Int32(1530),
            pointy.Int32(1630),
            pointy.Int32(1730),
            pointy.Int32(1830),
            pointy.Int32(1930),
            pointy.Int32(2030),
            pointy.Int32(2130),
            pointy.Int32(2230),
            pointy.Int32(2330),
            pointy.Int32(2430),
            pointy.Int32(2530),
            pointy.Int32(2630),
            pointy.Int32(2730),
            pointy.Int32(2830),
            pointy.Int32(2930),
            pointy.Int32(3030),
            pointy.Int32(3130),
            pointy.Int32(3230),
            pointy.Int32(3330),
            pointy.Int32(3430),
            pointy.Int32(3530),
            pointy.Int32(3630),
            pointy.Int32(3730),
            pointy.Int32(3830),
            pointy.Int32(3930),
            pointy.Int32(4030),
            pointy.Int32(4130),
            pointy.Int32(4230),
            pointy.Int32(4330),
            pointy.Int32(4430),
            pointy.Int32(4530),
            pointy.Int32(4630),
            pointy.Int32(4730),
            pointy.Int32(4830),
            pointy.Int32(4930),
            pointy.Int32(5030),
            pointy.Int32(5130),
            pointy.Int32(5230),
            pointy.Int32(5330),
            pointy.Int32(5430),
            pointy.Int32(5530),
            pointy.Int32(5630),
            pointy.Int32(5730),
            pointy.Int32(5830),
            pointy.Int32(5930),
            pointy.Int32(6030),
            pointy.Int32(6130),
            pointy.Int32(6230),
            pointy.Int32(6330),
            pointy.Int32(6430),
            pointy.Int32(6530),
            pointy.Int32(6630),
            pointy.Int32(6730),
            pointy.Int32(6830),
            pointy.Int32(6930),
            pointy.Int32(7030),
            pointy.Int32(7130),
            pointy.Int32(7230),
            pointy.Int32(7330),
            pointy.Int32(7430),
            pointy.Int32(7530),
            pointy.Int32(7630),
            pointy.Int32(7730),
            pointy.Int32(7830),
            pointy.Int32(7930),
            pointy.Int32(8030),
            pointy.Int32(8130),
            pointy.Int32(8230),
            pointy.Int32(8330),
            pointy.Int32(8430),
            pointy.Int32(8530),
            pointy.Int32(8630),
            pointy.Int32(8730),
            pointy.Int32(8830),
            pointy.Int32(8930),
            pointy.Int32(9030),
            pointy.Int32(9130),
            pointy.Int32(9230),
            pointy.Int32(9330),
            pointy.Int32(9430),
            pointy.Int32(9530),
            pointy.Int32(9630),
            pointy.Int32(9730),
            pointy.Int32(9830),
            pointy.Int32(9930),
        },
    }
)
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\CreateRecoverValueTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->createRecoverValueTableMaster(
        (new CreateRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("recover-value-table-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-0001")
            ->withValues([
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930,
            ])
    );
    $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.CreateRecoverValueTableMasterRequest;
import io.gs2.stamina.result.CreateRecoverValueTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    CreateRecoverValueTableMasterResult result = client.createRecoverValueTableMaster(
        new CreateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-value-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues(Arrays.asList(
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930
            ))
    );
    RecoverValueTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.CreateRecoverValueTableMasterResult> asyncResult = null;
yield return client.CreateRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.CreateRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("recover-value-table-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-0001")
        .WithValues(new int[] {
            30,
            130,
            230,
            330,
            430,
            530,
            630,
            730,
            830,
            930,
            1030,
            1130,
            1230,
            1330,
            1430,
            1530,
            1630,
            1730,
            1830,
            1930,
            2030,
            2130,
            2230,
            2330,
            2430,
            2530,
            2630,
            2730,
            2830,
            2930,
            3030,
            3130,
            3230,
            3330,
            3430,
            3530,
            3630,
            3730,
            3830,
            3930,
            4030,
            4130,
            4230,
            4330,
            4430,
            4530,
            4630,
            4730,
            4830,
            4930,
            5030,
            5130,
            5230,
            5330,
            5430,
            5530,
            5630,
            5730,
            5830,
            5930,
            6030,
            6130,
            6230,
            6330,
            6430,
            6530,
            6630,
            6730,
            6830,
            6930,
            7030,
            7130,
            7230,
            7330,
            7430,
            7530,
            7630,
            7730,
            7830,
            7930,
            8030,
            8130,
            8230,
            8330,
            8430,
            8530,
            8630,
            8730,
            8830,
            8930,
            9030,
            9130,
            9230,
            9330,
            9430,
            9530,
            9630,
            9730,
            9830,
            9930,
        }),
    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.createRecoverValueTableMaster(
        new Gs2Stamina.CreateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("recover-value-table-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-0001")
            .withValues([
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930,
            ])
    );
    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_recover_value_table_master(
        stamina.CreateRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('recover-value-table-0001')
            .with_description(None)
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-0001')
            .with_values([
                30,
                130,
                230,
                330,
                430,
                530,
                630,
                730,
                830,
                930,
                1030,
                1130,
                1230,
                1330,
                1430,
                1530,
                1630,
                1730,
                1830,
                1930,
                2030,
                2130,
                2230,
                2330,
                2430,
                2530,
                2630,
                2730,
                2830,
                2930,
                3030,
                3130,
                3230,
                3330,
                3430,
                3530,
                3630,
                3730,
                3830,
                3930,
                4030,
                4130,
                4230,
                4330,
                4430,
                4530,
                4630,
                4730,
                4830,
                4930,
                5030,
                5130,
                5230,
                5330,
                5430,
                5530,
                5630,
                5730,
                5830,
                5930,
                6030,
                6130,
                6230,
                6330,
                6430,
                6530,
                6630,
                6730,
                6830,
                6930,
                7030,
                7130,
                7230,
                7330,
                7430,
                7530,
                7630,
                7730,
                7830,
                7930,
                8030,
                8130,
                8230,
                8330,
                8430,
                8530,
                8630,
                8730,
                8830,
                8930,
                9030,
                9130,
                9230,
                9330,
                9430,
                9530,
                9630,
                9730,
                9830,
                9930,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.create_recover_value_table_master({
    namespaceName="namespace-0001",
    name="recover-value-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        30,
        130,
        230,
        330,
        430,
        530,
        630,
        730,
        830,
        930,
        1030,
        1130,
        1230,
        1330,
        1430,
        1530,
        1630,
        1730,
        1830,
        1930,
        2030,
        2130,
        2230,
        2330,
        2430,
        2530,
        2630,
        2730,
        2830,
        2930,
        3030,
        3130,
        3230,
        3330,
        3430,
        3530,
        3630,
        3730,
        3830,
        3930,
        4030,
        4130,
        4230,
        4330,
        4430,
        4530,
        4630,
        4730,
        4830,
        4930,
        5030,
        5130,
        5230,
        5330,
        5430,
        5530,
        5630,
        5730,
        5830,
        5930,
        6030,
        6130,
        6230,
        6330,
        6430,
        6530,
        6630,
        6730,
        6830,
        6930,
        7030,
        7130,
        7230,
        7330,
        7430,
        7530,
        7630,
        7730,
        7830,
        7930,
        8030,
        8130,
        8230,
        8330,
        8430,
        8530,
        8630,
        8730,
        8830,
        8930,
        9030,
        9130,
        9230,
        9330,
        9430,
        9530,
        9630,
        9730,
        9830,
        9930
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.create_recover_value_table_master_async({
    namespaceName="namespace-0001",
    name="recover-value-table-0001",
    description=nil,
    metadata=nil,
    experienceModelId="experienceModelId-0001",
    values={
        30,
        130,
        230,
        330,
        430,
        530,
        630,
        730,
        830,
        930,
        1030,
        1130,
        1230,
        1330,
        1430,
        1530,
        1630,
        1730,
        1830,
        1930,
        2030,
        2130,
        2230,
        2330,
        2430,
        2530,
        2630,
        2730,
        2830,
        2930,
        3030,
        3130,
        3230,
        3330,
        3430,
        3530,
        3630,
        3730,
        3830,
        3930,
        4030,
        4130,
        4230,
        4330,
        4430,
        4530,
        4630,
        4730,
        4830,
        4930,
        5030,
        5130,
        5230,
        5330,
        5430,
        5530,
        5630,
        5730,
        5830,
        5930,
        6030,
        6130,
        6230,
        6330,
        6430,
        6530,
        6630,
        6730,
        6830,
        6930,
        7030,
        7130,
        7230,
        7330,
        7430,
        7530,
        7630,
        7730,
        7830,
        7930,
        8030,
        8130,
        8230,
        8330,
        8430,
        8530,
        8630,
        8730,
        8830,
        8930,
        9030,
        9130,
        9230,
        9330,
        9430,
        9530,
        9630,
        9730,
        9830,
        9930
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getRecoverValueTableMaster

Get Stamina Recovery Amount Table Master

Retrieves the specified stamina recovery amount table master including its experience model association and rank-to-recovery-amount values mapping.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
recoverValueTableName string
~ 128 chars Stamina Recovery Amount Table name
Stamina Recovery Amount Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item RecoverValueTableMaster Stamina recovery amount table master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := stamina.Gs2StaminaRestClient{
    Session: &session,
}
result, err := client.GetRecoverValueTableMaster(
    &stamina.GetRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverValueTableName: pointy.String("recover-value-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\GetRecoverValueTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->getRecoverValueTableMaster(
        (new GetRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverValueTableName("recover-value-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.GetRecoverValueTableMasterRequest;
import io.gs2.stamina.result.GetRecoverValueTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    GetRecoverValueTableMasterResult result = client.getRecoverValueTableMaster(
        new GetRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
    );
    RecoverValueTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.GetRecoverValueTableMasterResult> asyncResult = null;
yield return client.GetRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.GetRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverValueTableName("recover-value-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.getRecoverValueTableMaster(
        new Gs2Stamina.GetRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-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_recover_value_table_master(
        stamina.GetRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_value_table_name('recover-value-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_recover_value_table_master({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.get_recover_value_table_master_async({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateRecoverValueTableMaster

Update Stamina Recovery Amount Table Master

Updates the specified stamina recovery amount table master’s description, metadata, experience model association, and rank-to-recovery-amount values mapping.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
recoverValueTableName string
~ 128 chars Stamina Recovery Amount Table name
Stamina Recovery Amount Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
experienceModelId string
~ 1024 chars Experience Model ID
The GRN of the GS2-Experience ExperienceModel used to look up the player’s current rank.
The rank index is used as an array index into the values list to determine the per-user recovery amount.
values List<int>
1 ~ 1024 items Recovery Amount Values by Rank
An array of recovery amount values indexed by the player’s GS2-Experience rank index.
The value at index i is used as the recovery amount per tick for players at rank i, overriding the model’s default recoverValue.

Result

Type Description
item RecoverValueTableMaster Stamina Recovery Amount Table Master updated

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.UpdateRecoverValueTableMaster(
    &stamina.UpdateRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverValueTableName: pointy.String("recover-value-table-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ExperienceModelId: pointy.String("experienceModelId-1001"),
        Values: []*int32{
            pointy.Int32(30),
            pointy.Int32(180),
            pointy.Int32(330),
            pointy.Int32(480),
            pointy.Int32(630),
            pointy.Int32(780),
            pointy.Int32(930),
            pointy.Int32(1080),
            pointy.Int32(1230),
            pointy.Int32(1380),
            pointy.Int32(1530),
            pointy.Int32(1680),
            pointy.Int32(1830),
            pointy.Int32(1980),
            pointy.Int32(2130),
            pointy.Int32(2280),
            pointy.Int32(2430),
            pointy.Int32(2580),
            pointy.Int32(2730),
            pointy.Int32(2880),
            pointy.Int32(3030),
            pointy.Int32(3180),
            pointy.Int32(3330),
            pointy.Int32(3480),
            pointy.Int32(3630),
            pointy.Int32(3780),
            pointy.Int32(3930),
            pointy.Int32(4080),
            pointy.Int32(4230),
            pointy.Int32(4380),
            pointy.Int32(4530),
            pointy.Int32(4680),
            pointy.Int32(4830),
            pointy.Int32(4980),
            pointy.Int32(5130),
            pointy.Int32(5280),
            pointy.Int32(5430),
            pointy.Int32(5580),
            pointy.Int32(5730),
            pointy.Int32(5880),
            pointy.Int32(6030),
            pointy.Int32(6180),
            pointy.Int32(6330),
            pointy.Int32(6480),
            pointy.Int32(6630),
            pointy.Int32(6780),
            pointy.Int32(6930),
            pointy.Int32(7080),
            pointy.Int32(7230),
            pointy.Int32(7380),
            pointy.Int32(7530),
            pointy.Int32(7680),
            pointy.Int32(7830),
            pointy.Int32(7980),
            pointy.Int32(8130),
            pointy.Int32(8280),
            pointy.Int32(8430),
            pointy.Int32(8580),
            pointy.Int32(8730),
            pointy.Int32(8880),
            pointy.Int32(9030),
            pointy.Int32(9180),
            pointy.Int32(9330),
            pointy.Int32(9480),
            pointy.Int32(9630),
            pointy.Int32(9780),
            pointy.Int32(9930),
            pointy.Int32(10080),
            pointy.Int32(10230),
            pointy.Int32(10380),
            pointy.Int32(10530),
            pointy.Int32(10680),
            pointy.Int32(10830),
            pointy.Int32(10980),
            pointy.Int32(11130),
            pointy.Int32(11280),
            pointy.Int32(11430),
            pointy.Int32(11580),
            pointy.Int32(11730),
            pointy.Int32(11880),
            pointy.Int32(12030),
            pointy.Int32(12180),
            pointy.Int32(12330),
            pointy.Int32(12480),
            pointy.Int32(12630),
            pointy.Int32(12780),
            pointy.Int32(12930),
            pointy.Int32(13080),
            pointy.Int32(13230),
            pointy.Int32(13380),
            pointy.Int32(13530),
            pointy.Int32(13680),
            pointy.Int32(13830),
            pointy.Int32(13980),
            pointy.Int32(14130),
            pointy.Int32(14280),
            pointy.Int32(14430),
            pointy.Int32(14580),
            pointy.Int32(14730),
            pointy.Int32(14880),
        },
    }
)
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\UpdateRecoverValueTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->updateRecoverValueTableMaster(
        (new UpdateRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverValueTableName("recover-value-table-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withExperienceModelId("experienceModelId-1001")
            ->withValues([
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880,
            ])
    );
    $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.UpdateRecoverValueTableMasterRequest;
import io.gs2.stamina.result.UpdateRecoverValueTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    UpdateRecoverValueTableMasterResult result = client.updateRecoverValueTableMaster(
        new UpdateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues(Arrays.asList(
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880
            ))
    );
    RecoverValueTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.UpdateRecoverValueTableMasterResult> asyncResult = null;
yield return client.UpdateRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.UpdateRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverValueTableName("recover-value-table-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithExperienceModelId("experienceModelId-1001")
        .WithValues(new int[] {
            30,
            180,
            330,
            480,
            630,
            780,
            930,
            1080,
            1230,
            1380,
            1530,
            1680,
            1830,
            1980,
            2130,
            2280,
            2430,
            2580,
            2730,
            2880,
            3030,
            3180,
            3330,
            3480,
            3630,
            3780,
            3930,
            4080,
            4230,
            4380,
            4530,
            4680,
            4830,
            4980,
            5130,
            5280,
            5430,
            5580,
            5730,
            5880,
            6030,
            6180,
            6330,
            6480,
            6630,
            6780,
            6930,
            7080,
            7230,
            7380,
            7530,
            7680,
            7830,
            7980,
            8130,
            8280,
            8430,
            8580,
            8730,
            8880,
            9030,
            9180,
            9330,
            9480,
            9630,
            9780,
            9930,
            10080,
            10230,
            10380,
            10530,
            10680,
            10830,
            10980,
            11130,
            11280,
            11430,
            11580,
            11730,
            11880,
            12030,
            12180,
            12330,
            12480,
            12630,
            12780,
            12930,
            13080,
            13230,
            13380,
            13530,
            13680,
            13830,
            13980,
            14130,
            14280,
            14430,
            14580,
            14730,
            14880,
        }),
    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.updateRecoverValueTableMaster(
        new Gs2Stamina.UpdateRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withExperienceModelId("experienceModelId-1001")
            .withValues([
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880,
            ])
    );
    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_recover_value_table_master(
        stamina.UpdateRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_value_table_name('recover-value-table-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_experience_model_id('experienceModelId-1001')
            .with_values([
                30,
                180,
                330,
                480,
                630,
                780,
                930,
                1080,
                1230,
                1380,
                1530,
                1680,
                1830,
                1980,
                2130,
                2280,
                2430,
                2580,
                2730,
                2880,
                3030,
                3180,
                3330,
                3480,
                3630,
                3780,
                3930,
                4080,
                4230,
                4380,
                4530,
                4680,
                4830,
                4980,
                5130,
                5280,
                5430,
                5580,
                5730,
                5880,
                6030,
                6180,
                6330,
                6480,
                6630,
                6780,
                6930,
                7080,
                7230,
                7380,
                7530,
                7680,
                7830,
                7980,
                8130,
                8280,
                8430,
                8580,
                8730,
                8880,
                9030,
                9180,
                9330,
                9480,
                9630,
                9780,
                9930,
                10080,
                10230,
                10380,
                10530,
                10680,
                10830,
                10980,
                11130,
                11280,
                11430,
                11580,
                11730,
                11880,
                12030,
                12180,
                12330,
                12480,
                12630,
                12780,
                12930,
                13080,
                13230,
                13380,
                13530,
                13680,
                13830,
                13980,
                14130,
                14280,
                14430,
                14580,
                14730,
                14880,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_recover_value_table_master({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        30,
        180,
        330,
        480,
        630,
        780,
        930,
        1080,
        1230,
        1380,
        1530,
        1680,
        1830,
        1980,
        2130,
        2280,
        2430,
        2580,
        2730,
        2880,
        3030,
        3180,
        3330,
        3480,
        3630,
        3780,
        3930,
        4080,
        4230,
        4380,
        4530,
        4680,
        4830,
        4980,
        5130,
        5280,
        5430,
        5580,
        5730,
        5880,
        6030,
        6180,
        6330,
        6480,
        6630,
        6780,
        6930,
        7080,
        7230,
        7380,
        7530,
        7680,
        7830,
        7980,
        8130,
        8280,
        8430,
        8580,
        8730,
        8880,
        9030,
        9180,
        9330,
        9480,
        9630,
        9780,
        9930,
        10080,
        10230,
        10380,
        10530,
        10680,
        10830,
        10980,
        11130,
        11280,
        11430,
        11580,
        11730,
        11880,
        12030,
        12180,
        12330,
        12480,
        12630,
        12780,
        12930,
        13080,
        13230,
        13380,
        13530,
        13680,
        13830,
        13980,
        14130,
        14280,
        14430,
        14580,
        14730,
        14880
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.update_recover_value_table_master_async({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
    description="description1",
    metadata=nil,
    experienceModelId="experienceModelId-1001",
    values={
        30,
        180,
        330,
        480,
        630,
        780,
        930,
        1080,
        1230,
        1380,
        1530,
        1680,
        1830,
        1980,
        2130,
        2280,
        2430,
        2580,
        2730,
        2880,
        3030,
        3180,
        3330,
        3480,
        3630,
        3780,
        3930,
        4080,
        4230,
        4380,
        4530,
        4680,
        4830,
        4980,
        5130,
        5280,
        5430,
        5580,
        5730,
        5880,
        6030,
        6180,
        6330,
        6480,
        6630,
        6780,
        6930,
        7080,
        7230,
        7380,
        7530,
        7680,
        7830,
        7980,
        8130,
        8280,
        8430,
        8580,
        8730,
        8880,
        9030,
        9180,
        9330,
        9480,
        9630,
        9780,
        9930,
        10080,
        10230,
        10380,
        10530,
        10680,
        10830,
        10980,
        11130,
        11280,
        11430,
        11580,
        11730,
        11880,
        12030,
        12180,
        12330,
        12480,
        12630,
        12780,
        12930,
        13080,
        13230,
        13380,
        13530,
        13680,
        13830,
        13980,
        14130,
        14280,
        14430,
        14580,
        14730,
        14880
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteRecoverValueTableMaster

Delete Stamina Recovery Amount Table Master

Deletes the specified stamina recovery amount table master. This only removes the master definition and does not affect the currently active stamina configuration.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
recoverValueTableName string
~ 128 chars Stamina Recovery Amount Table name
Stamina Recovery Amount Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item RecoverValueTableMaster Stamina Recovery Amount Table Master deleted

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.DeleteRecoverValueTableMaster(
    &stamina.DeleteRecoverValueTableMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RecoverValueTableName: pointy.String("recover-value-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\DeleteRecoverValueTableMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2StaminaRestClient(
    $session
);

try {
    $result = $client->deleteRecoverValueTableMaster(
        (new DeleteRecoverValueTableMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRecoverValueTableName("recover-value-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.DeleteRecoverValueTableMasterRequest;
import io.gs2.stamina.result.DeleteRecoverValueTableMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DeleteRecoverValueTableMasterResult result = client.deleteRecoverValueTableMaster(
        new DeleteRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-table-0001")
    );
    RecoverValueTableMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2StaminaRestClient(session);

AsyncResult<Gs2.Gs2Stamina.Result.DeleteRecoverValueTableMasterResult> asyncResult = null;
yield return client.DeleteRecoverValueTableMaster(
    new Gs2.Gs2Stamina.Request.DeleteRecoverValueTableMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRecoverValueTableName("recover-value-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.deleteRecoverValueTableMaster(
        new Gs2Stamina.DeleteRecoverValueTableMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRecoverValueTableName("recover-value-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.delete_recover_value_table_master(
        stamina.DeleteRecoverValueTableMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_recover_value_table_name('recover-value-table-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.delete_recover_value_table_master({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('stamina')

api_result_handler = client.delete_recover_value_table_master_async({
    namespaceName="namespace-0001",
    recoverValueTableName="recover-value-table-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;