GS2-Buff SDK API Reference

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

Model

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
TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
*
~ 1024 charsNamespace GRN
* Set automatically by the server
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction Setting
Configuration for controlling how distributed transactions are executed when buff results are applied, including auto-run, atomic commit, and asynchronous processing options.
applyBuffScriptScriptSettingScript setting to be executed when applying buffs
Script Trigger Reference - apply
logSettingLogSettingLog Output Setting
Configuration for outputting log data of buff operations to GS2-Log. Specifies the GS2-Log namespace where API request and response logs are collected.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

TransactionSetting

Transaction Setting

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

Details
TypeConditionRequiredDefaultValue LimitsDescription
enableAutoRunboolfalseWhether to automatically execute issued transactions on the server side
enableAtomicCommitbool{enableAutoRun} == truefalseWhether to commit the execution of transactions atomically
* Applicable only if enableAutoRun is true
transactionUseDistributorbool{enableAtomicCommit} == truefalseWhether to execute transactions asynchronously
* Applicable only if enableAtomicCommit is true
commitScriptResultInUseDistributorbool{transactionUseDistributor} == truefalseWhether to execute the commit processing of the script result asynchronously
* Applicable only if transactionUseDistributor is true
acquireActionUseJobQueuebool{enableAtomicCommit} == truefalseWhether to use GS2-JobQueue to execute the acquire action
* Applicable only if enableAtomicCommit is true
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor Namespace GRN used to execute transactions
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsGS2-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. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script’s execution results to halt API execution or control the API’s response content.

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
TypeConditionRequiredDefaultValue LimitsDescription
triggerScriptIdstring~ 1024 charsGS2-Script script GRN executed synchronously when the API is executed
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetTypeString 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
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-Script script GRN for asynchronous execution
Must be specified in GRN format starting with “grn:gs2:”.
* Applicable only if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-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.
* Applicable 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) 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
TypeConditionRequiredDefaultValue LimitsDescription
loggingNamespaceIdstring
~ 1024 charsGS2-Log Namespace GRN to output logs
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setup to check out master data from GitHub

Details
TypeConditionRequiredDefaultValue LimitsDescription
apiKeyIdstring
~ 1024 charsGitHub API Key GRN
repositoryNamestring
~ 1024 charsRepository Name
sourcePathstring
~ 1024 charsMaster data (JSON) file path
referenceTypeString Enum
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHashstring{referenceType} == “commit_hash”
✓*
~ 1024 charsCommit hash
* Required if referenceType is “commit_hash”
branchNamestring{referenceType} == “branch”
✓*
~ 1024 charsBranch Name
* Required if referenceType is “branch”
tagNamestring{referenceType} == “tag”
✓*
~ 1024 charsTag Name
* Required if referenceType is “tag”

BuffTargetModel

Buff Target Model

Defines the target GS2 resource model and field for buff application. Specifies which model’s field value should be modified by the buff, along with condition GRNs that identify the specific resource instance and the rate value to apply.

Details
TypeConditionRequiredDefaultValue LimitsDescription
targetModelNameString Enum
enum {
"Gs2Exchange:RateModel",
"Gs2Exchange:IncrementalRateModel",
"Gs2Experience:Status",
"Gs2Formation:Mold",
"Gs2Idle:Status",
"Gs2Idle:CategoryModel",
"Gs2Inventory:Inventory",
"Gs2LoginReward:BonusModel",
"Gs2Mission:MissionTaskModel",
"Gs2Quest:QuestModel",
"Gs2Showcase:DisplayItem",
"Gs2Showcase:RandomDisplayItemModel",
"Gs2SkillTree:NodeModel",
"Gs2Stamina:Stamina",
}
Types of model to apply buffs
targetFieldNamestring
~ 64 charsField name to which the buff is applied
The name of the numeric field on the target model whose value will be modified by the buff. For example, a field representing experience points, attack power, or other numerical attributes.
conditionGrnsList<BuffTargetGrn>
1 ~ 10 itemsList of buff application condition GRNs
GRN patterns that together identify the target resource instance for buff application. Multiple GRNs form a composite condition to precisely locate the resource.
ratefloat
0 ~ 1000000Adjustment rate
The buff value to be applied. Its meaning depends on the expression type: for “Rate Add”, this value is added to the base rate; for “Mul”, it multiplies the current rate; for “Value Add”, it is directly added to the field value after rate calculations.

BuffEntryModel

Buff Entry Model

The amount of buff is managed by BuffEntryModels, and it is possible to associate multiple BuffEntryModels with a specific target entry. The application order of BuffEntryModel is managed by the priority of BuffEntryModel, and the smaller the value of priority, the higher the priority.

Three buff application methods exist: “Rate Add”, “Mul”, and “Value Add”. Rate Add is an instruction that adds to the buff application rate. Mul is an instruction that multiplies the buff application rate. Value Add is an instruction that adds to the value after buff correction calculations. For example, if the default rate is 1.0 and Add 0.2 is set, the buff application rate becomes 1.2. Setting Mul 0.5 reduces the buff application rate to 0.5 times.

BuffEntryModel can be associated with events of GS2-Schedule, and it is possible to set to apply buffs only during the event holding period.

Details
TypeConditionRequiredDefaultValue LimitsDescription
buffEntryModelIdstring
*
~ 1024 charsBuff Entry Model GRN
* Set automatically by the server
namestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
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.
expressionString Enum
enum {
  “rate_add”,
  “mul”,
  “value_add”
}
Application type of buff
Specifies how the buff value is applied to the target. “Rate Add” adds to the adjustment rate (e.g., 1.0 + 0.2 = 1.2), “Mul” multiplies the adjustment rate (e.g., rate * 0.5), and “Value Add” directly adds a value after rate-based correction calculations.
DefinitionDescription
“rate_add”Add to adjustment rate
“mul”Multiply by adjustment rate
“value_add”Directly add values (only numerical values for models or actions)
targetTypeString Enum
enum {
  “model”,
  “action”
}
Type of target to apply buff
Specifies whether the buff is applied to a model’s field value or to an action’s parameter. “Model” targets a field on a GS2 resource model, while “Action” targets a parameter of a GS2 action (e.g., acquire or consume amounts).
DefinitionDescription
“model”Model
“action”Action
targetModelBuffTargetModel{targetType} == “model”
✓*
Model to apply buff
Specifies the target GS2 resource model and field to which the buff is applied. Includes the model name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “model”
targetActionBuffTargetAction{targetType} == “action”
✓*
Action to apply buff
Specifies the target GS2 action and parameter to which the buff is applied. Includes the action name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “action”
priorityint
0 ~ 2147483646Priority of buff application
Determines the order in which buff entries are evaluated. Entries with smaller values are evaluated first. When multiple buffs target the same field, the application order affects the final result due to the interaction between Rate Add and Mul operations.
applyPeriodScheduleEventIdstring~ 1024 charsEvent holding period GRN to apply buff
GRN of a GS2-Schedule event that controls when this buff is active. When specified, the buff is only applied during the event’s scheduled period. If not specified, the buff is always active.

BuffTargetAction

Buff Target Action

Defines the target GS2 action and parameter for buff application. Specifies which action’s parameter should be modified by the buff, along with condition GRNs that identify the specific resource instance and the rate value to apply.

