GS2-Enchant SDK API Reference

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

Models

Namespace

Namespace

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

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

Details
Type Condition Required Default Value Limits Description
namespaceId string
*
~ 1024 chars Namespace GRN
* Set automatically by the server
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting
Transaction Setting
Configuration for controlling how transactions are processed when executing enchant parameter operations.
logSetting LogSetting Log Output Setting
Configuration for outputting log data of enchant operations to GS2-Log. By specifying a GS2-Log namespace, API request and response logs for balance parameter and rarity parameter operations can be collected.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

TransactionSetting

Transaction Setting

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

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

ScriptSetting

Script Setting

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

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

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

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

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

LogSetting

Log Output Setting

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

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

GitHubCheckoutSetting

Setting for checking out master data from GitHub

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

BalanceParameterStatus

Balance Parameter Status

Represents the actual parameter values drawn for a specific resource owned by a user. Each status is associated with a Balance Parameter Model and contains the concrete values assigned to each parameter slot after the drawing process.

Details
Type Condition Required Default Value Limits Description
balanceParameterStatusId string
*
~ 1024 chars Balance Parameter GRN
* Set automatically by the server
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these balance parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
parameterValues List<BalanceParameterValue>
1 ~ 10 items List of balance parameter values
The concrete values assigned to each parameter slot after the drawing process. Each entry corresponds to a parameter slot defined in the model and contains the actual numeric value allocated. The sum of all values equals the total value specified in the model.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

RarityParameterStatus

Rarity Parameter Status

Represents the actual parameter values drawn for a specific resource owned by a user. Each status is associated with a Rarity Parameter Model and contains the concrete values selected through weighted lottery for each granted parameter slot.

Details
Type Condition Required Default Value Limits Description
rarityParameterStatusId string
*
~ 1024 chars Rarity Parameter Status GRN
* Set automatically by the server
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
parameterValues List<RarityParameterValue> 0 ~ 10 items List of rarity parameter values
The concrete parameter values selected through weighted lottery for each granted slot. The number of entries is determined by the parameter count draw, and each entry’s value is selected from the value model pool. May contain fewer entries than the maximum parameter count.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

BalanceParameterModel

Balance Parameter Model

Defines the drawing conditions for balance parameters. Balance parameters distribute a fixed total value across multiple parameter slots. For example, a weapon with a total power of 100 might have ATK=60, DEF=30, SPD=10. The initial value strategy determines how values are assigned: average distributes evenly, while lottery randomly allocates the total across parameters.

Details
Type Condition Required Default Value Limits Description
balanceParameterModelId string
*
~ 1024 chars Balance Parameter Model GRN
* Set automatically by the server
name string
~ 128 chars Balance Parameter Model name
Balance Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
totalValue long
0 ~ 9223372036854775805 Total value
The fixed total that is distributed across all parameter slots. When parameters are drawn, the individual values will always sum to this total regardless of the allocation strategy used.
initialValueStrategy string (enum)
enum {
  “average”,
  “lottery”
}
“average” Initial value setting policy
Determines how the total value is distributed across parameter slots when first assigned. average divides the total evenly among all parameters, while lottery randomly distributes the total to create varied parameter combinations.
DefinitionDescription
“average”Average
“lottery”Lottery
parameters List<BalanceParameterValueModel>
1 ~ 10 items Balance parameter value model list
Defines the parameter slots available for this balance parameter. Each entry specifies a named parameter slot (e.g., ATK, DEF, SPD) with optional metadata. The total value is distributed across these slots.

RarityParameterModel

Rarity Parameter Model

Defines the drawing conditions for rarity parameters. Rarity parameters use a weighted lottery system to determine both the number of parameters granted and the specific values assigned. First, the number of parameter slots to fill is determined by a weighted draw from the parameter count model list. Then, each slot’s value is selected by a weighted draw from the parameter value model list, providing randomized equipment attributes with controlled probability distributions.

Details
Type Condition Required Default Value Limits Description
rarityParameterModelId string
*
~ 1024 chars Rarity Parameter Model GRN
* Set automatically by the server
name string
~ 128 chars Rarity Parameter Model name
Rarity Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
maximumParameterCount int
1 ~ 10 Maximum number of parameters to be given
The upper limit on the number of parameter slots that can be granted to a resource. The actual number granted is determined by a weighted draw from the parameter count model list, but will never exceed this value.
parameterCounts List<RarityParameterCountModel>
1 ~ 10 items Rarity parameter count model list
Defines the weighted lottery entries for determining how many parameter slots are granted. Each entry specifies a count and a draw weight. Higher weights increase the probability of that count being selected.
parameters List<RarityParameterValueModel>
1 ~ 1000 items Rarity parameter value model list
Defines the pool of possible parameter values that can be drawn. Each entry specifies a parameter name, resource details, and a draw weight. When filling parameter slots, values are selected from this pool via weighted lottery without replacement.

BalanceParameterValueModel

Balance Parameter Value Model

Defines a single parameter slot available within a balance parameter. Each entry specifies a named slot (e.g., ATK, DEF, SPD) that receives a portion of the total value during the drawing process.

Details
Type Condition Required Default Value Limits Description
name string
~ 64 chars Name
The identifier for this parameter slot (e.g., ATK, DEF, SPD). Must be unique within the balance parameter model. Used as the key when storing and retrieving drawn parameter values.
metadata string ~ 512 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

RarityParameterCountModel

Rarity Parameter Count Model

Defines a single entry in the weighted lottery for determining how many parameter slots are granted to a resource. Each entry pairs a parameter count with a draw weight, allowing fine-grained control over the probability distribution of parameter quantities.

Details
Type Condition Required Default Value Limits Description
count int
0 ~ 10 Count
The number of parameter slots to grant when this entry is drawn. For example, a count of 3 means the resource will receive 3 parameter values selected from the value model pool.
weight int
1 ~ 2147483646 Draw Weight
The relative weight used in the weighted lottery when determining the parameter count. Higher values increase the probability of this count being selected. The actual probability is this weight divided by the sum of all weights in the count model list.

RarityParameterValueModel

Rarity Parameter Value Model

Defines a single entry in the weighted lottery pool for rarity parameter values. Each entry specifies a parameter name, game-defined resource details, and a draw weight that determines its selection probability relative to other entries in the pool.

Details
Type Condition Required Default Value Limits Description
name string
~ 64 chars Name
The identifier for this lottery entry. Must be unique within the rarity parameter model’s value pool. When drawn, this name is stored in the resulting Rarity Parameter Value.
metadata string ~ 512 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
resourceName string
~ 64 chars Parameter Resource Name for Game (Not used for GS2)
A game-defined resource type name associated with this parameter value (e.g., “fire_attack”, “ice_resist”). GS2 does not use this value for its own operations; it is passed through to the drawn result for use in game logic.
resourceValue long
0 ~ 9223372036854775805 Parameter Resource Value for Game (Not used for GS2)
A game-defined numeric value for this parameter (e.g., 50 for +50 attack power). GS2 does not use this value for its own operations; it is passed through to the drawn result for use in game logic.
weight int
1 ~ 2147483646 Draw Weight
The relative weight used in the weighted lottery when selecting parameter values. Higher values increase the probability of this entry being selected. The actual probability is this weight divided by the sum of all weights in the pool.

BalanceParameterValue

Balance Parameter Value

Represents the actual value assigned to a single parameter slot within a balance parameter status. Contains the slot name and its concrete numeric value after the drawing process.

Details
Type Condition Required Default Value Limits Description
name string
~ 64 chars Name
The name of the parameter slot (e.g., ATK, DEF, SPD). Corresponds to a parameter slot defined in the Balance Parameter Value Model.
value long
0 ~ 9223372036854775805 Value
The numeric value assigned to this parameter slot. Determined by the initial value strategy (average or lottery) when the balance parameter is first drawn. The sum of all slot values equals the total value defined in the model.

RarityParameterValue

Rarity Parameter Value

Represents the actual value assigned to a single parameter slot within a rarity parameter status. Contains the slot name and the resource details (name and value) selected through weighted lottery from the value model pool.

Details
Type Condition Required Default Value Limits Description
name string
~ 64 chars Name
The name of the parameter value selected from the value model pool. Corresponds to the name defined in the Rarity Parameter Value Model entry that was drawn.
resourceName string
~ 64 chars Resource Name
The game-defined resource type name associated with this parameter value (e.g., “fire_attack”, “ice_resist”). Copied from the drawn Rarity Parameter Value Model entry for use in game logic.
resourceValue long
0 ~ 9223372036854775805 Resource Value
The numeric value of the resource associated with this parameter. Copied from the drawn Rarity Parameter Value Model entry. Used by game logic to apply the parameter’s effect (e.g., +50 attack power).

VerifyActionResult

Verify Action execution result

Details
Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
"Gs2Stamina:VerifyStaminaValueByUserId",
"Gs2Stamina:VerifyStaminaMaxValueByUserId",
"Gs2Stamina:VerifyStaminaRecoverIntervalMinutesByUserId",
"Gs2Stamina:VerifyStaminaRecoverValueByUserId",
"Gs2Stamina:VerifyStaminaOverflowValueByUserId",
}
Type of Verify Action
verifyRequest string
~ 524288 chars JSON string of the request used when executing the action
statusCode int 0 ~ 999 Status code
verifyResult string ~ 1048576 chars Result content

ConsumeActionResult

Consume Action execution result

Details
Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Mission:ResetCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
Type of Consume Action
consumeRequest string
~ 524288 chars JSON string of the request used when executing the action
statusCode int 0 ~ 999 Status code
consumeResult string ~ 1048576 chars Result content

AcquireActionResult

Acquire Action execution result

Details
Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
Type of Acquire Action
acquireRequest string
~ 524288 chars JSON string of the request used when executing the action
statusCode int 0 ~ 999 Status code
acquireResult string ~ 1048576 chars Result content

TransactionResult

Transaction execution result

Result of a transaction executed using the server-side automatic execution feature

Details
Type Condition Required Default Value Limits Description
transactionId string
36 ~ 36 chars Transaction ID
verifyResults List<VerifyActionResult> 0 ~ 10 items List of verify action execution results
consumeResults List<ConsumeActionResult> [] 0 ~ 10 items List of Consume Action execution results
acquireResults List<AcquireActionResult> [] 0 ~ 100 items List of Acquire Action execution results
hasError bool false Whether an error occurred during transaction execution

Config

Configuration

Configuration values applied to transaction variables

Details
Type Condition Required Default Value Limits Description
key string
~ 64 chars Name
value string ~ 51200 chars Value

CurrentParameterMaster

Currently active Parameter Model master data

This master data defines the Parameter Models currently active within the namespace. GS2 uses JSON format files for master data management. By uploading the file, the settings can actually be reflected on the server.

To create JSON files, we provide a master data editor within the management console. Additionally, you can utilize the service by creating tools more suited to game operations and exporting JSON files in the appropriate format.

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

BalanceParameterModelMaster

Balance Parameter Model Master

Editable version of the Balance Parameter Model used for management console operations. Defines the drawing conditions for balance parameters. Balance parameters distribute a fixed total value across multiple parameter slots. For example, a weapon with a total power of 100 might have ATK=60, DEF=30, SPD=10. The initial value strategy determines how values are assigned: average distributes evenly, while lottery randomly allocates the total across parameters.

Details
Type Condition Required Default Value Limits Description
balanceParameterModelId string
*
~ 1024 chars Balance Parameter Model GRN
* Set automatically by the server
name string
~ 128 chars Balance Parameter Model name
Balance Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
description string ~ 1024 chars Description
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
totalValue long
0 ~ 9223372036854775805 Total value
The fixed total that is distributed across all parameter slots. When parameters are drawn, the individual values will always sum to this total regardless of the allocation strategy used.
initialValueStrategy string (enum)
enum {
  “average”,
  “lottery”
}
“average” Initial value setting policy
Determines how the total value is distributed across parameter slots when first assigned. average divides the total evenly among all parameters, while lottery randomly distributes the total to create varied parameter combinations.
DefinitionDescription
“average”Average
“lottery”Lottery
parameters List<BalanceParameterValueModel>
1 ~ 10 items Balance parameter value model list
Defines the parameter slots available for this balance parameter. Each entry specifies a named parameter slot (e.g., ATK, DEF, SPD) with optional metadata. The total value is distributed across these slots.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

RarityParameterModelMaster

Rarity Parameter Model Master

Editable version of the Rarity Parameter Model used for management console operations. Defines the drawing conditions for rarity parameters using a weighted lottery system to determine both the number of parameters granted and the specific values assigned.

Details
Type Condition Required Default Value Limits Description
rarityParameterModelId string
*
~ 1024 chars Rarity Parameter Model GRN
* Set automatically by the server
name string
~ 128 chars Rarity Parameter Model name
Rarity Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
description string ~ 1024 chars Description
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
maximumParameterCount int
1 ~ 10 Maximum number of parameters to be given
The upper limit on the number of parameter slots that can be granted to a resource. The actual number granted is determined by a weighted draw from the parameter count model list, but will never exceed this value.
parameterCounts List<RarityParameterCountModel>
1 ~ 10 items Rarity parameter count model list
Defines the weighted lottery entries for determining how many parameter slots are granted. Each entry specifies a count and a draw weight. Higher weights increase the probability of that count being selected.
parameters List<RarityParameterValueModel>
1 ~ 1000 items Rarity parameter value model list
Defines the pool of possible parameter values that can be drawn. Each entry specifies a parameter name, resource details, and a draw weight. When filling parameter slots, values are selected from this pool via weighted lottery without replacement.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

Methods

describeNamespaces

Get a list of Namespaces

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

Details

Request

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

Result

Type Description
items List<Namespace> List of Namespaces
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &enchant.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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeNamespacesRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

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

createNamespace

Create a new Namespace

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

Details

Request

Type Condition Required Default Value Limits Description
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting
Transaction Setting
Configuration for controlling how transactions are processed when executing enchant parameter operations.
logSetting LogSetting Log Output Setting
Configuration for outputting log data of enchant operations to GS2-Log. By specifying a GS2-Log namespace, API request and response logs for balance parameter and rarity parameter operations can be collected.

Result

Type Description
item Namespace Namespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &enchant.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: &enchant.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
        },
        LogSetting: &enchant.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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting((new \Gs2\Enchant\Model\TransactionSetting())
                ->withEnableAutoRun(false)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            ->withLogSetting((new \Gs2\Enchant\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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.CreateNamespaceRequest;
import io.gs2.enchant.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(new io.gs2.enchant.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withLogSetting(new io.gs2.enchant.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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Enchant.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(new Gs2.Gs2Enchant.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
        .WithLogSetting(new Gs2.Gs2Enchant.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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.createNamespace(
        new Gs2Enchant.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(new Gs2Enchant.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withLogSetting(new Gs2Enchant.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 enchant

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

try:
    result = client.create_namespace(
        enchant.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(
                enchant.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001'))
            .with_log_setting(
                enchant.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('enchant')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
    },
    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('enchant')

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

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

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

result = api_result.result
item = result.item;

getNamespaceStatus

Get Namespace status

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

Details

Request

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

Result

Type Description
status string

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
status = result.status;

getNamespace

Get a Namespace

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

Details

Request

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

Result

Type Description
item Namespace Namespace

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateNamespace

Update Namespace

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

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting
Transaction Setting
Configuration for controlling how transactions are processed when executing enchant parameter operations.
logSetting LogSetting Log Output Setting
Configuration for outputting log data of enchant operations to GS2-Log. By specifying a GS2-Log namespace, API request and response logs for balance parameter and rarity parameter operations can be collected.

Result

Type Description
item Namespace Namespace updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &enchant.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: &enchant.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
        },
        LogSetting: &enchant.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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting((new \Gs2\Enchant\Model\TransactionSetting())
                ->withEnableAutoRun(false)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            ->withLogSetting((new \Gs2\Enchant\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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.UpdateNamespaceRequest;
import io.gs2.enchant.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(new io.gs2.enchant.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withLogSetting(new io.gs2.enchant.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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Enchant.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(new Gs2.Gs2Enchant.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
        .WithLogSetting(new Gs2.Gs2Enchant.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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.updateNamespace(
        new Gs2Enchant.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(new Gs2Enchant.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withLogSetting(new Gs2Enchant.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 enchant

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

try:
    result = client.update_namespace(
        enchant.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(
                enchant.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001'))
            .with_log_setting(
                enchant.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('enchant')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
    },
    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('enchant')

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

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

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

result = api_result.result
item = result.item;

deleteNamespace

Delete Namespace

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

Details

Request

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

Result

Type Description
item Namespace The deleted Namespace

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

getServiceVersion

Get the microservice version

Details

Request

Request parameters: None

Result

Type Description
item string Version

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

api_result_handler = client.get_service_version_async({
})

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

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

Dump data associated with the specified user ID

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

Details

Request

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

Result

Type Description

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkDumpUserDataByUserId

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

Details

Request

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

Result

Type Description
url string URL of output data

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

Delete user data

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

Details

Request

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

Result

Type Description

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

Result

Type Description

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

prepareImportUserDataByUserId

Execute import of data associated with the specified user ID

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

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

Details

Request

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

Result

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

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

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

importUserDataByUserId

Execute import of data associated with the specified user ID

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

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

Details

Request

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

Result

Type Description

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkImportUserDataByUserId

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

Details

Request

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

Result

Type Description
url string URL of log data

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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;

describeBalanceParameterStatuses

Get a list of Balance Parameter Statuses

Retrieves a paginated list of balance parameter statuses for the currently logged-in user. Results can be optionally filtered by parameter name to retrieve statuses for a specific parameter model. Each status represents the current parameter values assigned to a specific property (e.g., an item).

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
parameterName string ~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<BalanceParameterStatus> List of Balance Parameter Statuses
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeBalanceParameterStatuses(
    &enchant.DescribeBalanceParameterStatusesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ParameterName: pointy.String("balance-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeBalanceParameterStatusesRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeBalanceParameterStatuses(
        (new DescribeBalanceParameterStatusesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withParameterName("balance-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeBalanceParameterStatusesRequest;
import io.gs2.enchant.result.DescribeBalanceParameterStatusesResult;

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

try {
    DescribeBalanceParameterStatusesResult result = client.describeBalanceParameterStatuses(
        new DescribeBalanceParameterStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("balance-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<BalanceParameterStatus> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeBalanceParameterStatusesResult> asyncResult = null;
yield return client.DescribeBalanceParameterStatuses(
    new Gs2.Gs2Enchant.Request.DescribeBalanceParameterStatusesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithParameterName("balance-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeBalanceParameterStatuses(
        new Gs2Enchant.DescribeBalanceParameterStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("balance-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.describe_balance_parameter_statuses(
        enchant.DescribeBalanceParameterStatusesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_parameter_name('balance-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

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

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

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

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

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

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

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

describeBalanceParameterStatusesByUserId

Get a list of Balance Parameter Statuses by specifying a user ID

Retrieves a paginated list of balance parameter statuses for the specified user. Results can be optionally filtered by parameter name to retrieve statuses for a specific parameter model. Each status represents the current parameter values assigned to a specific property (e.g., an item).

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string ~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<BalanceParameterStatus> List of Balance Parameter Statuses
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeBalanceParameterStatusesByUserId(
    &enchant.DescribeBalanceParameterStatusesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("balance-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeBalanceParameterStatusesByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeBalanceParameterStatusesByUserId(
        (new DescribeBalanceParameterStatusesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("balance-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeBalanceParameterStatusesByUserIdRequest;
import io.gs2.enchant.result.DescribeBalanceParameterStatusesByUserIdResult;

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

try {
    DescribeBalanceParameterStatusesByUserIdResult result = client.describeBalanceParameterStatusesByUserId(
        new DescribeBalanceParameterStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<BalanceParameterStatus> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeBalanceParameterStatusesByUserIdResult> asyncResult = null;
yield return client.DescribeBalanceParameterStatusesByUserId(
    new Gs2.Gs2Enchant.Request.DescribeBalanceParameterStatusesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("balance-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeBalanceParameterStatusesByUserId(
        new Gs2Enchant.DescribeBalanceParameterStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.describe_balance_parameter_statuses_by_user_id(
        enchant.DescribeBalanceParameterStatusesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('balance-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

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

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

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

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

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

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

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

getBalanceParameterStatus

Get Balance Parameter Status

Retrieves the current balance parameter values for a specific property of the currently logged-in user. The status contains the parameter values that were assigned when the parameters were first drawn or last re-drawn, where the sum of all values equals the model’s total value.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
parameterName string
~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these balance parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.

Result

Type Description
item BalanceParameterStatus Balance Parameter Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetBalanceParameterStatus(
    &enchant.GetBalanceParameterStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ParameterName: pointy.String("balance-0001"),
        PropertyId: pointy.String("property-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetBalanceParameterStatusRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getBalanceParameterStatus(
        (new GetBalanceParameterStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withParameterName("balance-0001")
            ->withPropertyId("property-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetBalanceParameterStatusRequest;
import io.gs2.enchant.result.GetBalanceParameterStatusResult;

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

try {
    GetBalanceParameterStatusResult result = client.getBalanceParameterStatus(
        new GetBalanceParameterStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
    );
    BalanceParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetBalanceParameterStatusResult> asyncResult = null;
yield return client.GetBalanceParameterStatus(
    new Gs2.Gs2Enchant.Request.GetBalanceParameterStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithParameterName("balance-0001")
        .WithPropertyId("property-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getBalanceParameterStatus(
        new Gs2Enchant.GetBalanceParameterStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_balance_parameter_status(
        enchant.GetBalanceParameterStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_parameter_name('balance-0001')
            .with_property_id('property-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_balance_parameter_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    parameterName="balance-0001",
    propertyId="property-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('enchant')

api_result_handler = client.get_balance_parameter_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    parameterName="balance-0001",
    propertyId="property-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;

getBalanceParameterStatusByUserId

Get Balance Parameter Status by specifying a user ID

Retrieves the current balance parameter values for a specific property of the specified user. The status contains the parameter values that were assigned when the parameters were first drawn or last re-drawn, where the sum of all values equals the model’s total value.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these balance parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item BalanceParameterStatus Balance Parameter Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetBalanceParameterStatusByUserId(
    &enchant.GetBalanceParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("balance-0001"),
        PropertyId: pointy.String("property-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetBalanceParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getBalanceParameterStatusByUserId(
        (new GetBalanceParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("balance-0001")
            ->withPropertyId("property-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetBalanceParameterStatusByUserIdRequest;
import io.gs2.enchant.result.GetBalanceParameterStatusByUserIdResult;

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

try {
    GetBalanceParameterStatusByUserIdResult result = client.getBalanceParameterStatusByUserId(
        new GetBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    BalanceParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetBalanceParameterStatusByUserIdResult> asyncResult = null;
yield return client.GetBalanceParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.GetBalanceParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("balance-0001")
        .WithPropertyId("property-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getBalanceParameterStatusByUserId(
        new Gs2Enchant.GetBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_balance_parameter_status_by_user_id(
        enchant.GetBalanceParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('balance-0001')
            .with_property_id('property-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_balance_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_balance_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

deleteBalanceParameterStatusByUserId

Delete Balance Parameter Status

Deletes the balance parameter status for a specific property of the specified user. Once deleted, the parameter values are permanently removed and cannot be recovered.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these balance parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item BalanceParameterStatus Balance Parameter Status deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DeleteBalanceParameterStatusByUserId(
    &enchant.DeleteBalanceParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("balance-0001"),
        PropertyId: pointy.String("property-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DeleteBalanceParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->deleteBalanceParameterStatusByUserId(
        (new DeleteBalanceParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("balance-0001")
            ->withPropertyId("property-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DeleteBalanceParameterStatusByUserIdRequest;
import io.gs2.enchant.result.DeleteBalanceParameterStatusByUserIdResult;

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

try {
    DeleteBalanceParameterStatusByUserIdResult result = client.deleteBalanceParameterStatusByUserId(
        new DeleteBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    BalanceParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DeleteBalanceParameterStatusByUserIdResult> asyncResult = null;
yield return client.DeleteBalanceParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.DeleteBalanceParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("balance-0001")
        .WithPropertyId("property-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.deleteBalanceParameterStatusByUserId(
        new Gs2Enchant.DeleteBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.delete_balance_parameter_status_by_user_id(
        enchant.DeleteBalanceParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('balance-0001')
            .with_property_id('property-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.delete_balance_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.delete_balance_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

reDrawBalanceParameterStatusByUserId

Re-draw balance parameter by specifying a user ID

Re-draws the balance parameter values for a specific property, redistributing the total value among the parameters. Specific parameters can be fixed (locked) to prevent them from being re-drawn by specifying their names in fixedParameterNames (up to 10). The total value constraint is maintained: the sum of all parameter values (including fixed ones) always equals the model’s total value. Both the updated and previous parameter states are returned.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these balance parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
fixedParameterNames List<string> [] 0 ~ 10 items List of Parameter index not to re-draw
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item BalanceParameterStatus Balance Parameter Status updated
old BalanceParameterStatus Balance Parameter Status before update

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.ReDrawBalanceParameterStatusByUserId(
    &enchant.ReDrawBalanceParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("balance-0001"),
        PropertyId: pointy.String("property-0001"),
        FixedParameterNames: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\ReDrawBalanceParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->reDrawBalanceParameterStatusByUserId(
        (new ReDrawBalanceParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("balance-0001")
            ->withPropertyId("property-0001")
            ->withFixedParameterNames(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
} 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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.ReDrawBalanceParameterStatusByUserIdRequest;
import io.gs2.enchant.result.ReDrawBalanceParameterStatusByUserIdResult;

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

try {
    ReDrawBalanceParameterStatusByUserIdResult result = client.reDrawBalanceParameterStatusByUserId(
        new ReDrawBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withFixedParameterNames(null)
            .withTimeOffsetToken(null)
    );
    BalanceParameterStatus item = result.getItem();
    BalanceParameterStatus old = result.getOld();
} 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.ReDrawBalanceParameterStatusByUserIdResult> asyncResult = null;
yield return client.ReDrawBalanceParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.ReDrawBalanceParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("balance-0001")
        .WithPropertyId("property-0001")
        .WithFixedParameterNames(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.reDrawBalanceParameterStatusByUserId(
        new Gs2Enchant.ReDrawBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withFixedParameterNames(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.re_draw_balance_parameter_status_by_user_id(
        enchant.ReDrawBalanceParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('balance-0001')
            .with_property_id('property-0001')
            .with_fixed_parameter_names(None)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.re_draw_balance_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    fixedParameterNames=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.re_draw_balance_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    fixedParameterNames=nil,
    timeOffsetToken=nil,
})

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

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

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

setBalanceParameterStatusByUserId

Set any value to Balance Parameter Status by specifying a user ID

Directly sets parameter values for a specific property of the specified user, bypassing the normal draw/re-draw mechanism. This is an administrative operation that allows arbitrary parameter values to be assigned. Both the updated and previous parameter states are returned.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Balance Parameter Model name
The name of the Balance Parameter Model that defines the drawing conditions for this status. References the model that specifies the total value, allocation strategy, and available parameter slots.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these balance parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
parameterValues List<BalanceParameterValue>
1 ~ 10 items List of balance parameter values
The concrete values assigned to each parameter slot after the drawing process. Each entry corresponds to a parameter slot defined in the model and contains the actual numeric value allocated. The sum of all values equals the total value specified in the model.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item BalanceParameterStatus Balance Parameter Status updated
old BalanceParameterStatus Balance Parameter Status before update

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.SetBalanceParameterStatusByUserId(
    &enchant.SetBalanceParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("balance-0001"),
        PropertyId: pointy.String("property-0001"),
        ParameterValues: []enchant.BalanceParameterValue{
            enchant.BalanceParameterValue{
                Name: pointy.String("parameter-0001"),
                Value: pointy.Int64(100),
            },
            enchant.BalanceParameterValue{
                Name: pointy.String("parameter-0002"),
                Value: pointy.Int64(200),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\SetBalanceParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->setBalanceParameterStatusByUserId(
        (new SetBalanceParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("balance-0001")
            ->withPropertyId("property-0001")
            ->withParameterValues([
                (new BalanceParameterValue())
                    ->withName("parameter-0001")
                    ->withValue(100),
                (new BalanceParameterValue())
                    ->withName("parameter-0002")
                    ->withValue(200),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
} 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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.SetBalanceParameterStatusByUserIdRequest;
import io.gs2.enchant.result.SetBalanceParameterStatusByUserIdResult;

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

try {
    SetBalanceParameterStatusByUserIdResult result = client.setBalanceParameterStatusByUserId(
        new SetBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withParameterValues(Arrays.asList(
                new BalanceParameterValue()
                    .withName("parameter-0001")
                    .withValue(100L),
                new BalanceParameterValue()
                    .withName("parameter-0002")
                    .withValue(200L)
            ))
            .withTimeOffsetToken(null)
    );
    BalanceParameterStatus item = result.getItem();
    BalanceParameterStatus old = result.getOld();
} 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.SetBalanceParameterStatusByUserIdResult> asyncResult = null;
yield return client.SetBalanceParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.SetBalanceParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("balance-0001")
        .WithPropertyId("property-0001")
        .WithParameterValues(new Gs2.Gs2Enchant.Model.BalanceParameterValue[] {
            new Gs2.Gs2Enchant.Model.BalanceParameterValue()
                .WithName("parameter-0001")
                .WithValue(100L),
            new Gs2.Gs2Enchant.Model.BalanceParameterValue()
                .WithName("parameter-0002")
                .WithValue(200L),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.setBalanceParameterStatusByUserId(
        new Gs2Enchant.SetBalanceParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withParameterValues([
                new Gs2Enchant.model.BalanceParameterValue()
                    .withName("parameter-0001")
                    .withValue(100),
                new Gs2Enchant.model.BalanceParameterValue()
                    .withName("parameter-0002")
                    .withValue(200),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.set_balance_parameter_status_by_user_id(
        enchant.SetBalanceParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('balance-0001')
            .with_property_id('property-0001')
            .with_parameter_values([
                enchant.BalanceParameterValue()
                    .with_name('parameter-0001')
                    .with_value(100),
                enchant.BalanceParameterValue()
                    .with_name('parameter-0002')
                    .with_value(200),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.set_balance_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    parameterValues={
        {
            name="parameter-0001",
            value=100,
        },
        {
            name="parameter-0002",
            value=200,
        }
    },
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.set_balance_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    parameterValues={
        {
            name="parameter-0001",
            value=100,
        },
        {
            name="parameter-0002",
            value=200,
        }
    },
    timeOffsetToken=nil,
})

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

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

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

describeRarityParameterStatuses

Get a list of Rarity Parameter Statuses

Retrieves a paginated list of rarity parameter statuses for the currently logged-in user. Results can be optionally filtered by parameter name to retrieve statuses for a specific parameter model. Each status represents the current set of rarity-based parameter values assigned to a specific property (e.g., an item).

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
parameterName string ~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<RarityParameterStatus> List of Rarity Parameter Models
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeRarityParameterStatuses(
    &enchant.DescribeRarityParameterStatusesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ParameterName: pointy.String("rarity-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeRarityParameterStatusesRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeRarityParameterStatuses(
        (new DescribeRarityParameterStatusesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withParameterName("rarity-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeRarityParameterStatusesRequest;
import io.gs2.enchant.result.DescribeRarityParameterStatusesResult;

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

try {
    DescribeRarityParameterStatusesResult result = client.describeRarityParameterStatuses(
        new DescribeRarityParameterStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("rarity-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<RarityParameterStatus> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeRarityParameterStatusesResult> asyncResult = null;
yield return client.DescribeRarityParameterStatuses(
    new Gs2.Gs2Enchant.Request.DescribeRarityParameterStatusesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithParameterName("rarity-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeRarityParameterStatuses(
        new Gs2Enchant.DescribeRarityParameterStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("rarity-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.describe_rarity_parameter_statuses(
        enchant.DescribeRarityParameterStatusesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_parameter_name('rarity-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

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

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

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

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

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

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

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

describeRarityParameterStatusesByUserId

Get a list of Rarity Parameter Statuses by specifying a user ID

Retrieves a paginated list of rarity parameter statuses for the specified user. Results can be optionally filtered by parameter name to retrieve statuses for a specific parameter model. Each status represents the current set of rarity-based parameter values assigned to a specific property (e.g., an item).

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string ~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<RarityParameterStatus> List of Rarity Parameter Models
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeRarityParameterStatusesByUserId(
    &enchant.DescribeRarityParameterStatusesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("balance-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeRarityParameterStatusesByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeRarityParameterStatusesByUserId(
        (new DescribeRarityParameterStatusesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("balance-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeRarityParameterStatusesByUserIdRequest;
import io.gs2.enchant.result.DescribeRarityParameterStatusesByUserIdResult;

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

try {
    DescribeRarityParameterStatusesByUserIdResult result = client.describeRarityParameterStatusesByUserId(
        new DescribeRarityParameterStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<RarityParameterStatus> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeRarityParameterStatusesByUserIdResult> asyncResult = null;
yield return client.DescribeRarityParameterStatusesByUserId(
    new Gs2.Gs2Enchant.Request.DescribeRarityParameterStatusesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("balance-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeRarityParameterStatusesByUserId(
        new Gs2Enchant.DescribeRarityParameterStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.describe_rarity_parameter_statuses_by_user_id(
        enchant.DescribeRarityParameterStatusesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('balance-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

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

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

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

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

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

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

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

getRarityParameterStatus

Get Rarity Parameter Status

Retrieves the current rarity parameter values for a specific property of the currently logged-in user. The status contains the parameter values that were randomly drawn based on the rarity weights defined in the model.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.

Result

Type Description
item RarityParameterStatus Rarity Parameter Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetRarityParameterStatus(
    &enchant.GetRarityParameterStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ParameterName: pointy.String("balance-0001"),
        PropertyId: pointy.String("property-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetRarityParameterStatusRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getRarityParameterStatus(
        (new GetRarityParameterStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withParameterName("balance-0001")
            ->withPropertyId("property-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetRarityParameterStatusRequest;
import io.gs2.enchant.result.GetRarityParameterStatusResult;

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

try {
    GetRarityParameterStatusResult result = client.getRarityParameterStatus(
        new GetRarityParameterStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
    );
    RarityParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetRarityParameterStatusResult> asyncResult = null;
yield return client.GetRarityParameterStatus(
    new Gs2.Gs2Enchant.Request.GetRarityParameterStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithParameterName("balance-0001")
        .WithPropertyId("property-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getRarityParameterStatus(
        new Gs2Enchant.GetRarityParameterStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_rarity_parameter_status(
        enchant.GetRarityParameterStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_parameter_name('balance-0001')
            .with_property_id('property-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_rarity_parameter_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    parameterName="balance-0001",
    propertyId="property-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('enchant')

api_result_handler = client.get_rarity_parameter_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    parameterName="balance-0001",
    propertyId="property-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;

getRarityParameterStatusByUserId

Get Rarity Parameter Status by specifying a user ID

Retrieves the current rarity parameter values for a specific property of the specified user. The status contains the parameter values that were randomly drawn based on the rarity weights defined in the model.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item RarityParameterStatus Rarity Parameter Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetRarityParameterStatusByUserId(
    &enchant.GetRarityParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("rarity-0001"),
        PropertyId: pointy.String("property-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetRarityParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getRarityParameterStatusByUserId(
        (new GetRarityParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("rarity-0001")
            ->withPropertyId("property-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetRarityParameterStatusByUserIdRequest;
import io.gs2.enchant.result.GetRarityParameterStatusByUserIdResult;

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

try {
    GetRarityParameterStatusByUserIdResult result = client.getRarityParameterStatusByUserId(
        new GetRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    RarityParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetRarityParameterStatusByUserIdResult> asyncResult = null;
yield return client.GetRarityParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.GetRarityParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("rarity-0001")
        .WithPropertyId("property-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getRarityParameterStatusByUserId(
        new Gs2Enchant.GetRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_rarity_parameter_status_by_user_id(
        enchant.GetRarityParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('rarity-0001')
            .with_property_id('property-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_rarity_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_rarity_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

deleteRarityParameterStatusByUserId

Delete Rarity Parameter Status

Deletes the rarity parameter status for a specific property of the specified user. Once deleted, the parameter values are permanently removed and cannot be recovered.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item RarityParameterStatus Rarity Parameter Status deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DeleteRarityParameterStatusByUserId(
    &enchant.DeleteRarityParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("rarity-0001"),
        PropertyId: pointy.String("property-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DeleteRarityParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->deleteRarityParameterStatusByUserId(
        (new DeleteRarityParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("rarity-0001")
            ->withPropertyId("property-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DeleteRarityParameterStatusByUserIdRequest;
import io.gs2.enchant.result.DeleteRarityParameterStatusByUserIdResult;

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

try {
    DeleteRarityParameterStatusByUserIdResult result = client.deleteRarityParameterStatusByUserId(
        new DeleteRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    RarityParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DeleteRarityParameterStatusByUserIdResult> asyncResult = null;
yield return client.DeleteRarityParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.DeleteRarityParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("rarity-0001")
        .WithPropertyId("property-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.deleteRarityParameterStatusByUserId(
        new Gs2Enchant.DeleteRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.delete_rarity_parameter_status_by_user_id(
        enchant.DeleteRarityParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('rarity-0001')
            .with_property_id('property-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.delete_rarity_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.delete_rarity_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

reDrawRarityParameterStatusByUserId

Re-draw Rarity Parameter Status by specifying a user ID

Re-draws the rarity parameter values for a specific property, randomly assigning new values based on the rarity weights. Specific parameters can be fixed (locked) to prevent them from being re-drawn by specifying their names in fixedParameterNames (up to 10). Fixed parameters retain their current values while unfixed parameters are re-drawn. Both the updated and previous parameter states are returned.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
fixedParameterNames List<string> 0 ~ 10 items List of Parameter index not to re-draw
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item RarityParameterStatus Rarity Parameter Status updated
old RarityParameterStatus Rarity Parameter Status before update

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.ReDrawRarityParameterStatusByUserId(
    &enchant.ReDrawRarityParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("rarity-0001"),
        PropertyId: pointy.String("property-0001"),
        FixedParameterNames: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\ReDrawRarityParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->reDrawRarityParameterStatusByUserId(
        (new ReDrawRarityParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("rarity-0001")
            ->withPropertyId("property-0001")
            ->withFixedParameterNames(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
} 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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.ReDrawRarityParameterStatusByUserIdRequest;
import io.gs2.enchant.result.ReDrawRarityParameterStatusByUserIdResult;

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

try {
    ReDrawRarityParameterStatusByUserIdResult result = client.reDrawRarityParameterStatusByUserId(
        new ReDrawRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withFixedParameterNames(null)
            .withTimeOffsetToken(null)
    );
    RarityParameterStatus item = result.getItem();
    RarityParameterStatus old = result.getOld();
} 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.ReDrawRarityParameterStatusByUserIdResult> asyncResult = null;
yield return client.ReDrawRarityParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.ReDrawRarityParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("rarity-0001")
        .WithPropertyId("property-0001")
        .WithFixedParameterNames(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.reDrawRarityParameterStatusByUserId(
        new Gs2Enchant.ReDrawRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withFixedParameterNames(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.re_draw_rarity_parameter_status_by_user_id(
        enchant.ReDrawRarityParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('rarity-0001')
            .with_property_id('property-0001')
            .with_fixed_parameter_names(None)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.re_draw_rarity_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    fixedParameterNames=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.re_draw_rarity_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    fixedParameterNames=nil,
    timeOffsetToken=nil,
})

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

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

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

addRarityParameterStatusByUserId

Add Rarity Parameter to status by specifying a user ID

Adds new parameter slots to an existing rarity parameter status by randomly drawing values based on the rarity weights. The count specifies how many parameter slots to add (1 to 10), up to the model’s maximum parameter count. Both the updated and previous parameter states are returned.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
count int 1 1 ~ 10 Number of parameters to add
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item RarityParameterStatus Rarity Parameter Status updated
old RarityParameterStatus Rarity Parameter Status before update

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.AddRarityParameterStatusByUserId(
    &enchant.AddRarityParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("balance-0001"),
        PropertyId: pointy.String("property-0001"),
        Count: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\AddRarityParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->addRarityParameterStatusByUserId(
        (new AddRarityParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("balance-0001")
            ->withPropertyId("property-0001")
            ->withCount(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
} 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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.AddRarityParameterStatusByUserIdRequest;
import io.gs2.enchant.result.AddRarityParameterStatusByUserIdResult;

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

try {
    AddRarityParameterStatusByUserIdResult result = client.addRarityParameterStatusByUserId(
        new AddRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withCount(null)
            .withTimeOffsetToken(null)
    );
    RarityParameterStatus item = result.getItem();
    RarityParameterStatus old = result.getOld();
} 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.AddRarityParameterStatusByUserIdResult> asyncResult = null;
yield return client.AddRarityParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.AddRarityParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("balance-0001")
        .WithPropertyId("property-0001")
        .WithCount(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.addRarityParameterStatusByUserId(
        new Gs2Enchant.AddRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("balance-0001")
            .withPropertyId("property-0001")
            .withCount(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.add_rarity_parameter_status_by_user_id(
        enchant.AddRarityParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('balance-0001')
            .with_property_id('property-0001')
            .with_count(None)
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.add_rarity_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    count=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.add_rarity_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="balance-0001",
    propertyId="property-0001",
    count=nil,
    timeOffsetToken=nil,
})

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

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

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

verifyRarityParameterStatus

Verify rarity parameter

Verifies that a rarity parameter status meets the specified condition. Three verification types are supported:

  • ‘have’: Verifies that the specified parameter value exists in the status
  • ‘havent’: Verifies that the specified parameter value does not exist in the status
  • ‘count’: Verifies that the number of parameters matches the specified count This can be used as a precondition check before executing other actions.
Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
accessToken string
~ 128 chars Access token
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
verifyType string (enum)
enum {
  “havent”,
  “have”,
  “count”
}
Type of verification
DefinitionDescription
“havent”The specified parameter must not be held
“have”The specified parameter must be held
“count”The number of parameters held must be the specified number
parameterValueName string {verifyType} in [“havent”, “have”]
✓*
~ 64 chars Name
The identifier for this lottery entry. Must be unique within the rarity parameter model’s value pool. When drawn, this name is stored in the resulting Rarity Parameter Value.
* Required if verifyType is “havent”,“have”
parameterCount int {verifyType} in [“count”]
✓*
0 ~ 10 Number of parameters to verify
multiplyValueSpecifyingQuantity bool false Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item RarityParameterStatus Rarity Parameter Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.VerifyRarityParameterStatus(
    &enchant.VerifyRarityParameterStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("balance-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PropertyId: pointy.String("property-0001"),
        VerifyType: pointy.String("have"),
        ParameterValueName: pointy.String("parameter-0001"),
        ParameterCount: nil,
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\VerifyRarityParameterStatusRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->verifyRarityParameterStatus(
        (new VerifyRarityParameterStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("balance-0001")
            ->withAccessToken("accessToken-0001")
            ->withPropertyId("property-0001")
            ->withVerifyType("have")
            ->withParameterValueName("parameter-0001")
            ->withParameterCount(null)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.VerifyRarityParameterStatusRequest;
import io.gs2.enchant.result.VerifyRarityParameterStatusResult;

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

try {
    VerifyRarityParameterStatusResult result = client.verifyRarityParameterStatus(
        new VerifyRarityParameterStatusRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
            .withAccessToken("accessToken-0001")
            .withPropertyId("property-0001")
            .withVerifyType("have")
            .withParameterValueName("parameter-0001")
            .withParameterCount(null)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    RarityParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.VerifyRarityParameterStatusResult> asyncResult = null;
yield return client.VerifyRarityParameterStatus(
    new Gs2.Gs2Enchant.Request.VerifyRarityParameterStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("balance-0001")
        .WithAccessToken("accessToken-0001")
        .WithPropertyId("property-0001")
        .WithVerifyType("have")
        .WithParameterValueName("parameter-0001")
        .WithParameterCount(null)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.verifyRarityParameterStatus(
        new Gs2Enchant.VerifyRarityParameterStatusRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
            .withAccessToken("accessToken-0001")
            .withPropertyId("property-0001")
            .withVerifyType("have")
            .withParameterValueName("parameter-0001")
            .withParameterCount(null)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.verify_rarity_parameter_status(
        enchant.VerifyRarityParameterStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('balance-0001')
            .with_access_token('accessToken-0001')
            .with_property_id('property-0001')
            .with_verify_type('have')
            .with_parameter_value_name('parameter-0001')
            .with_parameter_count(None)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.verify_rarity_parameter_status({
    namespaceName="namespace-0001",
    parameterName="balance-0001",
    accessToken="accessToken-0001",
    propertyId="property-0001",
    verifyType="have",
    parameterValueName="parameter-0001",
    parameterCount=nil,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

api_result_handler = client.verify_rarity_parameter_status_async({
    namespaceName="namespace-0001",
    parameterName="balance-0001",
    accessToken="accessToken-0001",
    propertyId="property-0001",
    verifyType="have",
    parameterValueName="parameter-0001",
    parameterCount=nil,
    multiplyValueSpecifyingQuantity=nil,
})

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

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

result = api_result.result
item = result.item;

verifyRarityParameterStatusByUserId

Verify rarity parameter by specifying a user ID

Verifies that a rarity parameter status of the specified user meets the specified condition. Three verification types are supported:

  • ‘have’: Verifies that the specified parameter value exists in the status
  • ‘havent’: Verifies that the specified parameter value does not exist in the status
  • ‘count’: Verifies that the number of parameters matches the specified count This can be used as a precondition check before executing other actions.
Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
userId string
~ 128 chars User ID
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
verifyType string (enum)
enum {
  “havent”,
  “have”,
  “count”
}
Type of verification
DefinitionDescription
“havent”The specified parameter must not be held
“have”The specified parameter must be held
“count”The number of parameters held must be the specified number
parameterValueName string {verifyType} in [“havent”, “have”]
✓*
~ 64 chars Name
The identifier for this lottery entry. Must be unique within the rarity parameter model’s value pool. When drawn, this name is stored in the resulting Rarity Parameter Value.
* Required if verifyType is “havent”,“have”
parameterCount int {verifyType} in [“count”]
✓*
0 ~ 10 Number of parameters to verify
multiplyValueSpecifyingQuantity bool false Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item RarityParameterStatus Rarity Parameter Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.VerifyRarityParameterStatusByUserId(
    &enchant.VerifyRarityParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("rarity-0001"),
        UserId: pointy.String("user-0001"),
        PropertyId: pointy.String("property-0001"),
        VerifyType: pointy.String("have"),
        ParameterValueName: pointy.String("parameter-0001"),
        ParameterCount: nil,
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\VerifyRarityParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->verifyRarityParameterStatusByUserId(
        (new VerifyRarityParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("rarity-0001")
            ->withUserId("user-0001")
            ->withPropertyId("property-0001")
            ->withVerifyType("have")
            ->withParameterValueName("parameter-0001")
            ->withParameterCount(null)
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.VerifyRarityParameterStatusByUserIdRequest;
import io.gs2.enchant.result.VerifyRarityParameterStatusByUserIdResult;

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

try {
    VerifyRarityParameterStatusByUserIdResult result = client.verifyRarityParameterStatusByUserId(
        new VerifyRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
            .withUserId("user-0001")
            .withPropertyId("property-0001")
            .withVerifyType("have")
            .withParameterValueName("parameter-0001")
            .withParameterCount(null)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    RarityParameterStatus 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.VerifyRarityParameterStatusByUserIdResult> asyncResult = null;
yield return client.VerifyRarityParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.VerifyRarityParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("rarity-0001")
        .WithUserId("user-0001")
        .WithPropertyId("property-0001")
        .WithVerifyType("have")
        .WithParameterValueName("parameter-0001")
        .WithParameterCount(null)
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.verifyRarityParameterStatusByUserId(
        new Gs2Enchant.VerifyRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
            .withUserId("user-0001")
            .withPropertyId("property-0001")
            .withVerifyType("have")
            .withParameterValueName("parameter-0001")
            .withParameterCount(null)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.verify_rarity_parameter_status_by_user_id(
        enchant.VerifyRarityParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('rarity-0001')
            .with_user_id('user-0001')
            .with_property_id('property-0001')
            .with_verify_type('have')
            .with_parameter_value_name('parameter-0001')
            .with_parameter_count(None)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.verify_rarity_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    parameterName="rarity-0001",
    userId="user-0001",
    propertyId="property-0001",
    verifyType="have",
    parameterValueName="parameter-0001",
    parameterCount=nil,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.verify_rarity_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    parameterName="rarity-0001",
    userId="user-0001",
    propertyId="property-0001",
    verifyType="have",
    parameterValueName="parameter-0001",
    parameterCount=nil,
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

setRarityParameterStatusByUserId

Set any value to rarity parameter by specifying a user ID

Directly sets parameter values for a specific property of the specified user, bypassing the normal draw/re-draw mechanism. This is an administrative operation that allows arbitrary parameter values to be assigned regardless of rarity weights. Both the updated and previous parameter states are returned.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
parameterName string
~ 128 chars Rarity Parameter Model name
The name of the Rarity Parameter Model that defines the drawing conditions for this status. References the model that specifies the maximum parameter count, count lottery weights, and value lottery pool.
propertyId string
~ 1024 chars Property ID of the resource that owns the parameter
Identifies the specific game resource (e.g., a weapon or equipment item) to which these rarity parameters are attached. Typically references a GS2-Inventory item or similar resource via its property ID.
parameterValues List<RarityParameterValue> 0 ~ 10 items List of rarity parameter values
The concrete parameter values selected through weighted lottery for each granted slot. The number of entries is determined by the parameter count draw, and each entry’s value is selected from the value model pool. May contain fewer entries than the maximum parameter count.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item RarityParameterStatus Rarity Parameter Status updated
old RarityParameterStatus Rarity Parameter Status before update

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.SetRarityParameterStatusByUserId(
    &enchant.SetRarityParameterStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ParameterName: pointy.String("rarity-0001"),
        PropertyId: pointy.String("property-0001"),
        ParameterValues: []enchant.RarityParameterValue{
            enchant.RarityParameterValue{
                Name: pointy.String("parameter-0001"),
                ResourceName: pointy.String("str"),
                ResourceValue: pointy.Int64(100),
            },
            enchant.RarityParameterValue{
                Name: pointy.String("parameter-0002"),
                ResourceName: pointy.String("def"),
                ResourceValue: pointy.Int64(200),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\SetRarityParameterStatusByUserIdRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->setRarityParameterStatusByUserId(
        (new SetRarityParameterStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withParameterName("rarity-0001")
            ->withPropertyId("property-0001")
            ->withParameterValues([
                (new RarityParameterValue())
                    ->withName("parameter-0001")
                    ->withResourceName("str")
                    ->withResourceValue(100),
                (new RarityParameterValue())
                    ->withName("parameter-0002")
                    ->withResourceName("def")
                    ->withResourceValue(200),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
} 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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.SetRarityParameterStatusByUserIdRequest;
import io.gs2.enchant.result.SetRarityParameterStatusByUserIdResult;

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

try {
    SetRarityParameterStatusByUserIdResult result = client.setRarityParameterStatusByUserId(
        new SetRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withParameterValues(Arrays.asList(
                new RarityParameterValue()
                    .withName("parameter-0001")
                    .withResourceName("str")
                    .withResourceValue(100L),
                new RarityParameterValue()
                    .withName("parameter-0002")
                    .withResourceName("def")
                    .withResourceValue(200L)
            ))
            .withTimeOffsetToken(null)
    );
    RarityParameterStatus item = result.getItem();
    RarityParameterStatus old = result.getOld();
} 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.SetRarityParameterStatusByUserIdResult> asyncResult = null;
yield return client.SetRarityParameterStatusByUserId(
    new Gs2.Gs2Enchant.Request.SetRarityParameterStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithParameterName("rarity-0001")
        .WithPropertyId("property-0001")
        .WithParameterValues(new Gs2.Gs2Enchant.Model.RarityParameterValue[] {
            new Gs2.Gs2Enchant.Model.RarityParameterValue()
                .WithName("parameter-0001")
                .WithResourceName("str")
                .WithResourceValue(100L),
            new Gs2.Gs2Enchant.Model.RarityParameterValue()
                .WithName("parameter-0002")
                .WithResourceName("def")
                .WithResourceValue(200L),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.setRarityParameterStatusByUserId(
        new Gs2Enchant.SetRarityParameterStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withParameterName("rarity-0001")
            .withPropertyId("property-0001")
            .withParameterValues([
                new Gs2Enchant.model.RarityParameterValue()
                    .withName("parameter-0001")
                    .withResourceName("str")
                    .withResourceValue(100),
                new Gs2Enchant.model.RarityParameterValue()
                    .withName("parameter-0002")
                    .withResourceName("def")
                    .withResourceValue(200),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.set_rarity_parameter_status_by_user_id(
        enchant.SetRarityParameterStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_parameter_name('rarity-0001')
            .with_property_id('property-0001')
            .with_parameter_values([
                enchant.RarityParameterValue()
                    .with_name('parameter-0001')
                    .with_resource_name('str')
                    .with_resource_value(100),
                enchant.RarityParameterValue()
                    .with_name('parameter-0002')
                    .with_resource_name('def')
                    .with_resource_value(200),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.set_rarity_parameter_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    parameterValues={
        {
            name="parameter-0001",
            resource_name="str",
            resource_value=100,
        },
        {
            name="parameter-0002",
            resource_name="def",
            resource_value=200,
        }
    },
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.set_rarity_parameter_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    parameterName="rarity-0001",
    propertyId="property-0001",
    parameterValues={
        {
            name="parameter-0001",
            resource_name="str",
            resource_value=100,
        },
        {
            name="parameter-0002",
            resource_name="def",
            resource_value=200,
        }
    },
    timeOffsetToken=nil,
})

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

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

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

describeBalanceParameterModels

Get a list of Balance Parameter Models

Retrieves all currently active (published) Balance Parameter Models in the specified namespace. Balance Parameter Models define parameter sets where the total value is distributed among multiple parameters, ensuring the sum always equals a fixed total. Only models that have been activated via the current master data are returned; editable master data is not included.

Details

Request

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

Result

Type Description
items List<BalanceParameterModel> List of Balance Parameter Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeBalanceParameterModels(
    &enchant.DescribeBalanceParameterModelsRequest {
        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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeBalanceParameterModelsRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeBalanceParameterModels(
        (new DescribeBalanceParameterModelsRequest())
            ->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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeBalanceParameterModelsRequest;
import io.gs2.enchant.result.DescribeBalanceParameterModelsResult;

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

try {
    DescribeBalanceParameterModelsResult result = client.describeBalanceParameterModels(
        new DescribeBalanceParameterModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<BalanceParameterModel> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeBalanceParameterModelsResult> asyncResult = null;
yield return client.DescribeBalanceParameterModels(
    new Gs2.Gs2Enchant.Request.DescribeBalanceParameterModelsRequest()
        .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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeBalanceParameterModels(
        new Gs2Enchant.DescribeBalanceParameterModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.describe_balance_parameter_models(
        enchant.DescribeBalanceParameterModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.describe_balance_parameter_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('enchant')

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

getBalanceParameterModel

Get Balance Parameter Model

Retrieves the detailed information of a specific active Balance Parameter Model by name. The returned information includes the model’s name, metadata, total value, initial value strategy, and parameter definitions.

Details

Request

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

Result

Type Description
item BalanceParameterModel Balance Parameter Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetBalanceParameterModel(
    &enchant.GetBalanceParameterModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("balance-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetBalanceParameterModelRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getBalanceParameterModel(
        (new GetBalanceParameterModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("balance-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetBalanceParameterModelRequest;
import io.gs2.enchant.result.GetBalanceParameterModelResult;

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

try {
    GetBalanceParameterModelResult result = client.getBalanceParameterModel(
        new GetBalanceParameterModelRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
    );
    BalanceParameterModel 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetBalanceParameterModelResult> asyncResult = null;
yield return client.GetBalanceParameterModel(
    new Gs2.Gs2Enchant.Request.GetBalanceParameterModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("balance-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getBalanceParameterModel(
        new Gs2Enchant.GetBalanceParameterModelRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_balance_parameter_model(
        enchant.GetBalanceParameterModelRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('balance-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_balance_parameter_model({
    namespaceName="namespace-0001",
    parameterName="balance-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('enchant')

api_result_handler = client.get_balance_parameter_model_async({
    namespaceName="namespace-0001",
    parameterName="balance-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;

describeRarityParameterModels

Get a list of Rarity Parameter Models

Retrieves all currently active (published) Rarity Parameter Models in the specified namespace. Rarity Parameter Models define parameter sets where each parameter slot is filled by a randomly drawn value with rarity-based probabilities. Only models that have been activated via the current master data are returned; editable master data is not included.

Details

Request

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

Result

Type Description
items List<RarityParameterModel> List of Rarity Parameter Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeRarityParameterModels(
    &enchant.DescribeRarityParameterModelsRequest {
        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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeRarityParameterModelsRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeRarityParameterModels(
        (new DescribeRarityParameterModelsRequest())
            ->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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeRarityParameterModelsRequest;
import io.gs2.enchant.result.DescribeRarityParameterModelsResult;

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

try {
    DescribeRarityParameterModelsResult result = client.describeRarityParameterModels(
        new DescribeRarityParameterModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<RarityParameterModel> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeRarityParameterModelsResult> asyncResult = null;
yield return client.DescribeRarityParameterModels(
    new Gs2.Gs2Enchant.Request.DescribeRarityParameterModelsRequest()
        .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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeRarityParameterModels(
        new Gs2Enchant.DescribeRarityParameterModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.describe_rarity_parameter_models(
        enchant.DescribeRarityParameterModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.describe_rarity_parameter_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('enchant')

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

getRarityParameterModel

Get Rarity Parameter Model

Retrieves the detailed information of a specific active Rarity Parameter Model by name. The returned information includes the model’s name, metadata, maximum parameter count, parameter count distribution, and parameter value definitions with their rarity weights.

Details

Request

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

Result

Type Description
item RarityParameterModel Rarity Parameter Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetRarityParameterModel(
    &enchant.GetRarityParameterModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("rarity-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetRarityParameterModelRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getRarityParameterModel(
        (new GetRarityParameterModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("rarity-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetRarityParameterModelRequest;
import io.gs2.enchant.result.GetRarityParameterModelResult;

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

try {
    GetRarityParameterModelResult result = client.getRarityParameterModel(
        new GetRarityParameterModelRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
    );
    RarityParameterModel 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetRarityParameterModelResult> asyncResult = null;
yield return client.GetRarityParameterModel(
    new Gs2.Gs2Enchant.Request.GetRarityParameterModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("rarity-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getRarityParameterModel(
        new Gs2Enchant.GetRarityParameterModelRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_rarity_parameter_model(
        enchant.GetRarityParameterModelRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('rarity-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_rarity_parameter_model({
    namespaceName="namespace-0001",
    parameterName="rarity-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('enchant')

api_result_handler = client.get_rarity_parameter_model_async({
    namespaceName="namespace-0001",
    parameterName="rarity-0001",
})

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

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

result = api_result.result
item = result.item;

exportMaster

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

Exports the current Parameter Model Master data (both Balance Parameter Models and Rarity Parameter Models) 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

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

Result

Type Description
item CurrentParameterMaster Parameter Model master data that can be activated

Implementation Example

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

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

$session->open();

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

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

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

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

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

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

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

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

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

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;

getCurrentParameterMaster

Get currently active Parameter Model master data

Retrieves the master data of the Parameter Models (both Balance and Rarity) that are currently active (published) in the specified namespace.

Details

Request

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

Result

Type Description
item CurrentParameterMaster Currently active Parameter Model master data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetCurrentParameterMaster(
    &enchant.GetCurrentParameterMasterRequest {
        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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetCurrentParameterMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getCurrentParameterMaster(
        (new GetCurrentParameterMasterRequest())
            ->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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetCurrentParameterMasterRequest;
import io.gs2.enchant.result.GetCurrentParameterMasterResult;

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

try {
    GetCurrentParameterMasterResult result = client.getCurrentParameterMaster(
        new GetCurrentParameterMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentParameterMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetCurrentParameterMasterResult> asyncResult = null;
yield return client.GetCurrentParameterMaster(
    new Gs2.Gs2Enchant.Request.GetCurrentParameterMasterRequest()
        .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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getCurrentParameterMaster(
        new Gs2Enchant.GetCurrentParameterMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_current_parameter_master(
        enchant.GetCurrentParameterMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_current_parameter_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('enchant')

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

preUpdateCurrentParameterMaster

Update currently active Parameter Model master data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.
Details

Request

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

Result

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

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentParameterMaster(
    &enchant.PreUpdateCurrentParameterMasterRequest {
        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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\PreUpdateCurrentParameterMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentParameterMaster(
        (new PreUpdateCurrentParameterMasterRequest())
            ->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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.PreUpdateCurrentParameterMasterRequest;
import io.gs2.enchant.result.PreUpdateCurrentParameterMasterResult;

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

try {
    PreUpdateCurrentParameterMasterResult result = client.preUpdateCurrentParameterMaster(
        new PreUpdateCurrentParameterMasterRequest()
            .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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.PreUpdateCurrentParameterMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentParameterMaster(
    new Gs2.Gs2Enchant.Request.PreUpdateCurrentParameterMasterRequest()
        .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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.preUpdateCurrentParameterMaster(
        new Gs2Enchant.PreUpdateCurrentParameterMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.pre_update_current_parameter_master(
        enchant.PreUpdateCurrentParameterMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.pre_update_current_parameter_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('enchant')

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

updateCurrentParameterMaster

Update currently active Parameter Model master data

Updates and activates (publishes) the master data of the Parameter 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). The uploaded master data is validated before being applied.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
mode string (enum)
enum {
  “direct”,
  “preUpload”
}
“direct” Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settings string {mode} == “direct”
✓*
~ 5242880 chars Master Data
* Required if mode is “direct”
uploadToken string {mode} == “preUpload”
✓*
~ 1024 chars Token obtained by pre-upload
Used to apply the uploaded master data.
* Required if mode is “preUpload”

Result

Type Description
item CurrentParameterMaster Updated master data of the currently active Parameter Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentParameterMaster(
    &enchant.UpdateCurrentParameterMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2023-07-18\", \"balanceParameterModels\": [{\"name\": \"balance-0001\", \"metadata\": \"BALANCE_0001\", \"totalValue\": 100, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}]}, {\"name\": \"balance-0002\", \"metadata\": \"BALANCE_0002\", \"totalValue\": 200, \"initialValueStrategy\": \"lottery\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\"}]}, {\"name\": \"balance-0003\", \"metadata\": \"BALANCE_0003\", \"totalValue\": 500, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}]}], \"rarityParameterModels\": [{\"name\": \"rarity-0001\", \"metadata\": \"RARITY_0001\", \"maximumParameterCount\": 5, \"parameterCounts\": [{\"count\": 0, \"weight\": 1}, {\"count\": 1, \"weight\": 2}, {\"count\": 2, \"weight\": 3}], \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\", \"resourceName\": \"resource-0001\", \"resourceValue\": 10, \"weight\": 1}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\", \"resourceName\": \"resource-0002\", \"resourceValue\": 20, \"weight\": 2}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\", \"resourceName\": \"resource-0003\", \"resourceValue\": 30, \"weight\": 3}]}, {\"name\": \"rarity-0002\", \"metadata\": \"RARITY_0002\", \"maximumParameterCount\": 10, \"parameterCounts\": [{\"count\": 1, \"weight\": 10}, {\"count\": 2, \"weight\": 20}, {\"count\": 3, \"weight\": 30}], \"parameters\": [{\"name\": \"parameter-1001\", \"metadata\": \"PARAMETER_1001\", \"resourceName\": \"resource-1001\", \"resourceValue\": 100, \"weight\": 10}, {\"name\": \"parameter-1002\", \"metadata\": \"PARAMETER_1002\", \"resourceName\": \"resource-1002\", \"resourceValue\": 200, \"weight\": 20}, {\"name\": \"parameter-1003\", \"metadata\": \"PARAMETER_1003\", \"resourceName\": \"resource-1003\", \"resourceValue\": 300, \"weight\": 30}]}, {\"name\": \"rarity-0003\", \"metadata\": \"RARITY_0003\", \"maximumParameterCount\": 3, \"parameterCounts\": [{\"count\": 2, \"weight\": 5}, {\"count\": 3, \"weight\": 10}, {\"count\": 4, \"weight\": 15}], \"parameters\": [{\"name\": \"parameter-2001\", \"metadata\": \"PARAMETER_2001\", \"resourceName\": \"resource-2001\", \"resourceValue\": 1000, \"weight\": 2}, {\"name\": \"parameter-2002\", \"metadata\": \"PARAMETER_2002\", \"resourceName\": \"resource-2002\", \"resourceValue\": 2000, \"weight\": 4}, {\"name\": \"parameter-2003\", \"metadata\": \"PARAMETER_2003\", \"resourceName\": \"resource-2003\", \"resourceValue\": 3000, \"weight\": 6}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\", \"resourceName\": \"resource-2004\", \"resourceValue\": 4000, \"weight\": 8}]}]}"),
        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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\UpdateCurrentParameterMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->updateCurrentParameterMaster(
        (new UpdateCurrentParameterMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2023-07-18\", \"balanceParameterModels\": [{\"name\": \"balance-0001\", \"metadata\": \"BALANCE_0001\", \"totalValue\": 100, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}]}, {\"name\": \"balance-0002\", \"metadata\": \"BALANCE_0002\", \"totalValue\": 200, \"initialValueStrategy\": \"lottery\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\"}]}, {\"name\": \"balance-0003\", \"metadata\": \"BALANCE_0003\", \"totalValue\": 500, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}]}], \"rarityParameterModels\": [{\"name\": \"rarity-0001\", \"metadata\": \"RARITY_0001\", \"maximumParameterCount\": 5, \"parameterCounts\": [{\"count\": 0, \"weight\": 1}, {\"count\": 1, \"weight\": 2}, {\"count\": 2, \"weight\": 3}], \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\", \"resourceName\": \"resource-0001\", \"resourceValue\": 10, \"weight\": 1}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\", \"resourceName\": \"resource-0002\", \"resourceValue\": 20, \"weight\": 2}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\", \"resourceName\": \"resource-0003\", \"resourceValue\": 30, \"weight\": 3}]}, {\"name\": \"rarity-0002\", \"metadata\": \"RARITY_0002\", \"maximumParameterCount\": 10, \"parameterCounts\": [{\"count\": 1, \"weight\": 10}, {\"count\": 2, \"weight\": 20}, {\"count\": 3, \"weight\": 30}], \"parameters\": [{\"name\": \"parameter-1001\", \"metadata\": \"PARAMETER_1001\", \"resourceName\": \"resource-1001\", \"resourceValue\": 100, \"weight\": 10}, {\"name\": \"parameter-1002\", \"metadata\": \"PARAMETER_1002\", \"resourceName\": \"resource-1002\", \"resourceValue\": 200, \"weight\": 20}, {\"name\": \"parameter-1003\", \"metadata\": \"PARAMETER_1003\", \"resourceName\": \"resource-1003\", \"resourceValue\": 300, \"weight\": 30}]}, {\"name\": \"rarity-0003\", \"metadata\": \"RARITY_0003\", \"maximumParameterCount\": 3, \"parameterCounts\": [{\"count\": 2, \"weight\": 5}, {\"count\": 3, \"weight\": 10}, {\"count\": 4, \"weight\": 15}], \"parameters\": [{\"name\": \"parameter-2001\", \"metadata\": \"PARAMETER_2001\", \"resourceName\": \"resource-2001\", \"resourceValue\": 1000, \"weight\": 2}, {\"name\": \"parameter-2002\", \"metadata\": \"PARAMETER_2002\", \"resourceName\": \"resource-2002\", \"resourceValue\": 2000, \"weight\": 4}, {\"name\": \"parameter-2003\", \"metadata\": \"PARAMETER_2003\", \"resourceName\": \"resource-2003\", \"resourceValue\": 3000, \"weight\": 6}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\", \"resourceName\": \"resource-2004\", \"resourceValue\": 4000, \"weight\": 8}]}]}")
            ->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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.UpdateCurrentParameterMasterRequest;
import io.gs2.enchant.result.UpdateCurrentParameterMasterResult;

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

try {
    UpdateCurrentParameterMasterResult result = client.updateCurrentParameterMaster(
        new UpdateCurrentParameterMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2023-07-18\", \"balanceParameterModels\": [{\"name\": \"balance-0001\", \"metadata\": \"BALANCE_0001\", \"totalValue\": 100, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}]}, {\"name\": \"balance-0002\", \"metadata\": \"BALANCE_0002\", \"totalValue\": 200, \"initialValueStrategy\": \"lottery\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\"}]}, {\"name\": \"balance-0003\", \"metadata\": \"BALANCE_0003\", \"totalValue\": 500, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}]}], \"rarityParameterModels\": [{\"name\": \"rarity-0001\", \"metadata\": \"RARITY_0001\", \"maximumParameterCount\": 5, \"parameterCounts\": [{\"count\": 0, \"weight\": 1}, {\"count\": 1, \"weight\": 2}, {\"count\": 2, \"weight\": 3}], \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\", \"resourceName\": \"resource-0001\", \"resourceValue\": 10, \"weight\": 1}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\", \"resourceName\": \"resource-0002\", \"resourceValue\": 20, \"weight\": 2}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\", \"resourceName\": \"resource-0003\", \"resourceValue\": 30, \"weight\": 3}]}, {\"name\": \"rarity-0002\", \"metadata\": \"RARITY_0002\", \"maximumParameterCount\": 10, \"parameterCounts\": [{\"count\": 1, \"weight\": 10}, {\"count\": 2, \"weight\": 20}, {\"count\": 3, \"weight\": 30}], \"parameters\": [{\"name\": \"parameter-1001\", \"metadata\": \"PARAMETER_1001\", \"resourceName\": \"resource-1001\", \"resourceValue\": 100, \"weight\": 10}, {\"name\": \"parameter-1002\", \"metadata\": \"PARAMETER_1002\", \"resourceName\": \"resource-1002\", \"resourceValue\": 200, \"weight\": 20}, {\"name\": \"parameter-1003\", \"metadata\": \"PARAMETER_1003\", \"resourceName\": \"resource-1003\", \"resourceValue\": 300, \"weight\": 30}]}, {\"name\": \"rarity-0003\", \"metadata\": \"RARITY_0003\", \"maximumParameterCount\": 3, \"parameterCounts\": [{\"count\": 2, \"weight\": 5}, {\"count\": 3, \"weight\": 10}, {\"count\": 4, \"weight\": 15}], \"parameters\": [{\"name\": \"parameter-2001\", \"metadata\": \"PARAMETER_2001\", \"resourceName\": \"resource-2001\", \"resourceValue\": 1000, \"weight\": 2}, {\"name\": \"parameter-2002\", \"metadata\": \"PARAMETER_2002\", \"resourceName\": \"resource-2002\", \"resourceValue\": 2000, \"weight\": 4}, {\"name\": \"parameter-2003\", \"metadata\": \"PARAMETER_2003\", \"resourceName\": \"resource-2003\", \"resourceValue\": 3000, \"weight\": 6}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\", \"resourceName\": \"resource-2004\", \"resourceValue\": 4000, \"weight\": 8}]}]}")
            .withUploadToken(null)
    );
    CurrentParameterMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.UpdateCurrentParameterMasterResult> asyncResult = null;
yield return client.UpdateCurrentParameterMaster(
    new Gs2.Gs2Enchant.Request.UpdateCurrentParameterMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2023-07-18\", \"balanceParameterModels\": [{\"name\": \"balance-0001\", \"metadata\": \"BALANCE_0001\", \"totalValue\": 100, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}]}, {\"name\": \"balance-0002\", \"metadata\": \"BALANCE_0002\", \"totalValue\": 200, \"initialValueStrategy\": \"lottery\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\"}]}, {\"name\": \"balance-0003\", \"metadata\": \"BALANCE_0003\", \"totalValue\": 500, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}]}], \"rarityParameterModels\": [{\"name\": \"rarity-0001\", \"metadata\": \"RARITY_0001\", \"maximumParameterCount\": 5, \"parameterCounts\": [{\"count\": 0, \"weight\": 1}, {\"count\": 1, \"weight\": 2}, {\"count\": 2, \"weight\": 3}], \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\", \"resourceName\": \"resource-0001\", \"resourceValue\": 10, \"weight\": 1}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\", \"resourceName\": \"resource-0002\", \"resourceValue\": 20, \"weight\": 2}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\", \"resourceName\": \"resource-0003\", \"resourceValue\": 30, \"weight\": 3}]}, {\"name\": \"rarity-0002\", \"metadata\": \"RARITY_0002\", \"maximumParameterCount\": 10, \"parameterCounts\": [{\"count\": 1, \"weight\": 10}, {\"count\": 2, \"weight\": 20}, {\"count\": 3, \"weight\": 30}], \"parameters\": [{\"name\": \"parameter-1001\", \"metadata\": \"PARAMETER_1001\", \"resourceName\": \"resource-1001\", \"resourceValue\": 100, \"weight\": 10}, {\"name\": \"parameter-1002\", \"metadata\": \"PARAMETER_1002\", \"resourceName\": \"resource-1002\", \"resourceValue\": 200, \"weight\": 20}, {\"name\": \"parameter-1003\", \"metadata\": \"PARAMETER_1003\", \"resourceName\": \"resource-1003\", \"resourceValue\": 300, \"weight\": 30}]}, {\"name\": \"rarity-0003\", \"metadata\": \"RARITY_0003\", \"maximumParameterCount\": 3, \"parameterCounts\": [{\"count\": 2, \"weight\": 5}, {\"count\": 3, \"weight\": 10}, {\"count\": 4, \"weight\": 15}], \"parameters\": [{\"name\": \"parameter-2001\", \"metadata\": \"PARAMETER_2001\", \"resourceName\": \"resource-2001\", \"resourceValue\": 1000, \"weight\": 2}, {\"name\": \"parameter-2002\", \"metadata\": \"PARAMETER_2002\", \"resourceName\": \"resource-2002\", \"resourceValue\": 2000, \"weight\": 4}, {\"name\": \"parameter-2003\", \"metadata\": \"PARAMETER_2003\", \"resourceName\": \"resource-2003\", \"resourceValue\": 3000, \"weight\": 6}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\", \"resourceName\": \"resource-2004\", \"resourceValue\": 4000, \"weight\": 8}]}]}")
        .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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.updateCurrentParameterMaster(
        new Gs2Enchant.UpdateCurrentParameterMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2023-07-18\", \"balanceParameterModels\": [{\"name\": \"balance-0001\", \"metadata\": \"BALANCE_0001\", \"totalValue\": 100, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}]}, {\"name\": \"balance-0002\", \"metadata\": \"BALANCE_0002\", \"totalValue\": 200, \"initialValueStrategy\": \"lottery\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\"}]}, {\"name\": \"balance-0003\", \"metadata\": \"BALANCE_0003\", \"totalValue\": 500, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}]}], \"rarityParameterModels\": [{\"name\": \"rarity-0001\", \"metadata\": \"RARITY_0001\", \"maximumParameterCount\": 5, \"parameterCounts\": [{\"count\": 0, \"weight\": 1}, {\"count\": 1, \"weight\": 2}, {\"count\": 2, \"weight\": 3}], \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\", \"resourceName\": \"resource-0001\", \"resourceValue\": 10, \"weight\": 1}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\", \"resourceName\": \"resource-0002\", \"resourceValue\": 20, \"weight\": 2}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\", \"resourceName\": \"resource-0003\", \"resourceValue\": 30, \"weight\": 3}]}, {\"name\": \"rarity-0002\", \"metadata\": \"RARITY_0002\", \"maximumParameterCount\": 10, \"parameterCounts\": [{\"count\": 1, \"weight\": 10}, {\"count\": 2, \"weight\": 20}, {\"count\": 3, \"weight\": 30}], \"parameters\": [{\"name\": \"parameter-1001\", \"metadata\": \"PARAMETER_1001\", \"resourceName\": \"resource-1001\", \"resourceValue\": 100, \"weight\": 10}, {\"name\": \"parameter-1002\", \"metadata\": \"PARAMETER_1002\", \"resourceName\": \"resource-1002\", \"resourceValue\": 200, \"weight\": 20}, {\"name\": \"parameter-1003\", \"metadata\": \"PARAMETER_1003\", \"resourceName\": \"resource-1003\", \"resourceValue\": 300, \"weight\": 30}]}, {\"name\": \"rarity-0003\", \"metadata\": \"RARITY_0003\", \"maximumParameterCount\": 3, \"parameterCounts\": [{\"count\": 2, \"weight\": 5}, {\"count\": 3, \"weight\": 10}, {\"count\": 4, \"weight\": 15}], \"parameters\": [{\"name\": \"parameter-2001\", \"metadata\": \"PARAMETER_2001\", \"resourceName\": \"resource-2001\", \"resourceValue\": 1000, \"weight\": 2}, {\"name\": \"parameter-2002\", \"metadata\": \"PARAMETER_2002\", \"resourceName\": \"resource-2002\", \"resourceValue\": 2000, \"weight\": 4}, {\"name\": \"parameter-2003\", \"metadata\": \"PARAMETER_2003\", \"resourceName\": \"resource-2003\", \"resourceValue\": 3000, \"weight\": 6}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\", \"resourceName\": \"resource-2004\", \"resourceValue\": 4000, \"weight\": 8}]}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.update_current_parameter_master(
        enchant.UpdateCurrentParameterMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2023-07-18", "balanceParameterModels": [{"name": "balance-0001", "metadata": "BALANCE_0001", "totalValue": 100, "initialValueStrategy": "average", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}, {"name": "parameter-0003", "metadata": "PARAMETER_0003"}]}, {"name": "balance-0002", "metadata": "BALANCE_0002", "totalValue": 200, "initialValueStrategy": "lottery", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}, {"name": "parameter-0003", "metadata": "PARAMETER_0003"}, {"name": "parameter-0004", "metadata": "PARAMETER_0004"}]}, {"name": "balance-0003", "metadata": "BALANCE_0003", "totalValue": 500, "initialValueStrategy": "average", "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001"}, {"name": "parameter-0002", "metadata": "PARAMETER_0002"}]}], "rarityParameterModels": [{"name": "rarity-0001", "metadata": "RARITY_0001", "maximumParameterCount": 5, "parameterCounts": [{"count": 0, "weight": 1}, {"count": 1, "weight": 2}, {"count": 2, "weight": 3}], "parameters": [{"name": "parameter-0001", "metadata": "PARAMETER_0001", "resourceName": "resource-0001", "resourceValue": 10, "weight": 1}, {"name": "parameter-0002", "metadata": "PARAMETER_0002", "resourceName": "resource-0002", "resourceValue": 20, "weight": 2}, {"name": "parameter-0003", "metadata": "PARAMETER_0003", "resourceName": "resource-0003", "resourceValue": 30, "weight": 3}]}, {"name": "rarity-0002", "metadata": "RARITY_0002", "maximumParameterCount": 10, "parameterCounts": [{"count": 1, "weight": 10}, {"count": 2, "weight": 20}, {"count": 3, "weight": 30}], "parameters": [{"name": "parameter-1001", "metadata": "PARAMETER_1001", "resourceName": "resource-1001", "resourceValue": 100, "weight": 10}, {"name": "parameter-1002", "metadata": "PARAMETER_1002", "resourceName": "resource-1002", "resourceValue": 200, "weight": 20}, {"name": "parameter-1003", "metadata": "PARAMETER_1003", "resourceName": "resource-1003", "resourceValue": 300, "weight": 30}]}, {"name": "rarity-0003", "metadata": "RARITY_0003", "maximumParameterCount": 3, "parameterCounts": [{"count": 2, "weight": 5}, {"count": 3, "weight": 10}, {"count": 4, "weight": 15}], "parameters": [{"name": "parameter-2001", "metadata": "PARAMETER_2001", "resourceName": "resource-2001", "resourceValue": 1000, "weight": 2}, {"name": "parameter-2002", "metadata": "PARAMETER_2002", "resourceName": "resource-2002", "resourceValue": 2000, "weight": 4}, {"name": "parameter-2003", "metadata": "PARAMETER_2003", "resourceName": "resource-2003", "resourceValue": 3000, "weight": 6}, {"name": "parameter-0004", "metadata": "PARAMETER_0004", "resourceName": "resource-2004", "resourceValue": 4000, "weight": 8}]}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.update_current_parameter_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2023-07-18\", \"balanceParameterModels\": [{\"name\": \"balance-0001\", \"metadata\": \"BALANCE_0001\", \"totalValue\": 100, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}]}, {\"name\": \"balance-0002\", \"metadata\": \"BALANCE_0002\", \"totalValue\": 200, \"initialValueStrategy\": \"lottery\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\"}]}, {\"name\": \"balance-0003\", \"metadata\": \"BALANCE_0003\", \"totalValue\": 500, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}]}], \"rarityParameterModels\": [{\"name\": \"rarity-0001\", \"metadata\": \"RARITY_0001\", \"maximumParameterCount\": 5, \"parameterCounts\": [{\"count\": 0, \"weight\": 1}, {\"count\": 1, \"weight\": 2}, {\"count\": 2, \"weight\": 3}], \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\", \"resourceName\": \"resource-0001\", \"resourceValue\": 10, \"weight\": 1}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\", \"resourceName\": \"resource-0002\", \"resourceValue\": 20, \"weight\": 2}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\", \"resourceName\": \"resource-0003\", \"resourceValue\": 30, \"weight\": 3}]}, {\"name\": \"rarity-0002\", \"metadata\": \"RARITY_0002\", \"maximumParameterCount\": 10, \"parameterCounts\": [{\"count\": 1, \"weight\": 10}, {\"count\": 2, \"weight\": 20}, {\"count\": 3, \"weight\": 30}], \"parameters\": [{\"name\": \"parameter-1001\", \"metadata\": \"PARAMETER_1001\", \"resourceName\": \"resource-1001\", \"resourceValue\": 100, \"weight\": 10}, {\"name\": \"parameter-1002\", \"metadata\": \"PARAMETER_1002\", \"resourceName\": \"resource-1002\", \"resourceValue\": 200, \"weight\": 20}, {\"name\": \"parameter-1003\", \"metadata\": \"PARAMETER_1003\", \"resourceName\": \"resource-1003\", \"resourceValue\": 300, \"weight\": 30}]}, {\"name\": \"rarity-0003\", \"metadata\": \"RARITY_0003\", \"maximumParameterCount\": 3, \"parameterCounts\": [{\"count\": 2, \"weight\": 5}, {\"count\": 3, \"weight\": 10}, {\"count\": 4, \"weight\": 15}], \"parameters\": [{\"name\": \"parameter-2001\", \"metadata\": \"PARAMETER_2001\", \"resourceName\": \"resource-2001\", \"resourceValue\": 1000, \"weight\": 2}, {\"name\": \"parameter-2002\", \"metadata\": \"PARAMETER_2002\", \"resourceName\": \"resource-2002\", \"resourceValue\": 2000, \"weight\": 4}, {\"name\": \"parameter-2003\", \"metadata\": \"PARAMETER_2003\", \"resourceName\": \"resource-2003\", \"resourceValue\": 3000, \"weight\": 6}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\", \"resourceName\": \"resource-2004\", \"resourceValue\": 4000, \"weight\": 8}]}]}",
    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('enchant')

api_result_handler = client.update_current_parameter_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2023-07-18\", \"balanceParameterModels\": [{\"name\": \"balance-0001\", \"metadata\": \"BALANCE_0001\", \"totalValue\": 100, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}]}, {\"name\": \"balance-0002\", \"metadata\": \"BALANCE_0002\", \"totalValue\": 200, \"initialValueStrategy\": \"lottery\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\"}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\"}]}, {\"name\": \"balance-0003\", \"metadata\": \"BALANCE_0003\", \"totalValue\": 500, \"initialValueStrategy\": \"average\", \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\"}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\"}]}], \"rarityParameterModels\": [{\"name\": \"rarity-0001\", \"metadata\": \"RARITY_0001\", \"maximumParameterCount\": 5, \"parameterCounts\": [{\"count\": 0, \"weight\": 1}, {\"count\": 1, \"weight\": 2}, {\"count\": 2, \"weight\": 3}], \"parameters\": [{\"name\": \"parameter-0001\", \"metadata\": \"PARAMETER_0001\", \"resourceName\": \"resource-0001\", \"resourceValue\": 10, \"weight\": 1}, {\"name\": \"parameter-0002\", \"metadata\": \"PARAMETER_0002\", \"resourceName\": \"resource-0002\", \"resourceValue\": 20, \"weight\": 2}, {\"name\": \"parameter-0003\", \"metadata\": \"PARAMETER_0003\", \"resourceName\": \"resource-0003\", \"resourceValue\": 30, \"weight\": 3}]}, {\"name\": \"rarity-0002\", \"metadata\": \"RARITY_0002\", \"maximumParameterCount\": 10, \"parameterCounts\": [{\"count\": 1, \"weight\": 10}, {\"count\": 2, \"weight\": 20}, {\"count\": 3, \"weight\": 30}], \"parameters\": [{\"name\": \"parameter-1001\", \"metadata\": \"PARAMETER_1001\", \"resourceName\": \"resource-1001\", \"resourceValue\": 100, \"weight\": 10}, {\"name\": \"parameter-1002\", \"metadata\": \"PARAMETER_1002\", \"resourceName\": \"resource-1002\", \"resourceValue\": 200, \"weight\": 20}, {\"name\": \"parameter-1003\", \"metadata\": \"PARAMETER_1003\", \"resourceName\": \"resource-1003\", \"resourceValue\": 300, \"weight\": 30}]}, {\"name\": \"rarity-0003\", \"metadata\": \"RARITY_0003\", \"maximumParameterCount\": 3, \"parameterCounts\": [{\"count\": 2, \"weight\": 5}, {\"count\": 3, \"weight\": 10}, {\"count\": 4, \"weight\": 15}], \"parameters\": [{\"name\": \"parameter-2001\", \"metadata\": \"PARAMETER_2001\", \"resourceName\": \"resource-2001\", \"resourceValue\": 1000, \"weight\": 2}, {\"name\": \"parameter-2002\", \"metadata\": \"PARAMETER_2002\", \"resourceName\": \"resource-2002\", \"resourceValue\": 2000, \"weight\": 4}, {\"name\": \"parameter-2003\", \"metadata\": \"PARAMETER_2003\", \"resourceName\": \"resource-2003\", \"resourceValue\": 3000, \"weight\": 6}, {\"name\": \"parameter-0004\", \"metadata\": \"PARAMETER_0004\", \"resourceName\": \"resource-2004\", \"resourceValue\": 4000, \"weight\": 8}]}]}",
    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;

updateCurrentParameterMasterFromGitHub

Updates currently active Parameter Model master data 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

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSetting GitHubCheckoutSetting
Setting for checking out master data from GitHub

Result

Type Description
item CurrentParameterMaster Updated master data of the currently active Parameter Models

Implementation Example

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

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->updateCurrentParameterMasterFromGitHub(
        (new UpdateCurrentParameterMasterFromGitHubRequest())
            ->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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.UpdateCurrentParameterMasterFromGitHubRequest;
import io.gs2.enchant.result.UpdateCurrentParameterMasterFromGitHubResult;

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

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

AsyncResult<Gs2.Gs2Enchant.Result.UpdateCurrentParameterMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentParameterMasterFromGitHub(
    new Gs2.Gs2Enchant.Request.UpdateCurrentParameterMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Enchant.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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.updateCurrentParameterMasterFromGitHub(
        new Gs2Enchant.UpdateCurrentParameterMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Enchant.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 enchant

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

try:
    result = client.update_current_parameter_master_from_git_hub(
        enchant.UpdateCurrentParameterMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(enchant.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('enchant')

api_result = client.update_current_parameter_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('enchant')

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

describeBalanceParameterModelMasters

Get a list of Balance Parameter Model Master

Retrieves a paginated list of editable Balance Parameter Model Masters with optional name prefix filtering. Balance Parameter Model Masters are the editable definitions for balance parameter sets. Changes to masters do not take effect until the master data is activated via the CurrentParameterMaster API.

Details

Request

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

Result

Type Description
items List<BalanceParameterModelMaster> List of Balance Parameter Model Master Data
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeBalanceParameterModelMasters(
    &enchant.DescribeBalanceParameterModelMastersRequest {
        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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeBalanceParameterModelMastersRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeBalanceParameterModelMasters(
        (new DescribeBalanceParameterModelMastersRequest())
            ->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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeBalanceParameterModelMastersRequest;
import io.gs2.enchant.result.DescribeBalanceParameterModelMastersResult;

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

try {
    DescribeBalanceParameterModelMastersResult result = client.describeBalanceParameterModelMasters(
        new DescribeBalanceParameterModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<BalanceParameterModelMaster> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeBalanceParameterModelMastersResult> asyncResult = null;
yield return client.DescribeBalanceParameterModelMasters(
    new Gs2.Gs2Enchant.Request.DescribeBalanceParameterModelMastersRequest()
        .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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeBalanceParameterModelMasters(
        new Gs2Enchant.DescribeBalanceParameterModelMastersRequest()
            .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 enchant

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

try:
    result = client.describe_balance_parameter_model_masters(
        enchant.DescribeBalanceParameterModelMastersRequest()
            .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('enchant')

api_result = client.describe_balance_parameter_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('enchant')

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

createBalanceParameterModelMaster

Create a new Balance Parameter Model Master

Creates a new editable Balance Parameter Model Master definition. The total value specifies the sum that is distributed among the parameters, and the initial value strategy determines how values are initially assigned. The parameters define the individual parameter slots with their value ranges. Changes do not take effect until the master data is activated via the CurrentParameterMaster API.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Balance Parameter Model name
Balance Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
description string ~ 1024 chars Description
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
totalValue long
0 ~ 9223372036854775805 Total value
The fixed total that is distributed across all parameter slots. When parameters are drawn, the individual values will always sum to this total regardless of the allocation strategy used.
initialValueStrategy string (enum)
enum {
  “average”,
  “lottery”
}
“average” Initial value setting policy
Determines how the total value is distributed across parameter slots when first assigned. average divides the total evenly among all parameters, while lottery randomly distributes the total to create varied parameter combinations.
DefinitionDescription
“average”Average
“lottery”Lottery
parameters List<BalanceParameterValueModel>
1 ~ 10 items Balance parameter value model list
Defines the parameter slots available for this balance parameter. Each entry specifies a named parameter slot (e.g., ATK, DEF, SPD) with optional metadata. The total value is distributed across these slots.

Result

Type Description
item BalanceParameterModelMaster Balance Parameter Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.CreateBalanceParameterModelMaster(
    &enchant.CreateBalanceParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("balance-0001"),
        Description: nil,
        Metadata: nil,
        TotalValue: pointy.Int64(100),
        InitialValueStrategy: pointy.String("average"),
        Parameters: []enchant.BalanceParameterValueModel{
            enchant.BalanceParameterValueModel{
                Name: pointy.String("parameter-0001"),
            },
            enchant.BalanceParameterValueModel{
                Name: pointy.String("parameter-0002"),
            },
            enchant.BalanceParameterValueModel{
                Name: pointy.String("parameter-0003"),
            },
        },
    }
)
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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\CreateBalanceParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->createBalanceParameterModelMaster(
        (new CreateBalanceParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("balance-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withTotalValue(100)
            ->withInitialValueStrategy("average")
            ->withParameters([
                (new \Gs2\Enchant\Model\BalanceParameterValueModel())
                    ->withName("parameter-0001"),
                (new \Gs2\Enchant\Model\BalanceParameterValueModel())
                    ->withName("parameter-0002"),
                (new \Gs2\Enchant\Model\BalanceParameterValueModel())
                    ->withName("parameter-0003"),
            ])
    );
    $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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.CreateBalanceParameterModelMasterRequest;
import io.gs2.enchant.result.CreateBalanceParameterModelMasterResult;

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

try {
    CreateBalanceParameterModelMasterResult result = client.createBalanceParameterModelMaster(
        new CreateBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("balance-0001")
            .withDescription(null)
            .withMetadata(null)
            .withTotalValue(100L)
            .withInitialValueStrategy("average")
            .withParameters(Arrays.asList(
                new io.gs2.enchant.model.BalanceParameterValueModel()
                    .withName("parameter-0001"),
                new io.gs2.enchant.model.BalanceParameterValueModel()
                    .withName("parameter-0002"),
                new io.gs2.enchant.model.BalanceParameterValueModel()
                    .withName("parameter-0003")
            ))
    );
    BalanceParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.CreateBalanceParameterModelMasterResult> asyncResult = null;
yield return client.CreateBalanceParameterModelMaster(
    new Gs2.Gs2Enchant.Request.CreateBalanceParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("balance-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithTotalValue(100L)
        .WithInitialValueStrategy("average")
        .WithParameters(new Gs2.Gs2Enchant.Model.BalanceParameterValueModel[] {
            new Gs2.Gs2Enchant.Model.BalanceParameterValueModel()
                .WithName("parameter-0001"),
            new Gs2.Gs2Enchant.Model.BalanceParameterValueModel()
                .WithName("parameter-0002"),
            new Gs2.Gs2Enchant.Model.BalanceParameterValueModel()
                .WithName("parameter-0003"),
        }),
    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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.createBalanceParameterModelMaster(
        new Gs2Enchant.CreateBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("balance-0001")
            .withDescription(null)
            .withMetadata(null)
            .withTotalValue(100)
            .withInitialValueStrategy("average")
            .withParameters([
                new Gs2Enchant.model.BalanceParameterValueModel()
                    .withName("parameter-0001"),
                new Gs2Enchant.model.BalanceParameterValueModel()
                    .withName("parameter-0002"),
                new Gs2Enchant.model.BalanceParameterValueModel()
                    .withName("parameter-0003"),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.create_balance_parameter_model_master(
        enchant.CreateBalanceParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('balance-0001')
            .with_description(None)
            .with_metadata(None)
            .with_total_value(100)
            .with_initial_value_strategy('average')
            .with_parameters([
                enchant.BalanceParameterValueModel()
                    .with_name('parameter-0001'),
                enchant.BalanceParameterValueModel()
                    .with_name('parameter-0002'),
                enchant.BalanceParameterValueModel()
                    .with_name('parameter-0003'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.create_balance_parameter_model_master({
    namespaceName="namespace-0001",
    name="balance-0001",
    description=nil,
    metadata=nil,
    totalValue=100,
    initialValueStrategy="average",
    parameters={
        {
            name="parameter-0001",
        },
        {
            name="parameter-0002",
        },
        {
            name="parameter-0003",
        }
    },
})

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

api_result_handler = client.create_balance_parameter_model_master_async({
    namespaceName="namespace-0001",
    name="balance-0001",
    description=nil,
    metadata=nil,
    totalValue=100,
    initialValueStrategy="average",
    parameters={
        {
            name="parameter-0001",
        },
        {
            name="parameter-0002",
        },
        {
            name="parameter-0003",
        }
    },
})

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;

getBalanceParameterModelMaster

Get Balance Parameter Model Master Data

Retrieves the detailed information of a specific editable Balance Parameter Model Master by name. This is used for viewing and editing the master definition before activation.

Details

Request

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

Result

Type Description
item BalanceParameterModelMaster Balance Parameter Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetBalanceParameterModelMaster(
    &enchant.GetBalanceParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("balance-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetBalanceParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getBalanceParameterModelMaster(
        (new GetBalanceParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("balance-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetBalanceParameterModelMasterRequest;
import io.gs2.enchant.result.GetBalanceParameterModelMasterResult;

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

try {
    GetBalanceParameterModelMasterResult result = client.getBalanceParameterModelMaster(
        new GetBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
    );
    BalanceParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetBalanceParameterModelMasterResult> asyncResult = null;
yield return client.GetBalanceParameterModelMaster(
    new Gs2.Gs2Enchant.Request.GetBalanceParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("balance-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getBalanceParameterModelMaster(
        new Gs2Enchant.GetBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_balance_parameter_model_master(
        enchant.GetBalanceParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('balance-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_balance_parameter_model_master({
    namespaceName="namespace-0001",
    parameterName="balance-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('enchant')

api_result_handler = client.get_balance_parameter_model_master_async({
    namespaceName="namespace-0001",
    parameterName="balance-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;

updateBalanceParameterModelMaster

Update Balance Parameter Model Master Data

Updates the description, metadata, total value, initial value strategy, and parameters of an existing Balance Parameter Model Master. The parameter model name cannot be changed after creation. Changes do not take effect until the master data is re-activated via the CurrentParameterMaster API.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
parameterName string
~ 128 chars Balance Parameter Model name
Balance Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
description string ~ 1024 chars Description
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
totalValue long
0 ~ 9223372036854775805 Total value
The fixed total that is distributed across all parameter slots. When parameters are drawn, the individual values will always sum to this total regardless of the allocation strategy used.
initialValueStrategy string (enum)
enum {
  “average”,
  “lottery”
}
“average” Initial value setting policy
Determines how the total value is distributed across parameter slots when first assigned. average divides the total evenly among all parameters, while lottery randomly distributes the total to create varied parameter combinations.
DefinitionDescription
“average”Average
“lottery”Lottery
parameters List<BalanceParameterValueModel>
1 ~ 10 items Balance parameter value model list
Defines the parameter slots available for this balance parameter. Each entry specifies a named parameter slot (e.g., ATK, DEF, SPD) with optional metadata. The total value is distributed across these slots.

Result

Type Description
item BalanceParameterModelMaster Balance Parameter Model Master Data updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.UpdateBalanceParameterModelMaster(
    &enchant.UpdateBalanceParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("balance-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("BALANCE_0001"),
        TotalValue: pointy.Int64(200),
        InitialValueStrategy: pointy.String("lottery"),
        Parameters: []enchant.BalanceParameterValueModel{
            enchant.BalanceParameterValueModel{
                Name: pointy.String("parameter-1001"),
            },
            enchant.BalanceParameterValueModel{
                Name: pointy.String("parameter-1002"),
            },
            enchant.BalanceParameterValueModel{
                Name: pointy.String("parameter-1003"),
            },
            enchant.BalanceParameterValueModel{
                Name: pointy.String("parameter-1004"),
            },
        },
    }
)
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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\UpdateBalanceParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->updateBalanceParameterModelMaster(
        (new UpdateBalanceParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("balance-0001")
            ->withDescription("description1")
            ->withMetadata("BALANCE_0001")
            ->withTotalValue(200)
            ->withInitialValueStrategy("lottery")
            ->withParameters([
                (new \Gs2\Enchant\Model\BalanceParameterValueModel())
                    ->withName("parameter-1001"),
                (new \Gs2\Enchant\Model\BalanceParameterValueModel())
                    ->withName("parameter-1002"),
                (new \Gs2\Enchant\Model\BalanceParameterValueModel())
                    ->withName("parameter-1003"),
                (new \Gs2\Enchant\Model\BalanceParameterValueModel())
                    ->withName("parameter-1004"),
            ])
    );
    $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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.UpdateBalanceParameterModelMasterRequest;
import io.gs2.enchant.result.UpdateBalanceParameterModelMasterResult;

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

try {
    UpdateBalanceParameterModelMasterResult result = client.updateBalanceParameterModelMaster(
        new UpdateBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
            .withDescription("description1")
            .withMetadata("BALANCE_0001")
            .withTotalValue(200L)
            .withInitialValueStrategy("lottery")
            .withParameters(Arrays.asList(
                new io.gs2.enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1001"),
                new io.gs2.enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1002"),
                new io.gs2.enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1003"),
                new io.gs2.enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1004")
            ))
    );
    BalanceParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.UpdateBalanceParameterModelMasterResult> asyncResult = null;
yield return client.UpdateBalanceParameterModelMaster(
    new Gs2.Gs2Enchant.Request.UpdateBalanceParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("balance-0001")
        .WithDescription("description1")
        .WithMetadata("BALANCE_0001")
        .WithTotalValue(200L)
        .WithInitialValueStrategy("lottery")
        .WithParameters(new Gs2.Gs2Enchant.Model.BalanceParameterValueModel[] {
            new Gs2.Gs2Enchant.Model.BalanceParameterValueModel()
                .WithName("parameter-1001"),
            new Gs2.Gs2Enchant.Model.BalanceParameterValueModel()
                .WithName("parameter-1002"),
            new Gs2.Gs2Enchant.Model.BalanceParameterValueModel()
                .WithName("parameter-1003"),
            new Gs2.Gs2Enchant.Model.BalanceParameterValueModel()
                .WithName("parameter-1004"),
        }),
    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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.updateBalanceParameterModelMaster(
        new Gs2Enchant.UpdateBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
            .withDescription("description1")
            .withMetadata("BALANCE_0001")
            .withTotalValue(200)
            .withInitialValueStrategy("lottery")
            .withParameters([
                new Gs2Enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1001"),
                new Gs2Enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1002"),
                new Gs2Enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1003"),
                new Gs2Enchant.model.BalanceParameterValueModel()
                    .withName("parameter-1004"),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.update_balance_parameter_model_master(
        enchant.UpdateBalanceParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('balance-0001')
            .with_description('description1')
            .with_metadata('BALANCE_0001')
            .with_total_value(200)
            .with_initial_value_strategy('lottery')
            .with_parameters([
                enchant.BalanceParameterValueModel()
                    .with_name('parameter-1001'),
                enchant.BalanceParameterValueModel()
                    .with_name('parameter-1002'),
                enchant.BalanceParameterValueModel()
                    .with_name('parameter-1003'),
                enchant.BalanceParameterValueModel()
                    .with_name('parameter-1004'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.update_balance_parameter_model_master({
    namespaceName="namespace-0001",
    parameterName="balance-0001",
    description="description1",
    metadata="BALANCE_0001",
    totalValue=200,
    initialValueStrategy="lottery",
    parameters={
        {
            name="parameter-1001",
        },
        {
            name="parameter-1002",
        },
        {
            name="parameter-1003",
        },
        {
            name="parameter-1004",
        }
    },
})

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

api_result_handler = client.update_balance_parameter_model_master_async({
    namespaceName="namespace-0001",
    parameterName="balance-0001",
    description="description1",
    metadata="BALANCE_0001",
    totalValue=200,
    initialValueStrategy="lottery",
    parameters={
        {
            name="parameter-1001",
        },
        {
            name="parameter-1002",
        },
        {
            name="parameter-1003",
        },
        {
            name="parameter-1004",
        }
    },
})

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;

deleteBalanceParameterModelMaster

Delete Balance Parameter Model Master Data

Deletes an editable Balance Parameter Model Master definition. This only affects the master data; the currently active (published) model is not affected until the master data is re-activated. Existing user parameter statuses associated with the deleted model are not automatically removed.

Details

Request

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

Result

Type Description
item BalanceParameterModelMaster Balance Parameter Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DeleteBalanceParameterModelMaster(
    &enchant.DeleteBalanceParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("balance-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DeleteBalanceParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->deleteBalanceParameterModelMaster(
        (new DeleteBalanceParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("balance-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DeleteBalanceParameterModelMasterRequest;
import io.gs2.enchant.result.DeleteBalanceParameterModelMasterResult;

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

try {
    DeleteBalanceParameterModelMasterResult result = client.deleteBalanceParameterModelMaster(
        new DeleteBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
    );
    BalanceParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DeleteBalanceParameterModelMasterResult> asyncResult = null;
yield return client.DeleteBalanceParameterModelMaster(
    new Gs2.Gs2Enchant.Request.DeleteBalanceParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("balance-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.deleteBalanceParameterModelMaster(
        new Gs2Enchant.DeleteBalanceParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("balance-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.delete_balance_parameter_model_master(
        enchant.DeleteBalanceParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('balance-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.delete_balance_parameter_model_master({
    namespaceName="namespace-0001",
    parameterName="balance-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('enchant')

api_result_handler = client.delete_balance_parameter_model_master_async({
    namespaceName="namespace-0001",
    parameterName="balance-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;

describeRarityParameterModelMasters

Get a list of Rarity Parameter Model Masters

Retrieves a paginated list of editable Rarity Parameter Model Masters. Rarity Parameter Model Masters are the editable definitions for rarity-based parameter sets. Changes to masters do not take effect until the master data is activated via the CurrentParameterMaster API.

Details

Request

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

Result

Type Description
items List<RarityParameterModelMaster> List of Rarity Parameter Model Masters
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DescribeRarityParameterModelMasters(
    &enchant.DescribeRarityParameterModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DescribeRarityParameterModelMastersRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->describeRarityParameterModelMasters(
        (new DescribeRarityParameterModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DescribeRarityParameterModelMastersRequest;
import io.gs2.enchant.result.DescribeRarityParameterModelMastersResult;

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

try {
    DescribeRarityParameterModelMastersResult result = client.describeRarityParameterModelMasters(
        new DescribeRarityParameterModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<RarityParameterModelMaster> 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DescribeRarityParameterModelMastersResult> asyncResult = null;
yield return client.DescribeRarityParameterModelMasters(
    new Gs2.Gs2Enchant.Request.DescribeRarityParameterModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.describeRarityParameterModelMasters(
        new Gs2Enchant.DescribeRarityParameterModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.describe_rarity_parameter_model_masters(
        enchant.DescribeRarityParameterModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

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

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

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

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

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

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

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

createRarityParameterModelMaster

Create a new Rarity Parameter Model Master

Creates a new editable Rarity Parameter Model Master definition. The maximum parameter count specifies the upper limit of parameter slots, and parameter counts define the probability distribution for how many slots are filled. The parameters define the possible values with their rarity-based draw weights. Changes do not take effect until the master data is activated via the CurrentParameterMaster API.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Rarity Parameter Model name
Rarity Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
description string ~ 1024 chars Description
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
maximumParameterCount int
1 ~ 10 Maximum number of parameters to be given
The upper limit on the number of parameter slots that can be granted to a resource. The actual number granted is determined by a weighted draw from the parameter count model list, but will never exceed this value.
parameterCounts List<RarityParameterCountModel>
1 ~ 10 items Rarity parameter count model list
Defines the weighted lottery entries for determining how many parameter slots are granted. Each entry specifies a count and a draw weight. Higher weights increase the probability of that count being selected.
parameters List<RarityParameterValueModel>
1 ~ 1000 items Rarity parameter value model list
Defines the pool of possible parameter values that can be drawn. Each entry specifies a parameter name, resource details, and a draw weight. When filling parameter slots, values are selected from this pool via weighted lottery without replacement.

Result

Type Description
item RarityParameterModelMaster Rarity Parameter Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.CreateRarityParameterModelMaster(
    &enchant.CreateRarityParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("rarity-0001"),
        Description: nil,
        Metadata: nil,
        MaximumParameterCount: pointy.Int32(5),
        ParameterCounts: []enchant.RarityParameterCountModel{
            enchant.RarityParameterCountModel{
                Count: pointy.Int32(0),
                Weight: pointy.Int32(1),
            },
            enchant.RarityParameterCountModel{
                Count: pointy.Int32(1),
                Weight: pointy.Int32(2),
            },
            enchant.RarityParameterCountModel{
                Count: pointy.Int32(2),
                Weight: pointy.Int32(3),
            },
        },
        Parameters: []enchant.RarityParameterValueModel{
            enchant.RarityParameterValueModel{
                Name: pointy.String("parameter-0001"),
                ResourceName: pointy.String("resource-0001"),
                ResourceValue: pointy.Int64(100),
                Weight: pointy.Int32(1),
            },
            enchant.RarityParameterValueModel{
                Name: pointy.String("parameter-0002"),
                ResourceName: pointy.String("resource-0002"),
                ResourceValue: pointy.Int64(200),
                Weight: pointy.Int32(2),
            },
            enchant.RarityParameterValueModel{
                Name: pointy.String("parameter-0003"),
                ResourceName: pointy.String("resource-0003"),
                ResourceValue: pointy.Int64(300),
                Weight: pointy.Int32(3),
            },
        },
    }
)
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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\CreateRarityParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->createRarityParameterModelMaster(
        (new CreateRarityParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("rarity-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMaximumParameterCount(5)
            ->withParameterCounts([
                (new \Gs2\Enchant\Model\RarityParameterCountModel())
                    ->withCount(0)
                    ->withWeight(1),
                (new \Gs2\Enchant\Model\RarityParameterCountModel())
                    ->withCount(1)
                    ->withWeight(2),
                (new \Gs2\Enchant\Model\RarityParameterCountModel())
                    ->withCount(2)
                    ->withWeight(3),
            ])
            ->withParameters([
                (new \Gs2\Enchant\Model\RarityParameterValueModel())
                    ->withName("parameter-0001")
                    ->withResourceName("resource-0001")
                    ->withResourceValue(100)
                    ->withWeight(1),
                (new \Gs2\Enchant\Model\RarityParameterValueModel())
                    ->withName("parameter-0002")
                    ->withResourceName("resource-0002")
                    ->withResourceValue(200)
                    ->withWeight(2),
                (new \Gs2\Enchant\Model\RarityParameterValueModel())
                    ->withName("parameter-0003")
                    ->withResourceName("resource-0003")
                    ->withResourceValue(300)
                    ->withWeight(3),
            ])
    );
    $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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.CreateRarityParameterModelMasterRequest;
import io.gs2.enchant.result.CreateRarityParameterModelMasterResult;

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

try {
    CreateRarityParameterModelMasterResult result = client.createRarityParameterModelMaster(
        new CreateRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("rarity-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumParameterCount(5)
            .withParameterCounts(Arrays.asList(
                new io.gs2.enchant.model.RarityParameterCountModel()
                    .withCount(0)
                    .withWeight(1),
                new io.gs2.enchant.model.RarityParameterCountModel()
                    .withCount(1)
                    .withWeight(2),
                new io.gs2.enchant.model.RarityParameterCountModel()
                    .withCount(2)
                    .withWeight(3)
            ))
            .withParameters(Arrays.asList(
                new io.gs2.enchant.model.RarityParameterValueModel()
                    .withName("parameter-0001")
                    .withResourceName("resource-0001")
                    .withResourceValue(100L)
                    .withWeight(1),
                new io.gs2.enchant.model.RarityParameterValueModel()
                    .withName("parameter-0002")
                    .withResourceName("resource-0002")
                    .withResourceValue(200L)
                    .withWeight(2),
                new io.gs2.enchant.model.RarityParameterValueModel()
                    .withName("parameter-0003")
                    .withResourceName("resource-0003")
                    .withResourceValue(300L)
                    .withWeight(3)
            ))
    );
    RarityParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.CreateRarityParameterModelMasterResult> asyncResult = null;
yield return client.CreateRarityParameterModelMaster(
    new Gs2.Gs2Enchant.Request.CreateRarityParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("rarity-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMaximumParameterCount(5)
        .WithParameterCounts(new Gs2.Gs2Enchant.Model.RarityParameterCountModel[] {
            new Gs2.Gs2Enchant.Model.RarityParameterCountModel()
                .WithCount(0)
                .WithWeight(1),
            new Gs2.Gs2Enchant.Model.RarityParameterCountModel()
                .WithCount(1)
                .WithWeight(2),
            new Gs2.Gs2Enchant.Model.RarityParameterCountModel()
                .WithCount(2)
                .WithWeight(3),
        })
        .WithParameters(new Gs2.Gs2Enchant.Model.RarityParameterValueModel[] {
            new Gs2.Gs2Enchant.Model.RarityParameterValueModel()
                .WithName("parameter-0001")
                .WithResourceName("resource-0001")
                .WithResourceValue(100L)
                .WithWeight(1),
            new Gs2.Gs2Enchant.Model.RarityParameterValueModel()
                .WithName("parameter-0002")
                .WithResourceName("resource-0002")
                .WithResourceValue(200L)
                .WithWeight(2),
            new Gs2.Gs2Enchant.Model.RarityParameterValueModel()
                .WithName("parameter-0003")
                .WithResourceName("resource-0003")
                .WithResourceValue(300L)
                .WithWeight(3),
        }),
    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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.createRarityParameterModelMaster(
        new Gs2Enchant.CreateRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("rarity-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumParameterCount(5)
            .withParameterCounts([
                new Gs2Enchant.model.RarityParameterCountModel()
                    .withCount(0)
                    .withWeight(1),
                new Gs2Enchant.model.RarityParameterCountModel()
                    .withCount(1)
                    .withWeight(2),
                new Gs2Enchant.model.RarityParameterCountModel()
                    .withCount(2)
                    .withWeight(3),
            ])
            .withParameters([
                new Gs2Enchant.model.RarityParameterValueModel()
                    .withName("parameter-0001")
                    .withResourceName("resource-0001")
                    .withResourceValue(100)
                    .withWeight(1),
                new Gs2Enchant.model.RarityParameterValueModel()
                    .withName("parameter-0002")
                    .withResourceName("resource-0002")
                    .withResourceValue(200)
                    .withWeight(2),
                new Gs2Enchant.model.RarityParameterValueModel()
                    .withName("parameter-0003")
                    .withResourceName("resource-0003")
                    .withResourceValue(300)
                    .withWeight(3),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.create_rarity_parameter_model_master(
        enchant.CreateRarityParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('rarity-0001')
            .with_description(None)
            .with_metadata(None)
            .with_maximum_parameter_count(5)
            .with_parameter_counts([
                enchant.RarityParameterCountModel()
                    .with_count(0)
                    .with_weight(1),
                enchant.RarityParameterCountModel()
                    .with_count(1)
                    .with_weight(2),
                enchant.RarityParameterCountModel()
                    .with_count(2)
                    .with_weight(3),
            ])
            .with_parameters([
                enchant.RarityParameterValueModel()
                    .with_name('parameter-0001')
                    .with_resource_name('resource-0001')
                    .with_resource_value(100)
                    .with_weight(1),
                enchant.RarityParameterValueModel()
                    .with_name('parameter-0002')
                    .with_resource_name('resource-0002')
                    .with_resource_value(200)
                    .with_weight(2),
                enchant.RarityParameterValueModel()
                    .with_name('parameter-0003')
                    .with_resource_name('resource-0003')
                    .with_resource_value(300)
                    .with_weight(3),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.create_rarity_parameter_model_master({
    namespaceName="namespace-0001",
    name="rarity-0001",
    description=nil,
    metadata=nil,
    maximumParameterCount=5,
    parameterCounts={
        {
            count=0,
            weight=1,
        },
        {
            count=1,
            weight=2,
        },
        {
            count=2,
            weight=3,
        }
    },
    parameters={
        {
            name="parameter-0001",
            resourceName="resource-0001",
            resourceValue=100,
            weight=1,
        },
        {
            name="parameter-0002",
            resourceName="resource-0002",
            resourceValue=200,
            weight=2,
        },
        {
            name="parameter-0003",
            resourceName="resource-0003",
            resourceValue=300,
            weight=3,
        }
    },
})

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

api_result_handler = client.create_rarity_parameter_model_master_async({
    namespaceName="namespace-0001",
    name="rarity-0001",
    description=nil,
    metadata=nil,
    maximumParameterCount=5,
    parameterCounts={
        {
            count=0,
            weight=1,
        },
        {
            count=1,
            weight=2,
        },
        {
            count=2,
            weight=3,
        }
    },
    parameters={
        {
            name="parameter-0001",
            resourceName="resource-0001",
            resourceValue=100,
            weight=1,
        },
        {
            name="parameter-0002",
            resourceName="resource-0002",
            resourceValue=200,
            weight=2,
        },
        {
            name="parameter-0003",
            resourceName="resource-0003",
            resourceValue=300,
            weight=3,
        }
    },
})

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;

getRarityParameterModelMaster

Get Rarity Parameter Model Master

Retrieves the detailed information of a specific editable Rarity Parameter Model Master by name. This is used for viewing and editing the master definition before activation.

Details

Request

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

Result

Type Description
item RarityParameterModelMaster Rarity Parameter Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.GetRarityParameterModelMaster(
    &enchant.GetRarityParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("rarity-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\GetRarityParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->getRarityParameterModelMaster(
        (new GetRarityParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("rarity-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.GetRarityParameterModelMasterRequest;
import io.gs2.enchant.result.GetRarityParameterModelMasterResult;

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

try {
    GetRarityParameterModelMasterResult result = client.getRarityParameterModelMaster(
        new GetRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
    );
    RarityParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.GetRarityParameterModelMasterResult> asyncResult = null;
yield return client.GetRarityParameterModelMaster(
    new Gs2.Gs2Enchant.Request.GetRarityParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("rarity-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.getRarityParameterModelMaster(
        new Gs2Enchant.GetRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.get_rarity_parameter_model_master(
        enchant.GetRarityParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('rarity-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.get_rarity_parameter_model_master({
    namespaceName="namespace-0001",
    parameterName="rarity-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('enchant')

api_result_handler = client.get_rarity_parameter_model_master_async({
    namespaceName="namespace-0001",
    parameterName="rarity-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;

updateRarityParameterModelMaster

Update Rarity Parameter Model Master

Updates the description, metadata, maximum parameter count, parameter counts, and parameters of an existing Rarity Parameter Model Master. The parameter model name cannot be changed after creation. Changes do not take effect until the master data is re-activated via the CurrentParameterMaster API.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
parameterName string
~ 128 chars Rarity Parameter Model name
Rarity Parameter Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
description string ~ 1024 chars Description
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
maximumParameterCount int
1 ~ 10 Maximum number of parameters to be given
The upper limit on the number of parameter slots that can be granted to a resource. The actual number granted is determined by a weighted draw from the parameter count model list, but will never exceed this value.
parameterCounts List<RarityParameterCountModel>
1 ~ 10 items Rarity parameter count model list
Defines the weighted lottery entries for determining how many parameter slots are granted. Each entry specifies a count and a draw weight. Higher weights increase the probability of that count being selected.
parameters List<RarityParameterValueModel>
1 ~ 1000 items Rarity parameter value model list
Defines the pool of possible parameter values that can be drawn. Each entry specifies a parameter name, resource details, and a draw weight. When filling parameter slots, values are selected from this pool via weighted lottery without replacement.

Result

Type Description
item RarityParameterModelMaster Rarity Parameter Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.UpdateRarityParameterModelMaster(
    &enchant.UpdateRarityParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("rarity-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("RARITY_0001"),
        MaximumParameterCount: pointy.Int32(10),
        ParameterCounts: []enchant.RarityParameterCountModel{
            enchant.RarityParameterCountModel{
                Count: pointy.Int32(5),
                Weight: pointy.Int32(3),
            },
            enchant.RarityParameterCountModel{
                Count: pointy.Int32(10),
                Weight: pointy.Int32(5),
            },
            enchant.RarityParameterCountModel{
                Count: pointy.Int32(3),
                Weight: pointy.Int32(10),
            },
        },
        Parameters: []enchant.RarityParameterValueModel{
            enchant.RarityParameterValueModel{
                Name: pointy.String("parameter-1001"),
                ResourceName: pointy.String("resource-1001"),
                ResourceValue: pointy.Int64(10),
                Weight: pointy.Int32(10),
            },
            enchant.RarityParameterValueModel{
                Name: pointy.String("parameter-1002"),
                ResourceName: pointy.String("resource-1002"),
                ResourceValue: pointy.Int64(20),
                Weight: pointy.Int32(20),
            },
            enchant.RarityParameterValueModel{
                Name: pointy.String("parameter-1003"),
                ResourceName: pointy.String("resource-1003"),
                ResourceValue: pointy.Int64(30),
                Weight: pointy.Int32(30),
            },
            enchant.RarityParameterValueModel{
                Name: pointy.String("parameter-1004"),
                ResourceName: pointy.String("resource-1004"),
                ResourceValue: pointy.Int64(40),
                Weight: pointy.Int32(40),
            },
        },
    }
)
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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\UpdateRarityParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->updateRarityParameterModelMaster(
        (new UpdateRarityParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("rarity-0001")
            ->withDescription("description1")
            ->withMetadata("RARITY_0001")
            ->withMaximumParameterCount(10)
            ->withParameterCounts([
                (new \Gs2\Enchant\Model\RarityParameterCountModel())
                    ->withCount(5)
                    ->withWeight(3),
                (new \Gs2\Enchant\Model\RarityParameterCountModel())
                    ->withCount(10)
                    ->withWeight(5),
                (new \Gs2\Enchant\Model\RarityParameterCountModel())
                    ->withCount(3)
                    ->withWeight(10),
            ])
            ->withParameters([
                (new \Gs2\Enchant\Model\RarityParameterValueModel())
                    ->withName("parameter-1001")
                    ->withResourceName("resource-1001")
                    ->withResourceValue(10)
                    ->withWeight(10),
                (new \Gs2\Enchant\Model\RarityParameterValueModel())
                    ->withName("parameter-1002")
                    ->withResourceName("resource-1002")
                    ->withResourceValue(20)
                    ->withWeight(20),
                (new \Gs2\Enchant\Model\RarityParameterValueModel())
                    ->withName("parameter-1003")
                    ->withResourceName("resource-1003")
                    ->withResourceValue(30)
                    ->withWeight(30),
                (new \Gs2\Enchant\Model\RarityParameterValueModel())
                    ->withName("parameter-1004")
                    ->withResourceName("resource-1004")
                    ->withResourceValue(40)
                    ->withWeight(40),
            ])
    );
    $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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.UpdateRarityParameterModelMasterRequest;
import io.gs2.enchant.result.UpdateRarityParameterModelMasterResult;

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

try {
    UpdateRarityParameterModelMasterResult result = client.updateRarityParameterModelMaster(
        new UpdateRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
            .withDescription("description1")
            .withMetadata("RARITY_0001")
            .withMaximumParameterCount(10)
            .withParameterCounts(Arrays.asList(
                new io.gs2.enchant.model.RarityParameterCountModel()
                    .withCount(5)
                    .withWeight(3),
                new io.gs2.enchant.model.RarityParameterCountModel()
                    .withCount(10)
                    .withWeight(5),
                new io.gs2.enchant.model.RarityParameterCountModel()
                    .withCount(3)
                    .withWeight(10)
            ))
            .withParameters(Arrays.asList(
                new io.gs2.enchant.model.RarityParameterValueModel()
                    .withName("parameter-1001")
                    .withResourceName("resource-1001")
                    .withResourceValue(10L)
                    .withWeight(10),
                new io.gs2.enchant.model.RarityParameterValueModel()
                    .withName("parameter-1002")
                    .withResourceName("resource-1002")
                    .withResourceValue(20L)
                    .withWeight(20),
                new io.gs2.enchant.model.RarityParameterValueModel()
                    .withName("parameter-1003")
                    .withResourceName("resource-1003")
                    .withResourceValue(30L)
                    .withWeight(30),
                new io.gs2.enchant.model.RarityParameterValueModel()
                    .withName("parameter-1004")
                    .withResourceName("resource-1004")
                    .withResourceValue(40L)
                    .withWeight(40)
            ))
    );
    RarityParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.UpdateRarityParameterModelMasterResult> asyncResult = null;
yield return client.UpdateRarityParameterModelMaster(
    new Gs2.Gs2Enchant.Request.UpdateRarityParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("rarity-0001")
        .WithDescription("description1")
        .WithMetadata("RARITY_0001")
        .WithMaximumParameterCount(10)
        .WithParameterCounts(new Gs2.Gs2Enchant.Model.RarityParameterCountModel[] {
            new Gs2.Gs2Enchant.Model.RarityParameterCountModel()
                .WithCount(5)
                .WithWeight(3),
            new Gs2.Gs2Enchant.Model.RarityParameterCountModel()
                .WithCount(10)
                .WithWeight(5),
            new Gs2.Gs2Enchant.Model.RarityParameterCountModel()
                .WithCount(3)
                .WithWeight(10),
        })
        .WithParameters(new Gs2.Gs2Enchant.Model.RarityParameterValueModel[] {
            new Gs2.Gs2Enchant.Model.RarityParameterValueModel()
                .WithName("parameter-1001")
                .WithResourceName("resource-1001")
                .WithResourceValue(10L)
                .WithWeight(10),
            new Gs2.Gs2Enchant.Model.RarityParameterValueModel()
                .WithName("parameter-1002")
                .WithResourceName("resource-1002")
                .WithResourceValue(20L)
                .WithWeight(20),
            new Gs2.Gs2Enchant.Model.RarityParameterValueModel()
                .WithName("parameter-1003")
                .WithResourceName("resource-1003")
                .WithResourceValue(30L)
                .WithWeight(30),
            new Gs2.Gs2Enchant.Model.RarityParameterValueModel()
                .WithName("parameter-1004")
                .WithResourceName("resource-1004")
                .WithResourceValue(40L)
                .WithWeight(40),
        }),
    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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.updateRarityParameterModelMaster(
        new Gs2Enchant.UpdateRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
            .withDescription("description1")
            .withMetadata("RARITY_0001")
            .withMaximumParameterCount(10)
            .withParameterCounts([
                new Gs2Enchant.model.RarityParameterCountModel()
                    .withCount(5)
                    .withWeight(3),
                new Gs2Enchant.model.RarityParameterCountModel()
                    .withCount(10)
                    .withWeight(5),
                new Gs2Enchant.model.RarityParameterCountModel()
                    .withCount(3)
                    .withWeight(10),
            ])
            .withParameters([
                new Gs2Enchant.model.RarityParameterValueModel()
                    .withName("parameter-1001")
                    .withResourceName("resource-1001")
                    .withResourceValue(10)
                    .withWeight(10),
                new Gs2Enchant.model.RarityParameterValueModel()
                    .withName("parameter-1002")
                    .withResourceName("resource-1002")
                    .withResourceValue(20)
                    .withWeight(20),
                new Gs2Enchant.model.RarityParameterValueModel()
                    .withName("parameter-1003")
                    .withResourceName("resource-1003")
                    .withResourceValue(30)
                    .withWeight(30),
                new Gs2Enchant.model.RarityParameterValueModel()
                    .withName("parameter-1004")
                    .withResourceName("resource-1004")
                    .withResourceValue(40)
                    .withWeight(40),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.update_rarity_parameter_model_master(
        enchant.UpdateRarityParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('rarity-0001')
            .with_description('description1')
            .with_metadata('RARITY_0001')
            .with_maximum_parameter_count(10)
            .with_parameter_counts([
                enchant.RarityParameterCountModel()
                    .with_count(5)
                    .with_weight(3),
                enchant.RarityParameterCountModel()
                    .with_count(10)
                    .with_weight(5),
                enchant.RarityParameterCountModel()
                    .with_count(3)
                    .with_weight(10),
            ])
            .with_parameters([
                enchant.RarityParameterValueModel()
                    .with_name('parameter-1001')
                    .with_resource_name('resource-1001')
                    .with_resource_value(10)
                    .with_weight(10),
                enchant.RarityParameterValueModel()
                    .with_name('parameter-1002')
                    .with_resource_name('resource-1002')
                    .with_resource_value(20)
                    .with_weight(20),
                enchant.RarityParameterValueModel()
                    .with_name('parameter-1003')
                    .with_resource_name('resource-1003')
                    .with_resource_value(30)
                    .with_weight(30),
                enchant.RarityParameterValueModel()
                    .with_name('parameter-1004')
                    .with_resource_name('resource-1004')
                    .with_resource_value(40)
                    .with_weight(40),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.update_rarity_parameter_model_master({
    namespaceName="namespace-0001",
    parameterName="rarity-0001",
    description="description1",
    metadata="RARITY_0001",
    maximumParameterCount=10,
    parameterCounts={
        {
            count=5,
            weight=3,
        },
        {
            count=10,
            weight=5,
        },
        {
            count=3,
            weight=10,
        }
    },
    parameters={
        {
            name="parameter-1001",
            resourceName="resource-1001",
            resourceValue=10,
            weight=10,
        },
        {
            name="parameter-1002",
            resourceName="resource-1002",
            resourceValue=20,
            weight=20,
        },
        {
            name="parameter-1003",
            resourceName="resource-1003",
            resourceValue=30,
            weight=30,
        },
        {
            name="parameter-1004",
            resourceName="resource-1004",
            resourceValue=40,
            weight=40,
        }
    },
})

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

api_result_handler = client.update_rarity_parameter_model_master_async({
    namespaceName="namespace-0001",
    parameterName="rarity-0001",
    description="description1",
    metadata="RARITY_0001",
    maximumParameterCount=10,
    parameterCounts={
        {
            count=5,
            weight=3,
        },
        {
            count=10,
            weight=5,
        },
        {
            count=3,
            weight=10,
        }
    },
    parameters={
        {
            name="parameter-1001",
            resourceName="resource-1001",
            resourceValue=10,
            weight=10,
        },
        {
            name="parameter-1002",
            resourceName="resource-1002",
            resourceValue=20,
            weight=20,
        },
        {
            name="parameter-1003",
            resourceName="resource-1003",
            resourceValue=30,
            weight=30,
        },
        {
            name="parameter-1004",
            resourceName="resource-1004",
            resourceValue=40,
            weight=40,
        }
    },
})

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;

deleteRarityParameterModelMaster

Delete Rarity Parameter Model Master

Deletes an editable Rarity Parameter Model Master definition. This only affects the master data; the currently active (published) model is not affected until the master data is re-activated. Existing user parameter statuses associated with the deleted model are not automatically removed.

Details

Request

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

Result

Type Description
item RarityParameterModelMaster Rarity Parameter Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enchant"
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 := enchant.Gs2EnchantRestClient{
    Session: &session,
}
result, err := client.DeleteRarityParameterModelMaster(
    &enchant.DeleteRarityParameterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ParameterName: pointy.String("rarity-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\Enchant\Gs2EnchantRestClient;
use Gs2\Enchant\Request\DeleteRarityParameterModelMasterRequest;

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

$session->open();

$client = new Gs2EnchantRestClient(
    $session
);

try {
    $result = $client->deleteRarityParameterModelMaster(
        (new DeleteRarityParameterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withParameterName("rarity-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.enchant.rest.Gs2EnchantRestClient;
import io.gs2.enchant.request.DeleteRarityParameterModelMasterRequest;
import io.gs2.enchant.result.DeleteRarityParameterModelMasterResult;

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

try {
    DeleteRarityParameterModelMasterResult result = client.deleteRarityParameterModelMaster(
        new DeleteRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
    );
    RarityParameterModelMaster 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 Gs2EnchantRestClient(session);

AsyncResult<Gs2.Gs2Enchant.Result.DeleteRarityParameterModelMasterResult> asyncResult = null;
yield return client.DeleteRarityParameterModelMaster(
    new Gs2.Gs2Enchant.Request.DeleteRarityParameterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithParameterName("rarity-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 Gs2Enchant from '@/gs2/enchant';

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

try {
    const result = await client.deleteRarityParameterModelMaster(
        new Gs2Enchant.DeleteRarityParameterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withParameterName("rarity-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import enchant

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

try:
    result = client.delete_rarity_parameter_model_master(
        enchant.DeleteRarityParameterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_parameter_name('rarity-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('enchant')

api_result = client.delete_rarity_parameter_model_master({
    namespaceName="namespace-0001",
    parameterName="rarity-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('enchant')

api_result_handler = client.delete_rarity_parameter_model_master_async({
    namespaceName="namespace-0001",
    parameterName="rarity-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;