Details
TypeConditionRequiredDefaultValue LimitsDescription
targetActionNameString Enum
enum {
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SubExperience",
"Gs2Experience:SubExperienceByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:ConsumeItemSet",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:ConsumeSimpleItems",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:ConsumeBigItem",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2Limit:CountUp",
"Gs2Limit:CountUpByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:Withdraw",
"Gs2Money:WithdrawByUserId",
"Gs2Money2:DepositByUserId",
"Gs2Money2:Withdraw",
"Gs2Money2:WithdrawByUserId",
"Gs2Stamina:ConsumeStamina",
"Gs2Stamina:ConsumeStaminaByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
}
Types of action to apply buffs
targetFieldNamestring
~ 64 charsField name to which the buff is applied
The name of the numeric parameter on the target action whose value will be modified by the buff. For example, a parameter representing acquire count, consume amount, or reward quantity.
conditionGrnsList<BuffTargetGrn>
1 ~ 10 itemsList of buff application condition GRNs
GRN patterns that together identify the target resource instance for buff application. Multiple GRNs form a composite condition to precisely locate the resource.
ratefloat
0 ~ 1000000Rate
The buff value to be applied. Its meaning depends on the expression type: for “Rate Add”, this value is added to the base rate; for “Mul”, it multiplies the current rate; for “Value Add”, it is directly added to the parameter value after rate calculations.

BuffTargetGrn

GRN pattern that defines the resources used as conditions for applying buffs

Specifies a GRN template with placeholders to identify which resource instance the buff should be applied to. The model name identifies the GS2 service model, and the GRN pattern contains context variables (e.g., region, ownerId, namespaceName) that are resolved at runtime to match the target resource.

Details
TypeConditionRequiredDefaultValue LimitsDescription
targetModelNamestring
~ 64 charsBuff application condition model name
The name of the GS2 service model used to resolve the condition GRN. This identifies which service’s resource model the GRN pattern refers to.
targetGrnstring
~ 1024 charsBuff application condition GRN
A GRN template with context placeholders (e.g., {region}, {ownerId}) that is resolved at runtime to identify the specific resource instance targeted by the buff.

OverrideBuffRate

Buff application rate override model

Allows overriding the rate value of a specific BuffEntryModel at the time of buff application. By specifying the buff entry name and a custom rate, the default rate defined in the BuffEntryModel can be replaced with a different value for a particular request.

Details
TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratefloat
0 ~ 100Rate
The override rate value to use instead of the default rate defined in the BuffEntryModel.

CurrentBuffMaster

Master data of the currently active Buff Entry Models

This master data describes the definitions of Buff Entry Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings 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
TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
*
~ 1024 charsNamespace GRN
* Set automatically by the server
settingsstring
~ 5242880 bytes (5MB)Master Data

BuffEntryModelMaster

Buff Entry Model Master

Buff Entry Model Master is data used to edit and manage Buff Entry Models 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 Buff Entry Model actually referenced by the game.

The amount of buff is managed by the BuffEntryModel, and multiple BuffEntryModels can be associated with a specific target entry. The application order of BuffEntryModel is managed by the priority of BuffEntryModel, and the smaller the value of priority, the higher the priority.

Three buff application methods exist: “Rate Add”, “Mul”, and “Value Add”. Rate Add is an instruction that adds to the buff application rate. Mul is an instruction that multiplies the buff application rate. Value Add is an instruction that adds to the value after buff correction calculations. For example, if the default rate is 1.0 and Add 0.2 is set, the buff application rate becomes 1.2. Setting Mul 0.5 reduces the buff application rate to 0.5 times.

BuffEntryModel can be associated with events of GS2-Schedule, and it is possible to set to apply buffs only during the event holding period.

Details
TypeConditionRequiredDefaultValue LimitsDescription
buffEntryModelIdstring
*
~ 1024 charsBuff Entry Model Master GRN
* Set automatically by the server
namestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
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.
expressionString Enum
enum {
  “rate_add”,
  “mul”,
  “value_add”
}
Application type of buff
Specifies how the buff value is applied to the target. “Rate Add” adds to the adjustment rate (e.g., 1.0 + 0.2 = 1.2), “Mul” multiplies the adjustment rate (e.g., rate * 0.5), and “Value Add” directly adds a value after rate-based correction calculations.
DefinitionDescription
“rate_add”Rate Add
“mul”Mul
“value_add”Value Add
targetTypeString Enum
enum {
  “model”,
  “action”
}
Type of target to apply buff
Specifies whether the buff is applied to a model’s field value or to an action’s parameter. “Model” targets a field on a GS2 resource model, while “Action” targets a parameter of a GS2 action (e.g., acquire or consume amounts).
DefinitionDescription
“model”Model
“action”Action
targetModelBuffTargetModel{targetType} == “model”
✓*
Model to apply buff
Specifies the target GS2 resource model and field to which the buff is applied. Includes the model name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “model”
targetActionBuffTargetAction{targetType} == “action”
✓*
Action to apply buff
Specifies the target GS2 action and parameter to which the buff is applied. Includes the action name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “action”
priorityint
0 ~ 2147483646Priority of buff application
Determines the order in which buff entries are evaluated. Entries with smaller values are evaluated first. When multiple buffs target the same field, the application order affects the final result due to the interaction between Rate Add and Mul operations.
applyPeriodScheduleEventIdstring~ 1024 charsEvent holding period GRN to apply buff
GRN of a GS2-Schedule event that controls when this buff is active. When specified, the buff is only applied during the event’s scheduled period. If not specified, the buff is always active.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

Methods

describeNamespaces

Get a list of Namespace

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

TypeConditionRequiredDefaultValue LimitsDescription
namePrefixstring~ 64 charsFilter by Namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage 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/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DescribeNamespacesRequest;
import io.gs2.buff.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.describeNamespaces(
        new Gs2Buff.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 buff

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

try:
    result = client.describe_namespaces(
        buff.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('buff')

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('buff')

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

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction Setting
Configuration for controlling how distributed transactions are executed when buff results are applied, including auto-run, atomic commit, and asynchronous processing options.
applyBuffScriptScriptSettingScript setting to be executed when applying buffs
Script Trigger Reference - apply
logSettingLogSettingLog Output Setting
Configuration for outputting log data of buff operations to GS2-Log. Specifies the GS2-Log namespace where API request and response logs are collected.

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &buff.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        ApplyBuffScript: nil,
        LogSetting: &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withApplyBuffScript(null)
            ->withLogSetting((new \Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CreateNamespaceRequest;
import io.gs2.buff.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withApplyBuffScript(null)
            .withLogSetting(new io.gs2.buff.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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Buff.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithApplyBuffScript(null)
        .WithLogSetting(new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.createNamespace(
        new Gs2Buff.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withApplyBuffScript(null)
            .withLogSetting(new Gs2Buff.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 buff

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

try:
    result = client.create_namespace(
        buff.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_apply_buff_script(None)
            .with_log_setting(
                buff.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('buff')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    applyBuffScript=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('buff')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    applyBuffScript=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;

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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
statusstring

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetNamespaceStatusRequest;
import io.gs2.buff.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.getNamespaceStatus(
        new Gs2Buff.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.get_namespace_status(
        buff.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

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('buff')

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 namespace

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

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetNamespaceRequest;
import io.gs2.buff.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.getNamespace(
        new Gs2Buff.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.get_namespace(
        buff.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

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('buff')

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 of the Namespace and specific settings.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction Setting
Configuration for controlling how distributed transactions are executed when buff results are applied, including auto-run, atomic commit, and asynchronous processing options.
applyBuffScriptScriptSettingScript setting to be executed when applying buffs
Script Trigger Reference - apply
logSettingLogSettingLog Output Setting
Configuration for outputting log data of buff operations to GS2-Log. Specifies the GS2-Log namespace where API request and response logs are collected.

Result

TypeDescription
itemNamespaceNamespace updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &buff.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        ApplyBuffScript: nil,
        LogSetting: &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withApplyBuffScript(null)
            ->withLogSetting((new \Gs2\Buff\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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.UpdateNamespaceRequest;
import io.gs2.buff.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withApplyBuffScript(null)
            .withLogSetting(new io.gs2.buff.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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Buff.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithApplyBuffScript(null)
        .WithLogSetting(new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.updateNamespace(
        new Gs2Buff.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withApplyBuffScript(null)
            .withLogSetting(new Gs2Buff.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 buff

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

try:
    result = client.update_namespace(
        buff.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_apply_buff_script(None)
            .with_log_setting(
                buff.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('buff')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    applyBuffScript=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('buff')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    applyBuffScript=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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceThe deleted Namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DeleteNamespaceRequest;
import io.gs2.buff.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.deleteNamespace(
        new Gs2Buff.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.delete_namespace(
        buff.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

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('buff')

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

TypeDescription
itemstringVersion

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetServiceVersionRequest;
import io.gs2.buff.result.GetServiceVersionResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.getServiceVersion(
        new Gs2Buff.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.get_service_version(
        buff.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

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('buff')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DumpUserDataByUserIdRequest;
import io.gs2.buff.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

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

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

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

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('buff')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.buff.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

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

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

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

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('buff')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CleanUserDataByUserIdRequest;
import io.gs2.buff.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

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

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

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

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('buff')

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 cleaning of the data associated with the specified user ID is complete

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.buff.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

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

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

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

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('buff')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.buff.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Buff.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 buff

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

try:
    result = client.prepare_import_user_data_by_user_id(
        buff.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('buff')

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('buff')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ImportUserDataByUserIdRequest;
import io.gs2.buff.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

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

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

try:
    result = client.import_user_data_by_user_id(
        buff.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('buff')

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('buff')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CheckImportUserDataByUserIdRequest;
import io.gs2.buff.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2BuffRestClient client = new Gs2BuffRestClient(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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Buff.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 buff

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

try:
    result = client.check_import_user_data_by_user_id(
        buff.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('buff')

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('buff')

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;

applyBuff

Apply buff

Evaluates all Buff Entry Models in the specified namespace and applies the applicable buffs to the currently logged-in user. Buffs are evaluated according to their priority (smaller values are evaluated first), and support three application methods: Rate Add (adds to the adjustment rate), Mul (multiplies the adjustment rate), and Value Add (directly adds to values). If a Buff Entry Model is associated with a GS2-Schedule event, it is only applied during the event period. Returns the list of applied buffs and an updated context stack that records the buff application state.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token

Result

TypeDescription
itemsList<BuffEntryModel>List of applied buffs
newContextStackstringContext stack after applying buff

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.ApplyBuff(
    &buff.ApplyBuffRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\ApplyBuffRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->applyBuff(
        (new ApplyBuffRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
    );
    $items = $result->getItems();
    $newContextStack = $result->getNewContextStack();
} 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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ApplyBuffRequest;
import io.gs2.buff.result.ApplyBuffResult;

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

try {
    ApplyBuffResult result = client.applyBuff(
        new ApplyBuffRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    List<BuffEntryModel> items = result.getItems();
    String newContextStack = result.getNewContextStack();
} 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.ApplyBuffResult> asyncResult = null;
yield return client.ApplyBuff(
    new Gs2.Gs2Buff.Request.ApplyBuffRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.applyBuff(
        new Gs2Buff.ApplyBuffRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    const items = result.getItems();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.apply_buff(
        buff.ApplyBuffRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
    )
    items = result.items
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

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

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

result = api_result.result
items = result.items;
newContextStack = result.newContextStack;
client = gs2('buff')

api_result_handler = client.apply_buff_async({
    namespaceName="namespace-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
items = result.items;
newContextStack = result.newContextStack;

applyBuffByUserId

Apply buff by specifying a user ID

Evaluates all Buff Entry Models in the specified namespace and applies the applicable buffs to the specified user. Buffs are evaluated according to their priority (smaller values are evaluated first), and support three application methods: Rate Add (adds to the adjustment rate), Mul (multiplies the adjustment rate), and Value Add (directly adds to values). If a Buff Entry Model is associated with a GS2-Schedule event, it is only applied during the event period. Returns the list of applied buffs and an updated context stack that records the buff application state.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<BuffEntryModel>List of applied buffs
newContextStackstringContext stack after applying buff

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.ApplyBuffByUserId(
    &buff.ApplyBuffByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\ApplyBuffByUserIdRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->applyBuffByUserId(
        (new ApplyBuffByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $newContextStack = $result->getNewContextStack();
} 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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ApplyBuffByUserIdRequest;
import io.gs2.buff.result.ApplyBuffByUserIdResult;

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

try {
    ApplyBuffByUserIdResult result = client.applyBuffByUserId(
        new ApplyBuffByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    List<BuffEntryModel> items = result.getItems();
    String newContextStack = result.getNewContextStack();
} 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.ApplyBuffByUserIdResult> asyncResult = null;
yield return client.ApplyBuffByUserId(
    new Gs2.Gs2Buff.Request.ApplyBuffByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.applyBuffByUserId(
        new Gs2Buff.ApplyBuffByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.apply_buff_by_user_id(
        buff.ApplyBuffByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    items = result.items
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.apply_buff_by_user_id({
    namespaceName="namespace-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
items = result.items;
newContextStack = result.newContextStack;
client = gs2('buff')

api_result_handler = client.apply_buff_by_user_id_async({
    namespaceName="namespace-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
items = result.items;
newContextStack = result.newContextStack;

describeBuffEntryModels

Get a list of Buff Entry Models

Retrieves all currently active Buff Entry Models in the specified namespace. Buff Entry Models define the buff effects that can be applied to game data, including the application method (Rate Add, Mul, Value Add), target (model or action), and priority. Unlike the master variant, this returns only the activated (published) models without pagination.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<BuffEntryModel>List of Buff Entry Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.DescribeBuffEntryModels(
    &buff.DescribeBuffEntryModelsRequest {
        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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DescribeBuffEntryModelsRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->describeBuffEntryModels(
        (new DescribeBuffEntryModelsRequest())
            ->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DescribeBuffEntryModelsRequest;
import io.gs2.buff.result.DescribeBuffEntryModelsResult;

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

try {
    DescribeBuffEntryModelsResult result = client.describeBuffEntryModels(
        new DescribeBuffEntryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<BuffEntryModel> 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.DescribeBuffEntryModelsResult> asyncResult = null;
yield return client.DescribeBuffEntryModels(
    new Gs2.Gs2Buff.Request.DescribeBuffEntryModelsRequest()
        .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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.describeBuffEntryModels(
        new Gs2Buff.DescribeBuffEntryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.describe_buff_entry_models(
        buff.DescribeBuffEntryModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.describe_buff_entry_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('buff')

api_result_handler = client.describe_buff_entry_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;

getBuffEntryModel

Get Buff Entry Model

Retrieves the currently active Buff Entry Model with the specified name in the specified namespace. The retrieved information includes the application method (Rate Add, Mul, Value Add), target type (model or action), target details, priority, and the associated GS2-Schedule event if configured.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
buffEntryNamestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemBuffEntryModelBuff Entry Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.GetBuffEntryModel(
    &buff.GetBuffEntryModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        BuffEntryName: pointy.String("character-level"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetBuffEntryModelRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->getBuffEntryModel(
        (new GetBuffEntryModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withBuffEntryName("character-level")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetBuffEntryModelRequest;
import io.gs2.buff.result.GetBuffEntryModelResult;

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

try {
    GetBuffEntryModelResult result = client.getBuffEntryModel(
        new GetBuffEntryModelRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("character-level")
    );
    BuffEntryModel 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.GetBuffEntryModelResult> asyncResult = null;
yield return client.GetBuffEntryModel(
    new Gs2.Gs2Buff.Request.GetBuffEntryModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithBuffEntryName("character-level"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.getBuffEntryModel(
        new Gs2Buff.GetBuffEntryModelRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("character-level")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.get_buff_entry_model(
        buff.GetBuffEntryModelRequest()
            .with_namespace_name('namespace-0001')
            .with_buff_entry_name('character-level')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.get_buff_entry_model({
    namespaceName="namespace-0001",
    buffEntryName="character-level",
})

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('buff')

api_result_handler = client.get_buff_entry_model_async({
    namespaceName="namespace-0001",
    buffEntryName="character-level",
})

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

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

result = api_result.result
item = result.item;

exportMaster

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

Exports the current Buff Entry Model Master data in a format that can be used for activation. The exported data can be used to back up the current master configuration, or to import it into another namespace.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentBuffMasterBuff Entry Model master data that can be activated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.ExportMasterRequest;
import io.gs2.buff.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentBuffMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.exportMaster(
        new Gs2Buff.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.export_master(
        buff.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

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('buff')

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;

getCurrentBuffMaster

Get master data of the currently active Buff Entry Models

Retrieves the master data of the Buff Entry Models that are currently active (published) in the specified namespace. This represents the configuration that is actually being used in production, as opposed to the editable master data.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentBuffMasterMaster data of the currently active Buff Entry Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.GetCurrentBuffMaster(
    &buff.GetCurrentBuffMasterRequest {
        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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetCurrentBuffMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->getCurrentBuffMaster(
        (new GetCurrentBuffMasterRequest())
            ->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetCurrentBuffMasterRequest;
import io.gs2.buff.result.GetCurrentBuffMasterResult;

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

try {
    GetCurrentBuffMasterResult result = client.getCurrentBuffMaster(
        new GetCurrentBuffMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentBuffMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.GetCurrentBuffMasterResult> asyncResult = null;
yield return client.GetCurrentBuffMaster(
    new Gs2.Gs2Buff.Request.GetCurrentBuffMasterRequest()
        .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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.getCurrentBuffMaster(
        new Gs2Buff.GetCurrentBuffMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.get_current_buff_master(
        buff.GetCurrentBuffMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.get_current_buff_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('buff')

api_result_handler = client.get_current_buff_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;

preUpdateCurrentBuffMaster

Update master data of the currently active Buff Entry Models (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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentBuffMaster(
    &buff.PreUpdateCurrentBuffMasterRequest {
        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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\PreUpdateCurrentBuffMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentBuffMaster(
        (new PreUpdateCurrentBuffMasterRequest())
            ->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.PreUpdateCurrentBuffMasterRequest;
import io.gs2.buff.result.PreUpdateCurrentBuffMasterResult;

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

try {
    PreUpdateCurrentBuffMasterResult result = client.preUpdateCurrentBuffMaster(
        new PreUpdateCurrentBuffMasterRequest()
            .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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.PreUpdateCurrentBuffMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentBuffMaster(
    new Gs2.Gs2Buff.Request.PreUpdateCurrentBuffMasterRequest()
        .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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.preUpdateCurrentBuffMaster(
        new Gs2Buff.PreUpdateCurrentBuffMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.pre_update_current_buff_master(
        buff.PreUpdateCurrentBuffMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.pre_update_current_buff_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('buff')

api_result_handler = client.pre_update_current_buff_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;

updateCurrentBuffMaster

Update master data of the currently active Buff Entry Models

Updates and activates (publishes) the master data of the Buff Entry Models in the specified namespace. Supports two modes: ‘direct’ mode for inline master data, and ‘preUpload’ mode for master data that was uploaded in advance. For master data larger than 1MB, use the 3-phase update flow: PreUpdate -> Upload -> Update (preUpload mode).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
modeString Enum
enum {
  “direct”,
  “preUpload”
}
“direct”Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settingsstring{mode} == “direct”
✓*
~ 5242880 charsMaster Data
* Required if mode is “direct”
uploadTokenstring{mode} == “preUpload”
✓*
~ 1024 charsToken obtained by pre-upload
Used to apply the uploaded master data.
* Required if mode is “preUpload”

Result

TypeDescription
itemCurrentBuffMasterUpdated master data of the currently active Buff Entry Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentBuffMaster(
    &buff.UpdateCurrentBuffMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-04-15\", \"buffEntryModels\": [{\"name\": \"buff-0001\", \"metadata\": \"BUFF_0001\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}, {\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002\"}], \"rate\": 1.0}, \"expression\": \"rate_add\", \"priority\": 1}, {\"name\": \"buff-0002\", \"metadata\": \"BUFF_0002\", \"targetType\": \"action\", \"targetAction\": {\"targetActionName\": \"Gs2Experience:AddExperienceByUserId\", \"targetFieldName\": \"experienceValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 2.0}, \"expression\": \"mul\", \"priority\": 2}, {\"name\": \"buff-0003\", \"metadata\": \"BUFF_0003\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 3.0}, \"expression\": \"mul\", \"priority\": 3}]}"),
        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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\UpdateCurrentBuffMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->updateCurrentBuffMaster(
        (new UpdateCurrentBuffMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-04-15\", \"buffEntryModels\": [{\"name\": \"buff-0001\", \"metadata\": \"BUFF_0001\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}, {\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002\"}], \"rate\": 1.0}, \"expression\": \"rate_add\", \"priority\": 1}, {\"name\": \"buff-0002\", \"metadata\": \"BUFF_0002\", \"targetType\": \"action\", \"targetAction\": {\"targetActionName\": \"Gs2Experience:AddExperienceByUserId\", \"targetFieldName\": \"experienceValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 2.0}, \"expression\": \"mul\", \"priority\": 2}, {\"name\": \"buff-0003\", \"metadata\": \"BUFF_0003\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 3.0}, \"expression\": \"mul\", \"priority\": 3}]}")
            ->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.UpdateCurrentBuffMasterRequest;
import io.gs2.buff.result.UpdateCurrentBuffMasterResult;

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

try {
    UpdateCurrentBuffMasterResult result = client.updateCurrentBuffMaster(
        new UpdateCurrentBuffMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-04-15\", \"buffEntryModels\": [{\"name\": \"buff-0001\", \"metadata\": \"BUFF_0001\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}, {\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002\"}], \"rate\": 1.0}, \"expression\": \"rate_add\", \"priority\": 1}, {\"name\": \"buff-0002\", \"metadata\": \"BUFF_0002\", \"targetType\": \"action\", \"targetAction\": {\"targetActionName\": \"Gs2Experience:AddExperienceByUserId\", \"targetFieldName\": \"experienceValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 2.0}, \"expression\": \"mul\", \"priority\": 2}, {\"name\": \"buff-0003\", \"metadata\": \"BUFF_0003\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 3.0}, \"expression\": \"mul\", \"priority\": 3}]}")
            .withUploadToken(null)
    );
    CurrentBuffMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.UpdateCurrentBuffMasterResult> asyncResult = null;
yield return client.UpdateCurrentBuffMaster(
    new Gs2.Gs2Buff.Request.UpdateCurrentBuffMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-04-15\", \"buffEntryModels\": [{\"name\": \"buff-0001\", \"metadata\": \"BUFF_0001\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}, {\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002\"}], \"rate\": 1.0}, \"expression\": \"rate_add\", \"priority\": 1}, {\"name\": \"buff-0002\", \"metadata\": \"BUFF_0002\", \"targetType\": \"action\", \"targetAction\": {\"targetActionName\": \"Gs2Experience:AddExperienceByUserId\", \"targetFieldName\": \"experienceValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 2.0}, \"expression\": \"mul\", \"priority\": 2}, {\"name\": \"buff-0003\", \"metadata\": \"BUFF_0003\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 3.0}, \"expression\": \"mul\", \"priority\": 3}]}")
        .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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.updateCurrentBuffMaster(
        new Gs2Buff.UpdateCurrentBuffMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-04-15\", \"buffEntryModels\": [{\"name\": \"buff-0001\", \"metadata\": \"BUFF_0001\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}, {\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002\"}], \"rate\": 1.0}, \"expression\": \"rate_add\", \"priority\": 1}, {\"name\": \"buff-0002\", \"metadata\": \"BUFF_0002\", \"targetType\": \"action\", \"targetAction\": {\"targetActionName\": \"Gs2Experience:AddExperienceByUserId\", \"targetFieldName\": \"experienceValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 2.0}, \"expression\": \"mul\", \"priority\": 2}, {\"name\": \"buff-0003\", \"metadata\": \"BUFF_0003\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 3.0}, \"expression\": \"mul\", \"priority\": 3}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.update_current_buff_master(
        buff.UpdateCurrentBuffMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-04-15", "buffEntryModels": [{"name": "buff-0001", "metadata": "BUFF_0001", "targetType": "model", "targetModel": {"targetModelName": "Gs2Experience:Status", "targetFieldName": "rankCapValue", "conditionGrns": [{"targetModelName": "Gs2Experience:ExperienceModel", "targetGrn": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001"}, {"targetModelName": "Gs2Experience:ExperienceModel", "targetGrn": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002"}], "rate": 1.0}, "expression": "rate_add", "priority": 1}, {"name": "buff-0002", "metadata": "BUFF_0002", "targetType": "action", "targetAction": {"targetActionName": "Gs2Experience:AddExperienceByUserId", "targetFieldName": "experienceValue", "conditionGrns": [{"targetModelName": "Gs2Experience:ExperienceModel", "targetGrn": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001"}], "rate": 2.0}, "expression": "mul", "priority": 2}, {"name": "buff-0003", "metadata": "BUFF_0003", "targetType": "model", "targetModel": {"targetModelName": "Gs2Experience:Status", "targetFieldName": "rankCapValue", "conditionGrns": [{"targetModelName": "Gs2Experience:ExperienceModel", "targetGrn": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001"}], "rate": 3.0}, "expression": "mul", "priority": 3}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.update_current_buff_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-04-15\", \"buffEntryModels\": [{\"name\": \"buff-0001\", \"metadata\": \"BUFF_0001\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}, {\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002\"}], \"rate\": 1.0}, \"expression\": \"rate_add\", \"priority\": 1}, {\"name\": \"buff-0002\", \"metadata\": \"BUFF_0002\", \"targetType\": \"action\", \"targetAction\": {\"targetActionName\": \"Gs2Experience:AddExperienceByUserId\", \"targetFieldName\": \"experienceValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 2.0}, \"expression\": \"mul\", \"priority\": 2}, {\"name\": \"buff-0003\", \"metadata\": \"BUFF_0003\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 3.0}, \"expression\": \"mul\", \"priority\": 3}]}",
    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('buff')

api_result_handler = client.update_current_buff_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-04-15\", \"buffEntryModels\": [{\"name\": \"buff-0001\", \"metadata\": \"BUFF_0001\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}, {\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0002\"}], \"rate\": 1.0}, \"expression\": \"rate_add\", \"priority\": 1}, {\"name\": \"buff-0002\", \"metadata\": \"BUFF_0002\", \"targetType\": \"action\", \"targetAction\": {\"targetActionName\": \"Gs2Experience:AddExperienceByUserId\", \"targetFieldName\": \"experienceValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 2.0}, \"expression\": \"mul\", \"priority\": 2}, {\"name\": \"buff-0003\", \"metadata\": \"BUFF_0003\", \"targetType\": \"model\", \"targetModel\": {\"targetModelName\": \"Gs2Experience:Status\", \"targetFieldName\": \"rankCapValue\", \"conditionGrns\": [{\"targetModelName\": \"Gs2Experience:ExperienceModel\", \"targetGrn\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\"}], \"rate\": 3.0}, \"expression\": \"mul\", \"priority\": 3}]}",
    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;

updateCurrentBuffMasterFromGitHub

Update master data of the currently active Buff Entry Models from GitHub

Updates and activates (publishes) the master data by fetching it directly from a GitHub repository. The checkout settings specify the repository, branch/tag, and file path to use. This is useful for managing master data in version control and deploying it directly.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSettingGitHubCheckoutSetting
Setup to check out master data from GitHub

Result

TypeDescription
itemCurrentBuffMasterUpdated master data of the currently active Buff Entry Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentBuffMasterFromGitHub(
    &buff.UpdateCurrentBuffMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &buff.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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\UpdateCurrentBuffMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->updateCurrentBuffMasterFromGitHub(
        (new UpdateCurrentBuffMasterFromGitHubRequest())
            ->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.UpdateCurrentBuffMasterFromGitHubRequest;
import io.gs2.buff.result.UpdateCurrentBuffMasterFromGitHubResult;

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

try {
    UpdateCurrentBuffMasterFromGitHubResult result = client.updateCurrentBuffMasterFromGitHub(
        new UpdateCurrentBuffMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentBuffMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.UpdateCurrentBuffMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentBuffMasterFromGitHub(
    new Gs2.Gs2Buff.Request.UpdateCurrentBuffMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Buff.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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.updateCurrentBuffMasterFromGitHub(
        new Gs2Buff.UpdateCurrentBuffMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Buff.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 buff

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

try:
    result = client.update_current_buff_master_from_git_hub(
        buff.UpdateCurrentBuffMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(buff.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('buff')

api_result = client.update_current_buff_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('buff')

api_result_handler = client.update_current_buff_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;

describeBuffEntryModelMasters

Get a list of Buff Entry Model Masters

Retrieves a paginated list of Buff Entry Model Masters in the specified namespace. Buff Entry Model Masters are the editable versions of Buff Entry Models that define the buff effects applicable to game data. Changes to master data do not take effect until the master data is activated (published) via the Current Buff Master.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by buff entry model name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<BuffEntryModelMaster>List of Buff Entry Model Master
nextPageTokenstringPage 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/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.DescribeBuffEntryModelMasters(
    &buff.DescribeBuffEntryModelMastersRequest {
        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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DescribeBuffEntryModelMastersRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->describeBuffEntryModelMasters(
        (new DescribeBuffEntryModelMastersRequest())
            ->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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DescribeBuffEntryModelMastersRequest;
import io.gs2.buff.result.DescribeBuffEntryModelMastersResult;

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

try {
    DescribeBuffEntryModelMastersResult result = client.describeBuffEntryModelMasters(
        new DescribeBuffEntryModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<BuffEntryModelMaster> 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.DescribeBuffEntryModelMastersResult> asyncResult = null;
yield return client.DescribeBuffEntryModelMasters(
    new Gs2.Gs2Buff.Request.DescribeBuffEntryModelMastersRequest()
        .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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.describeBuffEntryModelMasters(
        new Gs2Buff.DescribeBuffEntryModelMastersRequest()
            .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 buff

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

try:
    result = client.describe_buff_entry_model_masters(
        buff.DescribeBuffEntryModelMastersRequest()
            .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('buff')

api_result = client.describe_buff_entry_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('buff')

api_result_handler = client.describe_buff_entry_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;

createBuffEntryModelMaster

Create a new Buff Entry Model Master

Creates a new Buff Entry Model Master that defines a buff effect applicable to game data. You can configure the name, application method (Rate Add, Mul, Value Add), target type (model or action), target details, priority, and optionally associate it with a GS2-Schedule event to limit the buff to a specific period. Buffs with smaller priority values are evaluated first when multiple buffs apply to the same target. Changes do not take effect until the master data is activated (published) via the Current Buff Master.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
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.
expressionString Enum
enum {
  “rate_add”,
  “mul”,
  “value_add”
}
Application type of buff
Specifies how the buff value is applied to the target. “Rate Add” adds to the adjustment rate (e.g., 1.0 + 0.2 = 1.2), “Mul” multiplies the adjustment rate (e.g., rate * 0.5), and “Value Add” directly adds a value after rate-based correction calculations.
DefinitionDescription
“rate_add”Rate Add
“mul”Mul
“value_add”Value Add
targetTypeString Enum
enum {
  “model”,
  “action”
}
Type of target to apply buff
Specifies whether the buff is applied to a model’s field value or to an action’s parameter. “Model” targets a field on a GS2 resource model, while “Action” targets a parameter of a GS2 action (e.g., acquire or consume amounts).
DefinitionDescription
“model”Model
“action”Action
targetModelBuffTargetModel{targetType} == “model”
✓*
Model to apply buff
Specifies the target GS2 resource model and field to which the buff is applied. Includes the model name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “model”
targetActionBuffTargetAction{targetType} == “action”
✓*
Action to apply buff
Specifies the target GS2 action and parameter to which the buff is applied. Includes the action name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “action”
priorityint
0 ~ 2147483646Priority of buff application
Determines the order in which buff entries are evaluated. Entries with smaller values are evaluated first. When multiple buffs target the same field, the application order affects the final result due to the interaction between Rate Add and Mul operations.
applyPeriodScheduleEventIdstring~ 1024 charsEvent holding period GRN to apply buff

Result

TypeDescription
itemBuffEntryModelMasterBuff Entry Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.CreateBuffEntryModelMaster(
    &buff.CreateBuffEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("buff-0001"),
        Description: nil,
        Metadata: nil,
        Expression: pointy.String("add"),
        TargetType: pointy.String("model"),
        TargetModel: &buff.BuffTargetModel{
            TargetModelName: pointy.String("Gs2Experience:Status"),
            TargetFieldName: pointy.String("rankCapValue"),
            ConditionGrns: []buff.BuffTargetGrn{
                buff.BuffTargetGrn{
                    TargetModelName: pointy.String("Gs2Experience:RateModel"),
                    TargetGrn: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
                },
            },
            Rate: pointy.Float32(1.0),
        },
        TargetAction: nil,
        Priority: pointy.Int32(1),
        ApplyPeriodScheduleEventId: 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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\CreateBuffEntryModelMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->createBuffEntryModelMaster(
        (new CreateBuffEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("buff-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withExpression("add")
            ->withTargetType("model")
            ->withTargetModel((new \Gs2\Buff\Model\BuffTargetModel())
                ->withTargetModelName("Gs2Experience:Status")
                ->withTargetFieldName("rankCapValue")
                ->withConditionGrns([
                    (new \Gs2\Buff\Model\BuffTargetGrn())
                        ->withTargetModelName("Gs2Experience:RateModel")
                        ->withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
                ])
                ->withRate(1.0))
            ->withTargetAction(null)
            ->withPriority(1)
            ->withApplyPeriodScheduleEventId(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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.CreateBuffEntryModelMasterRequest;
import io.gs2.buff.result.CreateBuffEntryModelMasterResult;

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

try {
    CreateBuffEntryModelMasterResult result = client.createBuffEntryModelMaster(
        new CreateBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("buff-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExpression("add")
            .withTargetType("model")
            .withTargetModel(new io.gs2.buff.model.BuffTargetModel()
                .withTargetModelName("Gs2Experience:Status")
                .withTargetFieldName("rankCapValue")
                .withConditionGrns(Arrays.asList(
                    new io.gs2.buff.model.BuffTargetGrn()
                        .withTargetModelName("Gs2Experience:RateModel")
                        .withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001")
                ))
                .withRate(1.0f))
            .withTargetAction(null)
            .withPriority(1)
            .withApplyPeriodScheduleEventId(null)
    );
    BuffEntryModelMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.CreateBuffEntryModelMasterResult> asyncResult = null;
yield return client.CreateBuffEntryModelMaster(
    new Gs2.Gs2Buff.Request.CreateBuffEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("buff-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithExpression("add")
        .WithTargetType("model")
        .WithTargetModel(new Gs2.Gs2Buff.Model.BuffTargetModel()
            .WithTargetModelName("Gs2Experience:Status")
            .WithTargetFieldName("rankCapValue")
            .WithConditionGrns(new Gs2.Gs2Buff.Model.BuffTargetGrn[] {
                new Gs2.Gs2Buff.Model.BuffTargetGrn()
                    .WithTargetModelName("Gs2Experience:RateModel")
                    .WithTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
            })
            .WithRate(1.0f))
        .WithTargetAction(null)
        .WithPriority(1)
        .WithApplyPeriodScheduleEventId(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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.createBuffEntryModelMaster(
        new Gs2Buff.CreateBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("buff-0001")
            .withDescription(null)
            .withMetadata(null)
            .withExpression("add")
            .withTargetType("model")
            .withTargetModel(new Gs2Buff.model.BuffTargetModel()
                .withTargetModelName("Gs2Experience:Status")
                .withTargetFieldName("rankCapValue")
                .withConditionGrns([
                    new Gs2Buff.model.BuffTargetGrn()
                        .withTargetModelName("Gs2Experience:RateModel")
                        .withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
                ])
                .withRate(1.0))
            .withTargetAction(null)
            .withPriority(1)
            .withApplyPeriodScheduleEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.create_buff_entry_model_master(
        buff.CreateBuffEntryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('buff-0001')
            .with_description(None)
            .with_metadata(None)
            .with_expression('add')
            .with_target_type('model')
            .with_target_model(
                buff.BuffTargetModel()
                    .with_target_model_name('Gs2Experience:Status')
                    .with_target_field_name('rankCapValue')
                    .with_condition_grns([
                        buff.BuffTargetGrn()
                            .with_target_model_name('Gs2Experience:RateModel')
                            .with_target_grn('grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001'),
                    ])
                    .with_rate(1.0))
            .with_target_action(None)
            .with_priority(1)
            .with_apply_period_schedule_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.create_buff_entry_model_master({
    namespaceName="namespace-0001",
    name="buff-0001",
    description=nil,
    metadata=nil,
    expression="add",
    targetType="model",
    targetModel={
        targetModelName="Gs2Experience:Status",
        targetFieldName="rankCapValue",
        conditionGrns={
            {
                targetModelName="Gs2Experience:RateModel",
                targetGrn="grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001",
            }
        },
        rate=1.0,
    },
    targetAction=nil,
    priority=1,
    applyPeriodScheduleEventId=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('buff')

api_result_handler = client.create_buff_entry_model_master_async({
    namespaceName="namespace-0001",
    name="buff-0001",
    description=nil,
    metadata=nil,
    expression="add",
    targetType="model",
    targetModel={
        targetModelName="Gs2Experience:Status",
        targetFieldName="rankCapValue",
        conditionGrns={
            {
                targetModelName="Gs2Experience:RateModel",
                targetGrn="grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001",
            }
        },
        rate=1.0,
    },
    targetAction=nil,
    priority=1,
    applyPeriodScheduleEventId=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;

getBuffEntryModelMaster

Get Buff Entry Model Master

Retrieves a specific Buff Entry Model Master by name in the specified namespace. The retrieved information includes the application method, target type, target details, priority, metadata, and the associated GS2-Schedule event if configured.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
buffEntryNamestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemBuffEntryModelMasterBuff Entry Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.GetBuffEntryModelMaster(
    &buff.GetBuffEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        BuffEntryName: pointy.String("buff-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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\GetBuffEntryModelMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->getBuffEntryModelMaster(
        (new GetBuffEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withBuffEntryName("buff-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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.GetBuffEntryModelMasterRequest;
import io.gs2.buff.result.GetBuffEntryModelMasterResult;

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

try {
    GetBuffEntryModelMasterResult result = client.getBuffEntryModelMaster(
        new GetBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("buff-0001")
    );
    BuffEntryModelMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.GetBuffEntryModelMasterResult> asyncResult = null;
yield return client.GetBuffEntryModelMaster(
    new Gs2.Gs2Buff.Request.GetBuffEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithBuffEntryName("buff-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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.getBuffEntryModelMaster(
        new Gs2Buff.GetBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("buff-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.get_buff_entry_model_master(
        buff.GetBuffEntryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_buff_entry_name('buff-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.get_buff_entry_model_master({
    namespaceName="namespace-0001",
    buffEntryName="buff-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('buff')

api_result_handler = client.get_buff_entry_model_master_async({
    namespaceName="namespace-0001",
    buffEntryName="buff-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;

updateBuffEntryModelMaster

Update Buff Entry Model Master

Updates the specified Buff Entry Model Master. You can change the description, metadata, application method (Rate Add, Mul, Value Add), target type, target details, priority, and the associated GS2-Schedule event. Changes do not take effect until the master data is activated (published) via the Current Buff Master.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
buffEntryNamestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
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.
expressionString Enum
enum {
  “rate_add”,
  “mul”,
  “value_add”
}
Application type of buff
Specifies how the buff value is applied to the target. “Rate Add” adds to the adjustment rate (e.g., 1.0 + 0.2 = 1.2), “Mul” multiplies the adjustment rate (e.g., rate * 0.5), and “Value Add” directly adds a value after rate-based correction calculations.
DefinitionDescription
“rate_add”Rate Add
“mul”Mul
“value_add”Value Add
targetTypeString Enum
enum {
  “model”,
  “action”
}
Type of target to apply buff
Specifies whether the buff is applied to a model’s field value or to an action’s parameter. “Model” targets a field on a GS2 resource model, while “Action” targets a parameter of a GS2 action (e.g., acquire or consume amounts).
DefinitionDescription
“model”Model
“action”Action
targetModelBuffTargetModel{targetType} == “model”
✓*
Model to apply buff
Specifies the target GS2 resource model and field to which the buff is applied. Includes the model name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “model”
targetActionBuffTargetAction{targetType} == “action”
✓*
Action to apply buff
Specifies the target GS2 action and parameter to which the buff is applied. Includes the action name, field name, condition GRNs for identifying the target resource, and the rate value.
* Required if targetType is “action”
priorityint
0 ~ 2147483646Priority of buff application
Determines the order in which buff entries are evaluated. Entries with smaller values are evaluated first. When multiple buffs target the same field, the application order affects the final result due to the interaction between Rate Add and Mul operations.
applyPeriodScheduleEventIdstring~ 1024 charsEvent holding period GRN to apply buff

Result

TypeDescription
itemBuffEntryModelMasterBuff Entry Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.UpdateBuffEntryModelMaster(
    &buff.UpdateBuffEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        BuffEntryName: pointy.String("buff-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("BUFF_0001"),
        Expression: pointy.String("mul"),
        TargetType: pointy.String("action"),
        TargetModel: nil,
        TargetAction: &buff.BuffTargetAction{
            TargetActionName: pointy.String("Gs2Experience:AddExperienceByUserId"),
            TargetFieldName: pointy.String("experienceValue"),
            ConditionGrns: []buff.BuffTargetGrn{
                buff.BuffTargetGrn{
                    TargetModelName: pointy.String("Gs2Experience:RateModel"),
                    TargetGrn: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
                },
            },
            Rate: pointy.Float32(1.5),
        },
        Priority: pointy.Int32(2),
        ApplyPeriodScheduleEventId: 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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\UpdateBuffEntryModelMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->updateBuffEntryModelMaster(
        (new UpdateBuffEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withBuffEntryName("buff-0001")
            ->withDescription("description1")
            ->withMetadata("BUFF_0001")
            ->withExpression("mul")
            ->withTargetType("action")
            ->withTargetModel(null)
            ->withTargetAction((new \Gs2\Buff\Model\BuffTargetAction())
                ->withTargetActionName("Gs2Experience:AddExperienceByUserId")
                ->withTargetFieldName("experienceValue")
                ->withConditionGrns([
                    (new \Gs2\Buff\Model\BuffTargetGrn())
                        ->withTargetModelName("Gs2Experience:RateModel")
                        ->withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
                ])
                ->withRate(1.5))
            ->withPriority(2)
            ->withApplyPeriodScheduleEventId(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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.UpdateBuffEntryModelMasterRequest;
import io.gs2.buff.result.UpdateBuffEntryModelMasterResult;

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

try {
    UpdateBuffEntryModelMasterResult result = client.updateBuffEntryModelMaster(
        new UpdateBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("buff-0001")
            .withDescription("description1")
            .withMetadata("BUFF_0001")
            .withExpression("mul")
            .withTargetType("action")
            .withTargetModel(null)
            .withTargetAction(new io.gs2.buff.model.BuffTargetAction()
                .withTargetActionName("Gs2Experience:AddExperienceByUserId")
                .withTargetFieldName("experienceValue")
                .withConditionGrns(Arrays.asList(
                    new io.gs2.buff.model.BuffTargetGrn()
                        .withTargetModelName("Gs2Experience:RateModel")
                        .withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001")
                ))
                .withRate(1.5f))
            .withPriority(2)
            .withApplyPeriodScheduleEventId(null)
    );
    BuffEntryModelMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.UpdateBuffEntryModelMasterResult> asyncResult = null;
yield return client.UpdateBuffEntryModelMaster(
    new Gs2.Gs2Buff.Request.UpdateBuffEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithBuffEntryName("buff-0001")
        .WithDescription("description1")
        .WithMetadata("BUFF_0001")
        .WithExpression("mul")
        .WithTargetType("action")
        .WithTargetModel(null)
        .WithTargetAction(new Gs2.Gs2Buff.Model.BuffTargetAction()
            .WithTargetActionName("Gs2Experience:AddExperienceByUserId")
            .WithTargetFieldName("experienceValue")
            .WithConditionGrns(new Gs2.Gs2Buff.Model.BuffTargetGrn[] {
                new Gs2.Gs2Buff.Model.BuffTargetGrn()
                    .WithTargetModelName("Gs2Experience:RateModel")
                    .WithTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
            })
            .WithRate(1.5f))
        .WithPriority(2)
        .WithApplyPeriodScheduleEventId(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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.updateBuffEntryModelMaster(
        new Gs2Buff.UpdateBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("buff-0001")
            .withDescription("description1")
            .withMetadata("BUFF_0001")
            .withExpression("mul")
            .withTargetType("action")
            .withTargetModel(null)
            .withTargetAction(new Gs2Buff.model.BuffTargetAction()
                .withTargetActionName("Gs2Experience:AddExperienceByUserId")
                .withTargetFieldName("experienceValue")
                .withConditionGrns([
                    new Gs2Buff.model.BuffTargetGrn()
                        .withTargetModelName("Gs2Experience:RateModel")
                        .withTargetGrn("grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001"),
                ])
                .withRate(1.5))
            .withPriority(2)
            .withApplyPeriodScheduleEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.update_buff_entry_model_master(
        buff.UpdateBuffEntryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_buff_entry_name('buff-0001')
            .with_description('description1')
            .with_metadata('BUFF_0001')
            .with_expression('mul')
            .with_target_type('action')
            .with_target_model(None)
            .with_target_action(
                buff.BuffTargetAction()
                    .with_target_action_name('Gs2Experience:AddExperienceByUserId')
                    .with_target_field_name('experienceValue')
                    .with_condition_grns([
                        buff.BuffTargetGrn()
                            .with_target_model_name('Gs2Experience:RateModel')
                            .with_target_grn('grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001'),
                    ])
                    .with_rate(1.5))
            .with_priority(2)
            .with_apply_period_schedule_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.update_buff_entry_model_master({
    namespaceName="namespace-0001",
    buffEntryName="buff-0001",
    description="description1",
    metadata="BUFF_0001",
    expression="mul",
    targetType="action",
    targetModel=nil,
    targetAction={
        targetActionName="Gs2Experience:AddExperienceByUserId",
        targetFieldName="experienceValue",
        conditionGrns={
            {
                targetModelName="Gs2Experience:RateModel",
                targetGrn="grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001",
            }
        },
        rate=1.5,
    },
    priority=2,
    applyPeriodScheduleEventId=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('buff')

api_result_handler = client.update_buff_entry_model_master_async({
    namespaceName="namespace-0001",
    buffEntryName="buff-0001",
    description="description1",
    metadata="BUFF_0001",
    expression="mul",
    targetType="action",
    targetModel=nil,
    targetAction={
        targetActionName="Gs2Experience:AddExperienceByUserId",
        targetFieldName="experienceValue",
        conditionGrns={
            {
                targetModelName="Gs2Experience:RateModel",
                targetGrn="grn:gs2:ap-northeast-1:YourOwnerId:exchange:namespace-0001:model:rate-0001",
            }
        },
        rate=1.5,
    },
    priority=2,
    applyPeriodScheduleEventId=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;

deleteBuffEntryModelMaster

Delete Buff Entry Model Master

Deletes the specified Buff Entry Model Master from the specified namespace. Once deleted, this buff entry will no longer be available after the next master data activation. This operation only affects the master data; the currently active model remains unchanged until the master data is re-activated.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
buffEntryNamestring
~ 128 charsBuff Entry Model name
Buff Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemBuffEntryModelMasterBuff Entry Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/buff"
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 := buff.Gs2BuffRestClient{
    Session: &session,
}
result, err := client.DeleteBuffEntryModelMaster(
    &buff.DeleteBuffEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        BuffEntryName: pointy.String("buff-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\Buff\Gs2BuffRestClient;
use Gs2\Buff\Request\DeleteBuffEntryModelMasterRequest;

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

$session->open();

$client = new Gs2BuffRestClient(
    $session
);

try {
    $result = $client->deleteBuffEntryModelMaster(
        (new DeleteBuffEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withBuffEntryName("buff-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.buff.rest.Gs2BuffRestClient;
import io.gs2.buff.request.DeleteBuffEntryModelMasterRequest;
import io.gs2.buff.result.DeleteBuffEntryModelMasterResult;

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

try {
    DeleteBuffEntryModelMasterResult result = client.deleteBuffEntryModelMaster(
        new DeleteBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("buff-0001")
    );
    BuffEntryModelMaster 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 Gs2BuffRestClient(session);

AsyncResult<Gs2.Gs2Buff.Result.DeleteBuffEntryModelMasterResult> asyncResult = null;
yield return client.DeleteBuffEntryModelMaster(
    new Gs2.Gs2Buff.Request.DeleteBuffEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithBuffEntryName("buff-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 Gs2Buff from '@/gs2/buff';

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

try {
    const result = await client.deleteBuffEntryModelMaster(
        new Gs2Buff.DeleteBuffEntryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withBuffEntryName("buff-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import buff

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

try:
    result = client.delete_buff_entry_model_master(
        buff.DeleteBuffEntryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_buff_entry_name('buff-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('buff')

api_result = client.delete_buff_entry_model_master({
    namespaceName="namespace-0001",
    buffEntryName="buff-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('buff')

api_result_handler = client.delete_buff_entry_model_master_async({
    namespaceName="namespace-0001",
    buffEntryName="buff-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;