> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Enhance SDK API Reference

Specification of models and API references for GS2-Enhance 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.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | * |  |  ~ 1024 chars | Namespace GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  |  |  |  ~ 1024 chars | Description |
| transactionSettingV2 | [TransactionSettingV2](#transactionsettingv2) |  |  |  |  | Transaction Setting (V2)<br>Decides how the transactions this Namespace issues are executed. There are only two things to set: the GS2-Distributor Namespace that executes them, and whether the actions in a transaction run one at a time -- so that a later action can build on what an earlier one wrote -- or all at once for a shorter response time.<br>Set this on a new Namespace. `transactionSetting`, the obsolete setting it replaces, is used only while this is unset. |
| enhanceScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to be executed at the time of enhancement<br>Script Trigger Reference - [`enhance`](../script/#enhance) |
| logSetting | [LogSetting](#logsetting) |  |  |  |  | Log Output Setting<br>Configuration for outputting log data of enhancement operations to GS2-Log. By specifying a GS2-Log Namespace, API request and response logs for enhancement and limit break operations can be collected. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | Revision |

**Related methods:**
describeNamespaces - List Namespaces
getNamespace - Get Namespace
createNamespace - Create Namespace
updateNamespace - Update Namespace
deleteNamespace - Delete Namespace



---

### TransactionSettingV2

Transaction Setting (V2)

Transaction Setting (V2) decides how the transactions issued by a Namespace are executed.

There are only two things to set:

- `distributorNamespaceId`: the GS2-Distributor Namespace used to execute the transaction
- `enableParallelExecution`: whether the actions in a transaction run one at a time or all at once

Whichever you choose, the transaction is executed by the server the moment it is issued, and it succeeds or fails as a whole: when an action fails, the actions that already ran are undone with it and nothing is left applied. Everything else about how a transaction runs is fixed to the recommended configuration, so there is nothing else to set.

Running the actions one at a time (the default, `enableParallelExecution` is `false`) lets each action work on top of what the actions before it wrote. The actions run in verify, consume, acquire order, and this is what lets you:

- update the same row from more than one action in a single transaction, which fails when they run all at once
- read what an earlier action wrote, including from List and Query and from inside a nested transaction
- use `%{Gs2Xxx:ActionName.path[0].field}` to feed the result of an earlier verify or consume action into the parameters of a later verify, consume or acquire action

In exchange, the response time is the sum of the time taken by each action, and a transaction may contain at most 20 actions. The order within each phase is decided by the action name and then by the target resource, so you cannot choose the execution order by rearranging the actions in the request, and execution stops at the first action that fails.

Running the actions all at once (`enableParallelExecution` is `true`) executes them in parallel against a single snapshot of the data, so the response time is that of the slowest single action and there is no limit on the number of actions.

In exchange, an action cannot see what the other actions wrote, and two actions that write the same row fail the transaction with `database:transaction:same.resource` (400), so choose this only when you can guarantee that no two actions in the same transaction write the same data. `%{...}` may reference only the results of an earlier phase (verify, then consume, then acquire); a reference to an action in the same phase is left unresolved, and a phase that contains `%{...}` waits for the earlier phases to complete, which lengthens the response time by that amount.

Transaction Setting is the obsolete setting that Transaction Setting (V2) replaces, kept for Namespaces created before Transaction Setting (V2) existed. It applies only while Transaction Setting (V2) is unset, and setting Transaction Setting (V2) supersedes it. Three behaviours it allowed are deliberately not offered here: executing a transaction as a client-run stamp sheet, running AutoRun asynchronously via GS2-Distributor, and folding acquire actions into GS2-JobQueue.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| distributorNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:distributor:default" |  ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions |
| enableParallelExecution | bool |  |  | false |  | Whether to execute the actions in parallel instead of sequentially |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### 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.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| triggerScriptId | string |  |  |  |  ~ 1024 chars | GS2-Script script GRN executed synchronously when the API is executed<br>Must be specified in GRN format starting with "grn:gs2:". |
| doneTriggerTargetType | string (enum)<br>enum {<br>"none",<br>"gs2_script",<br>"aws"<br>}<br> |  |  | "none" |  | Asynchronous script execution method<br>Specifies the type of script to use for asynchronous execution.<br>You can choose from "Do not use an asynchronous execution script (none)", "Use GS2-Script (gs2_script)", and "Use Amazon EventBridge (aws)".none: None / gs2_script: GS2-Script / aws: Amazon EventBridge /  |
| doneTriggerScriptId | string | {doneTriggerTargetType} == "gs2_script" |  |  |  ~ 1024 chars | GS2-Script script GRN for asynchronous execution<br>Must be specified in GRN format starting with "grn:gs2:".<br>* Enabled only if doneTriggerTargetType is "gs2_script" |
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == "gs2_script" |  |  |  ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute asynchronous scripts<br>If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue Namespace GRN.<br>GS2-JobQueue is generally not required unless you have a specific reason to use it.<br>* Enabled only if doneTriggerTargetType is "gs2_script" |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### 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.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| loggingNamespaceId | string |  | ✓ |  |  ~ 1024 chars | GS2-Log Namespace GRN to output logs<br>Must be specified in GRN format starting with "grn:gs2:". |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### GitHubCheckoutSetting

Setting for checking out master data from GitHub


|  | 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)<br>enum {<br>"commit_hash",<br>"branch",<br>"tag"<br>}<br> |  | ✓ |  |  | Source of codecommit_hash: Commit hash / branch: Branch / tag: Tag /  |
| commitHash | string | {referenceType} == "commit_hash" | ✓* |  |  ~ 1024 chars | Commit hash<br>* Required if referenceType is "commit_hash" |
| branchName | string | {referenceType} == "branch" | ✓* |  |  ~ 1024 chars | Branch Name<br>* Required if referenceType is "branch" |
| tagName | string | {referenceType} == "tag" | ✓* |  |  ~ 1024 chars | Tag Name<br>* Required if referenceType is "tag" |

**Related methods:**
updateCurrentRateMasterFromGitHub - Update currently active Rate Model master data from GitHub



---

### TransactionSetting

Transaction Setting

Transaction Setting is obsolete: Transaction Setting (V2) replaces it. It is kept for Namespaces created before Transaction Setting (V2) existed, applies only while Transaction Setting (V2) is unset, and should not be chosen for a new Namespace.

It exposes each part of transaction execution as a separate field -- AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, asynchronous processing of acquire actions via GS2-JobQueue, and sequential execution -- so combinations other than the recommended one can be built. Transaction Setting (V2) is that recommended combination expressed as a single setting. Keep using Transaction Setting only on a Namespace that already depends on a behaviour Transaction Setting (V2) does not offer: executing a transaction as a client-run stamp sheet, running AutoRun asynchronously via GS2-Distributor, or folding acquire actions into GS2-JobQueue.


|  | 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 transactions atomically<br>* Enabled only if enableAutoRun is true |
| transactionUseDistributor | bool | {enableAtomicCommit} == true |  | false |  | Whether to execute transactions asynchronously<br>* Enabled only if enableAtomicCommit is true |
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true |  | false |  | Whether to execute the commit processing of the script result asynchronously<br>* Enabled only if transactionUseDistributor is true |
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true |  | false |  | Whether to use GS2-JobQueue to execute the acquire action<br>* Enabled only if enableAtomicCommit is true |
| enableSequentialExecution | bool | {enableAtomicCommit} == true |  | false |  | Whether to execute the actions of an atomic commit sequentially so that multiple actions may update the same row<br>* 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 |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### Progress

Enhance Progress

It is created when enhancement starts and deleted when enhancement ends.

When you exit the application in the middle of an enhance, this data will remain.
It is possible to resume the game from the ongoing enhancement information maintained by the entity.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| progressId | string |  | * |  |  ~ 1024 chars | Progress GRN<br>* Set automatically by the server |
| userId | string |  | ✓ |  |  ~ 128 chars | User ID |
| rateName | string |  | ✓ |  |  ~ 128 chars | Enhancement Rate Model name<br>The name of the Enhancement Rate Model that defines the parameters for this enhancement operation. References the model that specifies the target inventory, material inventory, experience hierarchy, and bonus rates. |
| name | string |  | ✓ | UUID |  ~ 36 chars | Progress ID<br>Maintains a unique name for each enhance progress.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each enhance progress. |
| propertyId | string |  | ✓ |  |  ~ 1024 chars | Property ID to be enhanced<br>The property ID of the GS2-Inventory item being enhanced. Identifies the specific item instance that will receive experience points upon completion of the enhancement. |
| experienceValue | long |  | ✓ |  | 0 ~ 9223372036854775805 | Experience value obtainable<br>The base experience value calculated from the consumed materials. This value is determined by summing the experience values defined in each material's metadata, multiplied by the material quantity. |
| rate | float |  | ✓ |  | 0 ~ 100.0 | Experience value scale factor<br>The bonus multiplier applied to the base experience value. Determined by weighted lottery from the Enhancement Rate Model's bonus rates. A value of 1.0 means no bonus, while values greater than 1.0 represent a "great success" bonus (e.g., 1.5 for 150% experience). |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | Revision |

**Related methods:**
getProgress - Retrieve running enhancements
getProgressByUserId - Get running enhancements by User ID
createProgressByUserId - Start enhancement by User ID
end - Complete enhancement
endByUserId - Complete enhancement by User ID
deleteProgress - Delete running enhancement
deleteProgressByUserId - Delete running enhancement by User ID



---

### RateModel

Enhancement Rate Model

The enhancement rate is data that defines the materials used for enhancement and the target of enhancement.

Both material data and enhancement target data must be managed in GS2-Inventory.
The experience value obtained from the enhancement is recorded in GS2-Inventory metadata in JSON format.
Here, it is necessary to describe at which level of the metadata the experience value is stored.

A correction value can be applied to the amount of experience value that can be obtained with a certain probability of `great success` during enhancement.
The probability of that draw is also defined in this entity.

`targetInventoryModelId` specifies the inventory model that holds the items to be enhanced, and `materialInventoryModelId` the inventory model that holds the items usable as material.
These can be separate inventory models, so an arrangement in which characters are the target and enhancement-only items are the material is possible.

The experience each material grants is written in the metadata of its item model, and `acquireExperienceHierarchy` tells GS2-Enhance where in that JSON it is stored.
For a structure such as `{ "aaa": { "bbb": { "experienceValue": 100 } } }`, specify `[ "aaa", "bbb", "experienceValue" ]`. Up to 10 levels can be specified.

The gained experience is added to GS2-Experience, on the experience model specified by `experienceModelId`.
The property ID it is added to is the property ID of the target item with `acquireExperienceSuffix` appended, so a single item can hold several kinds of experience, such as `level` for the character level and `like` for affection.

`bonusRates` defines a weighted draw over the bonus multipliers applied to the gained experience.
Each entry holds a multiplier (1.5 meaning 150%) and a draw weight, one entry is chosen by weighted draw on each enhancement, and up to 1,000 entries can be registered.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| rateModelId | string |  | * |  |  ~ 1024 chars | Enhancement Rate Model GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  |  |  |  ~ 1024 chars | Description |
| metadata | string |  |  |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| targetInventoryModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for enhancement targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for enhancement. The item to be enhanced must belong to this inventory model. |
| acquireExperienceSuffix | string |  | ✓ |  |  ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience<br>A string appended to the item's property ID to form the GS2-Experience property ID where experience is stored. This allows the same item to have multiple experience types (e.g., "level" for character level, "like" for affinity). |
| materialInventoryModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable as enhancement material<br>Specifies the GS2-Inventory inventory model that holds the items usable as enhancement materials. The experience value each material provides is defined in the item model's metadata using the JSON hierarchy specified by acquireExperienceHierarchy. |
| acquireExperienceHierarchy | List&lt;string&gt; |  |  |  | 0 ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata<br>GS2-Enhance features a mechanism that works in conjunction with GS2-Inventory to perform enhancements. It sets the experience value when used as enhancement material in JSON format within the ItemModel metadata.<br>For example, to define metadata with a structure like: { “aaa”: { “bbb”: { “experienceValue”: 100 } } } Specify it as: [ “aaa”, ‘bbb’, “experienceValue” ]<br>Details are explained in the [Microservices Introduction / GS2-Enhance](/microservices/enhance/#enhancement-rate) section. |
| experienceModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Experience Experience Model GRN gained as a result of enhancement<br>Specifies the GS2-Experience experience model where the experience points obtained from enhancement are recorded. The experience is added to the property identified by combining the target item's property ID with the acquireExperienceSuffix. |
| bonusRates | [List&lt;BonusRate&gt;](#bonusrate) |  |  |  | 0 ~ 1000 items | Experience gain bonus<br>Defines a weighted lottery for bonus experience multipliers during enhancement. Each entry specifies a multiplier (e.g., 1.5 for 150%) and a draw weight. When enhancement is performed, one entry is selected by weighted lottery to determine whether a "great success" bonus applies to the experience gained. |

**Related methods:**
describeRateModels - List Enhancement Rate Models
getRateModel - Get Enhancement Rate Model



---

### UnleashRateModel

Unleash Rate Model

Defines the conditions for limit breaking (unleashing) items.

A limit break here is an enhancement that raises the grade managed by GS2-Grade by consuming duplicates of the same item as material.
Raising the grade raises the rank cap on the GS2-Experience side, which lets the target be grown to a higher level.

`targetInventoryModelId` specifies the GS2-Inventory inventory model that holds the items eligible for a limit break.
Both the item being unleashed and the duplicates consumed as material must belong to this inventory model.
`gradeModelId` specifies the GS2-Grade grade model that tracks the grade of the target item; the grade is raised by 1 on a successful limit break.

`gradeEntries` defines, for each grade, how many duplicates must be consumed to reach it, and between 1 and 1,000 entries can be registered.
Setting, for example, 1 duplicate for grade 1 and 3 duplicates for grade 2 lets you control the cost of each limit break step individually.

A resource consumed as material is discarded together with whatever it held.
Even when the material holds experience or other resources, they are not carried over to the target, so convert them into a resource for handover beforehand if that is required.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| unleashRateModelId | string |  | * |  |  ~ 1024 chars | Unleash Rate Model GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Unleash Rate Model name<br>Unique Unleash Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  |  |  |  ~ 1024 chars | Description |
| metadata | string |  |  |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| targetInventoryModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for unleash targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for limit breaking. The item to be unleashed and the duplicate items consumed as material must both belong to this inventory model. |
| gradeModelId | string |  | ✓ |  |  ~ 1024 chars | Grade Model GRN<br>Specifies the GS2-Grade grade model that tracks the limit break level of the target item. When a limit break is successfully performed, the item's grade is incremented in this grade model. |
| groupKeyHierarchy | List&lt;string&gt; |  |  | [] | 0 ~ 10 items | Hierarchy of the JSON data that stores the group key in the ItemModel metadata<br>The group key classifies item models, such as the equipment slot, and is used by recipes to compare materials with the target.<br>For metadata with a structure like { "unleash": { "group": "weapon" } }, specify [ "unleash", "group" ].<br>The value must be a string. Required when a recipe uses "Same Group" or targetGroupKeys. |
| gradeEntries | [List&lt;UnleashRateEntryModel&gt;](#unleashrateentrymodel) |  | ✓ |  | 1 ~ 1000 items | List of Grade Entry<br>Defines the material cost for each grade level of the limit break. Each entry maps a grade value to the number of duplicate items that must be consumed to reach that grade. For example, grade 1 might require 1 duplicate, grade 2 might require 3 duplicates, and so on. |

**Related methods:**
describeUnleashRateModels - List Unleash Rate Models
getUnleashRateModel - Get Unleash Rate Model



---

### UnleashRateEntryModel

Unleash Rate Entry Model

Defines the material cost for a single grade level in a limit break progression. Each entry specifies which grade value it applies to and how many duplicate items of the same type must be consumed to achieve that grade.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| gradeValue | long |  | ✓ |  | 1 ~ 1000 | Target grade<br>The grade value that this entry defines the cost for. When performing a limit break to this grade level, the number of items specified by needCount will be consumed. |
| type | string (enum)<br>enum {<br>"simple",<br>"recipe"<br>}<br> |  |  | "simple" |  | Type of material condition<br>"Simple (simple)" consumes needCount duplicates of the same item model as the target. This is the conventional behavior.<br>"Recipe (recipe)" lets the player choose one of the recipes, and consumes the materials defined by the chosen recipe.simple: Simple / recipe: Recipe /  |
| needCount | int | {type} == "simple" | ✓* |  | 1 ~ 1000 | How many items of the same type to consume<br>The number of duplicate items that must be consumed to perform the limit break to the target grade. These items are of the same item model as the item being unleashed.<br>* Required if type is "simple" |
| recipes | [List&lt;UnleashRecipe&gt;](#unleashrecipe) | {type} == "recipe" | ✓* |  | 1 ~ 10 items | Recipes<br>Used when type is "Recipe". The player chooses one of these recipes when executing an unleash.<br>* Required if type is "recipe" |

**Related models:**
UnleashRateModel - Unleash Rate Model
UnleashRateModelMaster - Unleash Rate Model Master



---

### BonusRate

Experience Gain Bonus

Defines a single entry in the weighted lottery for determining the experience bonus multiplier during enhancement. By configuring multiple entries with different rates and weights, you can implement "great success" or "super success" mechanics with controlled probabilities.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| rate | float |  |  | 1.0 | 0 ~ 10000 | Experience bonus multiplier (1.0 = no bonus)<br>The multiplier applied to the base experience value when this entry is drawn. A value of 1.0 means normal enhancement with no bonus, 1.5 means 150% experience (great success), 2.0 means 200% experience (super success), and so on. |
| weight | int |  |  | 1 | 0 ~ 2147483645 | Lottery weight<br>The relative weight used in the weighted lottery when selecting the bonus rate. Higher values increase the probability of this bonus rate being selected. The actual probability is this weight divided by the sum of all weights in the bonus rate list. |

**Related models:**
RateModel - Enhancement Rate Model
RateModelMaster - Enhancement Rate Model Master



---

### Material

Enhance Material

Represents a material item to be consumed during an enhancement operation. Each material references a specific GS2-Inventory item set and specifies the quantity to consume. The experience value provided by the material is determined from the item model's metadata.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| materialItemSetId | string |  | ✓ |  |  ~ 1024 chars | GRN of Item Set that will be used as materials for enhancement<br>References the specific GS2-Inventory item set to consume as enhancement material. The item must belong to the material inventory model specified in the Enhancement Rate Model. |
| count | int |  |  | 1 | 0 ~ 2147483645 | Number of consumption<br>The quantity of this material item to consume. The total experience gained from this material is calculated by multiplying the per-item experience value (from the item model metadata) by this count. |


---

### UnleashRecipe

Unleash Recipe

One way to raise the grade by one step. When a grade entry has several recipes, the player chooses one of them, and all the materials of the chosen recipe are required.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ |  |  ~ 128 chars | Recipe name<br>A name unique within the grade entry. The player specifies the recipe by this name when executing an unleash. |
| metadata | string |  |  |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2's behavior, they can be used to store information used in the game. |
| targetGroupKeys | List&lt;string&gt; |  |  | [] | 0 ~ 10 items | Group keys of the targets this recipe can be used for<br>When empty, the recipe can be used for any target.<br>When set, the recipe can be used only when the group key of the target's item model is included. The group key is read from the item model metadata using groupKeyHierarchy of the Unleash Rate Model. |
| materials | [List&lt;UnleashMaterial&gt;](#unleashmaterial) |  | ✓ |  | 1 ~ 10 items | Materials required by this recipe<br>All the materials are consumed when this recipe is used. |

**Related models:**
UnleashRateEntryModel - Unleash Rate Entry Model



---

### UnleashMaterial

Unleash Material

Defines one kind of material required by a recipe.
"Individual (individual)" consumes item sets chosen by the player, such as duplicate equipment.
"Quantity (quantity)" consumes a quantity of an item decided by the setting, such as a general-purpose enhancement material.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ |  |  ~ 128 chars | Material name<br>A name unique within the recipe. When executing an unleash, the player specifies the item sets for each individual material by this name. |
| materialType | string (enum)<br>enum {<br>"individual",<br>"quantity"<br>}<br> |  | ✓ |  |  | Type of material<br>"Individual (individual)" consumes item sets chosen by the player.<br>"Quantity (quantity)" consumes a quantity of an item decided by the setting.individual: Individual / quantity: Quantity /  |
| individualSetting | [UnleashIndividualMaterialSetting](#unleashindividualmaterialsetting) | {materialType} == "individual" | ✓* |  |  | Individual material setting<br>Used when materialType is "Individual".<br>* Required if materialType is "individual" |
| quantitySetting | [UnleashQuantityMaterialSetting](#unleashquantitymaterialsetting) | {materialType} == "quantity" | ✓* |  |  | Quantity material setting<br>Used when materialType is "Quantity".<br>* Required if materialType is "quantity" |

**Related models:**
UnleashRecipe - Unleash Recipe



---

### UnleashIndividualMaterialSetting

Individual Material Setting

Defines a material that is consumed as individual item sets, such as a duplicate piece of equipment.
The player chooses which item sets to consume, and each chosen item set must belong to the same inventory model as the item being unleashed.
Because each individual can have its own grade in GS2-Grade, the grade of the material can also be made a condition.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| matchType | string (enum)<br>enum {<br>"sameItem",<br>"sameGroup"<br>}<br> |  | ✓ |  |  | How the material is matched against the target<br>"Same Item (sameItem)" accepts only item sets of the same item model as the target.<br>"Same Group (sameGroup)" accepts item sets whose item model has the same group key as the target's item model. The group key is read from the item model metadata using groupKeyHierarchy of the Unleash Rate Model.sameItem: Same Item / sameGroup: Same Group /  |
| gradeCondition | string (enum)<br>enum {<br>"any",<br>"sameAsTarget",<br>"equal"<br>}<br> |  |  | "any" |  | Grade condition of the material<br>"Any (any)" does not check the grade of the material.<br>"Same as Target (sameAsTarget)" requires the material to have the same grade as the target's current grade.<br>"Equal (equal)" requires the material to have the grade specified by gradeValue.<br>The grade is verified in the transaction with GS2-Grade, using the grade model of the Unleash Rate Model.any: Any / sameAsTarget: Same as Target / equal: Equal /  |
| gradeValue | long | {gradeCondition} == "equal" | ✓* |  | 0 ~ 1000 | Grade the material must have<br>Used when gradeCondition is "Equal".<br>* Required if gradeCondition is "equal" |
| count | int |  | ✓ |  | 1 ~ 1000 | Number of item sets to consume<br>The number of item sets the player must specify for this material. Each item set is consumed by one. |

**Related models:**
UnleashMaterial - Unleash Material



---

### UnleashQuantityMaterialSetting

Quantity Material Setting

Defines a material that is consumed by quantity, such as a general-purpose enhancement material.
The player does not choose the item; the item model to consume is decided by this setting, and the specified quantity is consumed.
Both GS2-Inventory standard inventories and simple inventories can be used.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| matchType | string (enum)<br>enum {<br>"sameGroup",<br>"specified"<br>}<br> |  | ✓ |  |  | How the item model to consume is decided<br>"Same Group (sameGroup)" consumes the item model in materialInventoryModelId whose group key is the same as the target's item model. Exactly one item model must have that group key.<br>"Specified (specified)" consumes the item model specified by itemModelId.sameGroup: Same Group / specified: Specified /  |
| materialInventoryModelId | string | {matchType} == "sameGroup" | ✓* |  |  ~ 1024 chars | GS2-Inventory inventory model GRN to search for the material<br>Used when matchType is "Same Group". A simple inventory model GRN can also be specified.<br>* Required if matchType is "sameGroup" |
| itemModelId | string | {matchType} == "specified" | ✓* |  |  ~ 1024 chars | GS2-Inventory item model GRN to consume<br>Used when matchType is "Specified". A simple item model GRN can also be specified.<br>* Required if matchType is "specified" |
| count | int |  | ✓ |  | 1 ~ 2147483645 | Quantity to consume |

**Related models:**
UnleashMaterial - Unleash Material



---

### UnleashMaterialSelection

Material Selection

The item sets the player assigns to one individual material of the recipe when executing an unleash.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ |  |  ~ 128 chars | Material name<br>The name of the individual material defined in the recipe. |
| itemSetIds | List&lt;string&gt; |  | ✓ |  | 1 ~ 1000 items | Item sets to consume as this material<br>The number of item sets must match the count of the material. |


---

### Config

Configuration

Configuration values applied to transaction variables


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| key | string |  | ✓ |  |  ~ 64 chars | Name |
| value | string |  |  |  |  ~ 51200 chars | Value |


---

### VerifyActionResult

Verify Action execution result


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| action | string (enum)<br>enum {<br>}<br> |  | ✓ |  |  | 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 |

**Related models:**
TransactionResult - Transaction Execution Result



---

### ConsumeActionResult

Consume Action execution result


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| action | string (enum)<br>enum {<br>}<br> |  | ✓ |  |  | 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 |

**Related models:**
TransactionResult - Transaction Execution Result



---

### AcquireActionResult

Acquire Action execution result


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| action | string (enum)<br>enum {<br>}<br> |  | ✓ |  |  | 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 |

**Related models:**
TransactionResult - Transaction Execution Result



---

### TransactionResult

Transaction Execution Result

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


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| transactionId | string |  | ✓ |  | 36 ~ 36 chars | Transaction ID |
| verifyResults | [List&lt;VerifyActionResult&gt;](#verifyactionresult) |  |  |  | 0 ~ 10 items | List of verify action execution results |
| consumeResults | [List&lt;ConsumeActionResult&gt;](#consumeactionresult) |  |  | [] | 0 ~ 10 items | List of Consume Action execution results |
| acquireResults | [List&lt;AcquireActionResult&gt;](#acquireactionresult) |  |  | [] | 0 ~ 100 items | List of Acquire Action execution results |
| hasError | bool |  |  | false |  | Whether an error occurred during transaction execution |

**Related methods:**
start - Start enhancement
startByUserId - Start enhancement by User ID
end - Complete enhancement
endByUserId - Complete enhancement by User ID



---

### CurrentRateMaster

Currently active Rate Model master data

This master data defines the Rate 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.
**ℹ️ Note**

Please refer to [GS2-Enhance Master Data Reference](api_reference/enhance/master_data/) for the JSON file format.


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

**Related methods:**
getCurrentRateMaster - Get currently active Rate Model master data
updateCurrentRateMaster - Update currently active Rate Model master data
updateCurrentRateMasterFromGitHub - Update currently active Rate Model master data from GitHub
exportMaster - Export Rate Model Master in a master data format that can be activated



---

### RateModelMaster

Enhancement Rate Model Master

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

The enhancement rate is data that defines the materials used for enhancement and the target of enhancement.

Both material data and enhancement target data must be managed in GS2-Inventory.
The experience value obtained from the enhancement is recorded in GS2-Inventory metadata in JSON format.
Here, it is necessary to describe at which level of the metadata the experience value is stored.

A bonus multiplier can be applied to the experience gained when a “great success” occurs during enhancement.
The probability of that draw is also defined in this entity.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| rateModelId | string |  | * |  |  ~ 1024 chars | Enhancement Rate Model Master GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  |  |  |  ~ 1024 chars | Description |
| metadata | string |  |  |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| targetInventoryModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for enhancement targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for enhancement. The item to be enhanced must belong to this inventory model. |
| acquireExperienceSuffix | string |  | ✓ |  |  ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience<br>A string appended to the item's property ID to form the GS2-Experience property ID where experience is stored. This allows the same item to have multiple experience types (e.g., "level" for character level, "like" for affinity). |
| materialInventoryModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable as enhancement material<br>Specifies the GS2-Inventory inventory model that holds the items usable as enhancement materials. The experience value each material provides is defined in the item model's metadata using the JSON hierarchy specified by acquireExperienceHierarchy. |
| acquireExperienceHierarchy | List&lt;string&gt; |  |  |  | 0 ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata<br>GS2-Enhance features a mechanism that works in conjunction with GS2-Inventory to perform enhancements. It sets the experience value when used as enhancement material in JSON format within the ItemModel metadata.<br>For example, if you have metadata like { "aaa": { "bbb": { "experienceValue": 100 } } }, specify [ "aaa", "bbb", "experienceValue" ].<br>Details are explained in the [Microservices Introduction / GS2-Enhance](/microservices/enhance/#enhancement-rate) section. |
| experienceModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Experience Experience Model GRN gained as a result of enhancement<br>Specifies the GS2-Experience experience model where the experience points obtained from enhancement are recorded. The experience is added to the property identified by combining the target item's property ID with the acquireExperienceSuffix. |
| bonusRates | [List&lt;BonusRate&gt;](#bonusrate) |  |  |  | 0 ~ 1000 items | Experience gain bonus<br>Defines a weighted lottery for bonus experience multipliers during enhancement. Each entry specifies a multiplier (e.g., 1.5 for 150%) and a draw weight. When enhancement is performed, one entry is selected by weighted lottery to determine whether a "great success" bonus applies to the experience gained. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | Revision |

**Related methods:**
describeRateModelMasters - List Enhancement Rate Model Masters
getRateModelMaster - Get Enhancement Rate Master
createRateModelMaster - Create Enhancement Rate Master
updateRateModelMaster - Update Enhancement Rate Master
deleteRateModelMaster - Delete Enhancement Rate Master



---

### UnleashRateModelMaster

Unleash Rate Model Master

The Unleash Rate Model Master is the data used to edit and manage the unleash rate models used in the game, and it is held temporarily in the master data editor of the management console.
Running an import or update reflects it as the unleash rate model actually referenced from the game.

A limit break here is an enhancement that raises the grade managed by GS2-Grade by consuming duplicates of the same item as material.
Raising the grade raises the rank cap on the GS2-Experience side, which lets the target be grown to a higher level.

`targetInventoryModelId` specifies the GS2-Inventory inventory model that holds the items eligible for a limit break.
Both the item being unleashed and the duplicates consumed as material must belong to this inventory model.
`gradeModelId` specifies the GS2-Grade grade model that tracks the grade of the target item; the grade is raised by 1 on a successful limit break.

`gradeEntries` defines, for each grade, how many duplicates must be consumed to reach it, and between 1 and 1,000 entries can be registered.
Setting, for example, 1 duplicate for grade 1 and 3 duplicates for grade 2 lets you control the cost of each limit break step individually.

A resource consumed as material is discarded together with whatever it held.
Even when the material holds experience or other resources, they are not carried over to the target, so convert them into a resource for handover beforehand if that is required.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| unleashRateModelId | string |  | * |  |  ~ 1024 chars | Unleash Rate Model Master GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Unleash Rate Model name<br>Unique Unleash Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  |  |  |  ~ 1024 chars | Description |
| metadata | string |  |  |  |  ~ 2048 chars | Metadata<br>Any value can be set for metadata.<br>It does not affect the operation of GS2 in any way, and should be used as a storage location for values used in the game. |
| targetInventoryModelId | string |  | ✓ |  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for unleash targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for limit breaking. The item to be unleashed and the duplicate items consumed as material must both belong to this inventory model. |
| gradeModelId | string |  | ✓ |  |  ~ 1024 chars | Grade Model GRN<br>Specifies the GS2-Grade grade model that tracks the limit break level of the target item. When a limit break is successfully performed, the item's grade is incremented in this grade model. |
| groupKeyHierarchy | List&lt;string&gt; |  |  | [] | 0 ~ 10 items | Hierarchy of the JSON data that stores the group key in the ItemModel metadata<br>The group key classifies item models, such as the equipment slot, and is used by recipes to compare materials with the target.<br>For metadata with a structure like { "unleash": { "group": "weapon" } }, specify [ "unleash", "group" ].<br>The value must be a string. Required when a recipe uses "Same Group" or targetGroupKeys. |
| gradeEntries | [List&lt;UnleashRateEntryModel&gt;](#unleashrateentrymodel) |  | ✓ |  | 1 ~ 1000 items | List of Grade Entry<br>Defines the material cost for each grade level of the limit break. Each entry maps a grade value to the number of duplicate items that must be consumed to reach that grade. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | Revision |

**Related methods:**
describeUnleashRateModelMasters - List Unleash Rate Model Masters
getUnleashRateModelMaster - Get Unleash Rate Model Master
createUnleashRateModelMaster - Create Unleash Rate Model Master
updateUnleashRateModelMaster - Update Unleash Rate Model Master
deleteUnleashRateModelMaster - Delete Unleash Rate Model Master



---
## Methods

### describeNamespaces

List 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.


#### 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&lt;Namespace&gt;](#namespace) | List of Namespaces |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &enhance.DescribeNamespacesRequest {
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $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")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeNamespacesRequest;
import io.gs2.enhance.result.DescribeNamespacesResult;

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Enhance.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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.describeNamespaces(
        new Gs2Enhance.DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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 Namespace

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


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| transactionSettingV2 | [TransactionSettingV2](#transactionsettingv2) |  | |  |  | Transaction Setting (V2)<br>Decides how the transactions this Namespace issues are executed. There are only two things to set: the GS2-Distributor Namespace that executes them, and whether the actions in a transaction run one at a time -- so that a later action can build on what an earlier one wrote -- or all at once for a shorter response time.<br>Set this on a new Namespace. `transactionSetting`, the obsolete setting it replaces, is used only while this is unset. |
| enhanceScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to be executed at the time of enhancement<br>Script Trigger Reference - [`enhance`](../script/#enhance) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | Log Output Setting<br>Configuration for outputting log data of enhancement operations to GS2-Log. By specifying a GS2-Log Namespace, API request and response logs for enhancement and limit break operations can be collected. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Namespace created |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &enhance.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSettingV2: nil,
        EnhanceScript: nil,
        LogSetting: &enhance.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSettingV2(null)
            ->withEnhanceScript(null)
            ->withLogSetting((new \Gs2\Enhance\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CreateNamespaceRequest;
import io.gs2.enhance.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSettingV2(null)
            .withEnhanceScript(null)
            .withLogSetting(new io.gs2.enhance.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Enhance.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSettingV2(null)
        .WithEnhanceScript(null)
        .WithLogSetting(new Gs2.Gs2Enhance.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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.createNamespace(
        new Gs2Enhance.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSettingV2(null)
            .withEnhanceScript(null)
            .withLogSetting(new Gs2Enhance.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.create_namespace(
        enhance.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting_v2(None)
            .with_enhance_script(None)
            .with_log_setting(
                enhance.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### getNamespaceStatus

Get Namespace Status

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


#### Request

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

#### Result

|  | Type | Description |
| --- | --- | --- |
| status | string | Namespace Status<br>ACTIVE: Active / DELETED: Deleted /  |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &enhance.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetNamespaceStatusRequest;
import io.gs2.enhance.result.GetNamespaceStatusResult;

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

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Enhance.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getNamespaceStatus(
        new Gs2Enhance.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
status = result.status;

```



---

### getNamespace

Get Namespace

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


#### Request

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

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Namespace |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &enhance.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetNamespaceRequest;
import io.gs2.enhance.result.GetNamespaceResult;

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

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Enhance.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getNamespace(
        new Gs2Enhance.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| transactionSettingV2 | [TransactionSettingV2](#transactionsettingv2) |  | |  |  | Transaction Setting (V2)<br>Decides how the transactions this Namespace issues are executed. There are only two things to set: the GS2-Distributor Namespace that executes them, and whether the actions in a transaction run one at a time -- so that a later action can build on what an earlier one wrote -- or all at once for a shorter response time.<br>Set this on a new Namespace. `transactionSetting`, the obsolete setting it replaces, is used only while this is unset. |
| enhanceScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to be executed at the time of enhancement<br>Script Trigger Reference - [`enhance`](../script/#enhance) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | Log Output Setting<br>Configuration for outputting log data of enhancement operations to GS2-Log. By specifying a GS2-Log Namespace, API request and response logs for enhancement and limit break operations can be collected. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Namespace updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &enhance.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSettingV2: nil,
        EnhanceScript: nil,
        LogSetting: &enhance.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSettingV2(null)
            ->withEnhanceScript(null)
            ->withLogSetting((new \Gs2\Enhance\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UpdateNamespaceRequest;
import io.gs2.enhance.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSettingV2(null)
            .withEnhanceScript(null)
            .withLogSetting(new io.gs2.enhance.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Enhance.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSettingV2(null)
        .WithEnhanceScript(null)
        .WithLogSetting(new Gs2.Gs2Enhance.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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.updateNamespace(
        new Gs2Enhance.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSettingV2(null)
            .withEnhanceScript(null)
            .withLogSetting(new Gs2Enhance.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.update_namespace(
        enhance.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting_v2(None)
            .with_enhance_script(None)
            .with_log_setting(
                enhance.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### deleteNamespace

Delete Namespace

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


#### Request

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

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Deleted Namespace |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &enhance.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DeleteNamespaceRequest;
import io.gs2.enhance.result.DeleteNamespaceResult;

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

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Enhance.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.deleteNamespace(
        new Gs2Enhance.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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 microservice version


#### Request

Request parameters: None

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | string | Version |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &enhance.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetServiceVersionRequest;
import io.gs2.enhance.result.GetServiceVersionResult;

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

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Enhance.Request.GetServiceVersionRequest(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getServiceVersion(
        new Gs2Enhance.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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.


#### Request

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

#### Result

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &enhance.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DumpUserDataByUserIdRequest;
import io.gs2.enhance.result.DumpUserDataByUserIdResult;

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

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Enhance.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Enhance.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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


#### 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




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &enhance.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.enhance.result.CheckDumpUserDataByUserIdResult;

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

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Enhance.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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

Clean User Data by User ID

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


#### Request

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

#### Result

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &enhance.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CleanUserDataByUserIdRequest;
import io.gs2.enhance.result.CleanUserDataByUserIdResult;

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

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Enhance.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Enhance.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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


#### Request

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

#### Result

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &enhance.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.enhance.result.CheckCleanUserDataByUserIdResult;

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

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Enhance.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Enhance.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

Prepare User Data Import by 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.


#### 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




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &enhance.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.enhance.result.PrepareImportUserDataByUserIdResult;

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Enhance.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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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.


#### 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

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &enhance.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.ImportUserDataByUserIdRequest;
import io.gs2.enhance.result.ImportUserDataByUserIdResult;

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

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Enhance.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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


#### 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




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &enhance.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CheckImportUserDataByUserIdRequest;
import io.gs2.enhance.result.CheckImportUserDataByUserIdResult;

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

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Enhance.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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

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

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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;

```



---

### directEnhance

Perform enhancements

Consumes the specified materials to grant experience to the target item set based on the Enhancement Rate Model.
The experience gained is calculated from the materials according to the experience hierarchy defined in the rate model, and a bonus rate is drawn from the configured bonus rate probability table.
The result includes the acquired experience amount and the bonus rate applied.
A transaction (transaction) is issued to execute the material consumption and experience acquisition.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| targetItemSetId | string |  | ✓|  |  ~ 1024 chars | GRN of the Item Set to be enhanced |
| materials | [List&lt;Material&gt;](#material) |  | ✓|  | 1 ~ 10 items | List of Material |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [RateModel](#ratemodel) | Enhancement Rate Model |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to perform the enhancement process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |
| acquireExperience | long | Amount of experience gained |
| bonusRate | float | Experience bonus multiplier (1.0 = no bonus) |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DirectEnhance(
    &enhance.DirectEnhanceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("rate-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetItemSetId: pointy.String("item-set-0001"),
        Materials: []enhance.Material{
            enhance.Material{
                MaterialItemSetId: pointy.String("material-0001"),
                Count: pointy.Int32(1),
            },
        },
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
acquireExperience := result.AcquireExperience
bonusRate := result.BonusRate

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DirectEnhanceRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->directEnhance(
        (new DirectEnhanceRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("rate-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetItemSetId("item-set-0001")
            ->withMaterials([
                (new Material())
                    ->withMaterialItemSetId("material-0001")
                    ->withCount(1),
            ])
            ->withConfig(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
    $acquireExperience = $result->getAcquireExperience();
    $bonusRate = $result->getBonusRate();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DirectEnhanceRequest;
import io.gs2.enhance.result.DirectEnhanceResult;

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

try {
    DirectEnhanceResult result = client.directEnhance(
        new DirectEnhanceRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withAccessToken("accessToken-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials(Arrays.asList(
                new Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1)
            ))
            .withConfig(null)
    );
    RateModel item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
    long acquireExperience = result.getAcquireExperience();
    float bonusRate = result.getBonusRate();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DirectEnhanceResult> asyncResult = null;
yield return client.DirectEnhance(
    new Gs2.Gs2Enhance.Request.DirectEnhanceRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("rate-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetItemSetId("item-set-0001")
        .WithMaterials(new Gs2.Gs2Enhance.Model.Material[] {
            new Gs2.Gs2Enhance.Model.Material()
                .WithMaterialItemSetId("material-0001")
                .WithCount(1),
        })
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
var acquireExperience = result.AcquireExperience;
var bonusRate = result.BonusRate;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.directEnhance(
        new Gs2Enhance.DirectEnhanceRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withAccessToken("accessToken-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials([
                new Gs2Enhance.model.Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1),
            ])
            .withConfig(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
    const acquireExperience = result.getAcquireExperience();
    const bonusRate = result.getBonusRate();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.direct_enhance(
        enhance.DirectEnhanceRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('rate-0001')
            .with_access_token('accessToken-0001')
            .with_target_item_set_id('item-set-0001')
            .with_materials([
                enhance.Material()
                    .with_material_item_set_id('material-0001')
                    .with_count(1),
            ])
            .with_config(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
    acquire_experience = result.acquire_experience
    bonus_rate = result.bonus_rate
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.direct_enhance({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    accessToken="accessToken-0001",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    config=nil,
})

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

result = api_result.result
item = result.item;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.direct_enhance_async({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    accessToken="accessToken-0001",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```



---

### directEnhanceByUserId

Perform enhancement by User ID

Consumes the specified materials to grant experience to the target item set based on the Enhancement Rate Model.
The experience gained is calculated from the materials according to the experience hierarchy defined in the rate model, and a bonus rate is drawn from the configured bonus rate probability table.
The result includes the acquired experience amount and the bonus rate applied.
A transaction (transaction) is issued to execute the material consumption and experience acquisition.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| targetItemSetId | string |  | ✓|  |  ~ 1024 chars | GRN of the Item Set to be enhanced |
| materials | [List&lt;Material&gt;](#material) |  | ✓|  | 1 ~ 10 items | List of Material |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [RateModel](#ratemodel) | Enhancement Rate Model |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to perform the enhancement process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |
| acquireExperience | long | Amount of experience gained |
| bonusRate | float | Experience bonus multiplier (1.0 = no bonus) |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DirectEnhanceByUserId(
    &enhance.DirectEnhanceByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("rate-0001"),
        UserId: pointy.String("user-0001"),
        TargetItemSetId: pointy.String("item-set-0001"),
        Materials: []enhance.Material{
            enhance.Material{
                MaterialItemSetId: pointy.String("material-0001"),
                Count: pointy.Int32(1),
            },
        },
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
acquireExperience := result.AcquireExperience
bonusRate := result.BonusRate

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DirectEnhanceByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->directEnhanceByUserId(
        (new DirectEnhanceByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("rate-0001")
            ->withUserId("user-0001")
            ->withTargetItemSetId("item-set-0001")
            ->withMaterials([
                (new Material())
                    ->withMaterialItemSetId("material-0001")
                    ->withCount(1),
            ])
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
    $acquireExperience = $result->getAcquireExperience();
    $bonusRate = $result->getBonusRate();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DirectEnhanceByUserIdRequest;
import io.gs2.enhance.result.DirectEnhanceByUserIdResult;

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

try {
    DirectEnhanceByUserIdResult result = client.directEnhanceByUserId(
        new DirectEnhanceByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withUserId("user-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials(Arrays.asList(
                new Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1)
            ))
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    RateModel item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
    long acquireExperience = result.getAcquireExperience();
    float bonusRate = result.getBonusRate();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DirectEnhanceByUserIdResult> asyncResult = null;
yield return client.DirectEnhanceByUserId(
    new Gs2.Gs2Enhance.Request.DirectEnhanceByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("rate-0001")
        .WithUserId("user-0001")
        .WithTargetItemSetId("item-set-0001")
        .WithMaterials(new Gs2.Gs2Enhance.Model.Material[] {
            new Gs2.Gs2Enhance.Model.Material()
                .WithMaterialItemSetId("material-0001")
                .WithCount(1),
        })
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
var acquireExperience = result.AcquireExperience;
var bonusRate = result.BonusRate;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.directEnhanceByUserId(
        new Gs2Enhance.DirectEnhanceByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withUserId("user-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials([
                new Gs2Enhance.model.Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1),
            ])
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
    const acquireExperience = result.getAcquireExperience();
    const bonusRate = result.getBonusRate();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.direct_enhance_by_user_id(
        enhance.DirectEnhanceByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('rate-0001')
            .with_user_id('user-0001')
            .with_target_item_set_id('item-set-0001')
            .with_materials([
                enhance.Material()
                    .with_material_item_set_id('material-0001')
                    .with_count(1),
            ])
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
    acquire_experience = result.acquire_experience
    bonus_rate = result.bonus_rate
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.direct_enhance_by_user_id({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    userId="user-0001",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.direct_enhance_by_user_id_async({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    userId="user-0001",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```



---

### unleash

Perform unleash

Used for enhancement processing to raise the grade of the resource managed by GS2-Grade.
In particular, it is used for the type of unleash that raises the level cap by consuming the same type of item as a material.

Instead of consuming the specified material, the grade of the resource to be unleashed can be increased by 1.
Even if the material resource has a resource such as experience value, the resource will not be inherited.
If inheritance is required, the resource must be converted to a resource for inheritance in advance.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| targetItemSetId | string |  | ✓|  |  ~ 1024 chars | GRN for the Item Set subject to limit break |
| materials | List&lt;string&gt; |  | | [] | 0 ~ 1000 items | List of materials that break the limit (used when the grade entry type is "Simple") |
| recipeName | string |  | |  |  ~ 128 chars | Name of the recipe to use (required when the grade entry type is "Recipe") |
| recipeMaterials | [List&lt;UnleashMaterialSelection&gt;](#unleashmaterialselection) |  | | [] | 0 ~ 10 items | Item sets assigned to each individual material of the recipe (used when the grade entry type is "Recipe") |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [UnleashRateModel](#unleashratemodel) | Unleash Rate Model |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to perform the enhancement process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.Unleash(
    &enhance.UnleashRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("rate-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetItemSetId: pointy.String("item-set-0001"),
        Materials: []*string{
            pointy.String("item-set-0002"),
            pointy.String("item-set-0003"),
        },
        RecipeName: nil,
        RecipeMaterials: nil,
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UnleashRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->unleash(
        (new UnleashRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("rate-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetItemSetId("item-set-0001")
            ->withMaterials([
                "item-set-0002",
                "item-set-0003",
            ])
            ->withRecipeName(null)
            ->withRecipeMaterials(null)
            ->withConfig(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UnleashRequest;
import io.gs2.enhance.result.UnleashResult;

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

try {
    UnleashResult result = client.unleash(
        new UnleashRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withAccessToken("accessToken-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials(Arrays.asList(
                "item-set-0002",
                "item-set-0003"
            ))
            .withRecipeName(null)
            .withRecipeMaterials(null)
            .withConfig(null)
    );
    UnleashRateModel item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.UnleashResult> asyncResult = null;
yield return client.Unleash(
    new Gs2.Gs2Enhance.Request.UnleashRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("rate-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetItemSetId("item-set-0001")
        .WithMaterials(new string[] {
            "item-set-0002",
            "item-set-0003",
        })
        .WithRecipeName(null)
        .WithRecipeMaterials(null)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.unleash(
        new Gs2Enhance.UnleashRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withAccessToken("accessToken-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials([
                "item-set-0002",
                "item-set-0003",
            ])
            .withRecipeName(null)
            .withRecipeMaterials(null)
            .withConfig(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.unleash(
        enhance.UnleashRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('rate-0001')
            .with_access_token('accessToken-0001')
            .with_target_item_set_id('item-set-0001')
            .with_materials([
                'item-set-0002',
                'item-set-0003',
            ])
            .with_recipe_name(None)
            .with_recipe_materials(None)
            .with_config(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.unleash({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    accessToken="accessToken-0001",
    targetItemSetId="item-set-0001",
    materials={
        "item-set-0002",
        "item-set-0003"
    },
    recipeName=nil,
    recipeMaterials=nil,
    config=nil,
})

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

result = api_result.result
item = result.item;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.unleash_async({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    accessToken="accessToken-0001",
    targetItemSetId="item-set-0001",
    materials={
        "item-set-0002",
        "item-set-0003"
    },
    recipeName=nil,
    recipeMaterials=nil,
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```



---

### unleashByUserId

Perform unleash by User ID

Used for enhancement processing to raise the grade of the resource managed by GS2-Grade.
In particular, it is used for the type of unleash that raises the level cap by consuming the same type of item as a material.

Instead of consuming the specified material, the grade of the resource to be unleashed can be increased by 1.
Even if the material resource has a resource such as experience value, the resource will not be inherited.
If inheritance is required, the resource must be converted to a resource for inheritance in advance.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| targetItemSetId | string |  | ✓|  |  ~ 1024 chars | GRN for the Item Set subject to limit break |
| materials | List&lt;string&gt; |  | | [] | 0 ~ 1000 items | List of materials that break the limit (used when the grade entry type is "Simple") |
| recipeName | string |  | |  |  ~ 128 chars | Name of the recipe to use (required when the grade entry type is "Recipe") |
| recipeMaterials | [List&lt;UnleashMaterialSelection&gt;](#unleashmaterialselection) |  | | [] | 0 ~ 10 items | Item sets assigned to each individual material of the recipe (used when the grade entry type is "Recipe") |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [UnleashRateModel](#unleashratemodel) | Unleash Rate Model |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to perform the enhancement process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.UnleashByUserId(
    &enhance.UnleashByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("rate-0001"),
        UserId: pointy.String("user-0001"),
        TargetItemSetId: pointy.String("item-set-0001"),
        Materials: []*string{
            pointy.String("item-set-0002"),
            pointy.String("item-set-0003"),
        },
        RecipeName: nil,
        RecipeMaterials: nil,
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UnleashByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->unleashByUserId(
        (new UnleashByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("rate-0001")
            ->withUserId("user-0001")
            ->withTargetItemSetId("item-set-0001")
            ->withMaterials([
                "item-set-0002",
                "item-set-0003",
            ])
            ->withRecipeName(null)
            ->withRecipeMaterials(null)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UnleashByUserIdRequest;
import io.gs2.enhance.result.UnleashByUserIdResult;

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

try {
    UnleashByUserIdResult result = client.unleashByUserId(
        new UnleashByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withUserId("user-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials(Arrays.asList(
                "item-set-0002",
                "item-set-0003"
            ))
            .withRecipeName(null)
            .withRecipeMaterials(null)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    UnleashRateModel item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.UnleashByUserIdResult> asyncResult = null;
yield return client.UnleashByUserId(
    new Gs2.Gs2Enhance.Request.UnleashByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("rate-0001")
        .WithUserId("user-0001")
        .WithTargetItemSetId("item-set-0001")
        .WithMaterials(new string[] {
            "item-set-0002",
            "item-set-0003",
        })
        .WithRecipeName(null)
        .WithRecipeMaterials(null)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.unleashByUserId(
        new Gs2Enhance.UnleashByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("rate-0001")
            .withUserId("user-0001")
            .withTargetItemSetId("item-set-0001")
            .withMaterials([
                "item-set-0002",
                "item-set-0003",
            ])
            .withRecipeName(null)
            .withRecipeMaterials(null)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.unleash_by_user_id(
        enhance.UnleashByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('rate-0001')
            .with_user_id('user-0001')
            .with_target_item_set_id('item-set-0001')
            .with_materials([
                'item-set-0002',
                'item-set-0003',
            ])
            .with_recipe_name(None)
            .with_recipe_materials(None)
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.unleash_by_user_id({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    userId="user-0001",
    targetItemSetId="item-set-0001",
    materials={
        "item-set-0002",
        "item-set-0003"
    },
    recipeName=nil,
    recipeMaterials=nil,
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.unleash_by_user_id_async({
    namespaceName="namespace-0001",
    rateName="rate-0001",
    userId="user-0001",
    targetItemSetId="item-set-0001",
    materials={
        "item-set-0002",
        "item-set-0003"
    },
    recipeName=nil,
    recipeMaterials=nil,
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```



---

### createProgressByUserId

Start enhancement by User ID

Creates a progress record for a 2-phase enhancement flow.
Validates the target item set and materials against the rate model, calculates the experience to be gained from the materials, and draws a bonus rate from the probability table.
The calculated experience and bonus rate are stored in the progress record for later use when the enhancement is completed via the End API.
If force is true, any existing progress for the user will be discarded and replaced.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>The name of the Enhancement Rate Model that defines the parameters for this enhancement operation. References the model that specifies the target inventory, material inventory, experience hierarchy, and bonus rates. |
| targetItemSetId | string |  | ✓|  |  ~ 1024 chars | GRN of the Item Set to be enhanced |
| materials | [List&lt;Material&gt;](#material) |  | |  | 0 ~ 10 items | List of materials |
| force | bool |  | | false |  | If there is an enhancement that has already been started, it can be discarded and started, or |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Progress](#progress) | Progress information for the enhancement currently in the running |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CreateProgressByUserId(
    &enhance.CreateProgressByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RateName: pointy.String("character-level"),
        TargetItemSetId: pointy.String("item-set-0001"),
        Materials: []enhance.Material{
            enhance.Material{
                MaterialItemSetId: pointy.String("material-0001"),
                Count: pointy.Int32(1),
            },
        },
        Force: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CreateProgressByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->createProgressByUserId(
        (new CreateProgressByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRateName("character-level")
            ->withTargetItemSetId("item-set-0001")
            ->withMaterials([
                (new Material())
                    ->withMaterialItemSetId("material-0001")
                    ->withCount(1),
            ])
            ->withForce(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CreateProgressByUserIdRequest;
import io.gs2.enhance.result.CreateProgressByUserIdResult;

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

try {
    CreateProgressByUserIdResult result = client.createProgressByUserId(
        new CreateProgressByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRateName("character-level")
            .withTargetItemSetId("item-set-0001")
            .withMaterials(Arrays.asList(
                new Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1)
            ))
            .withForce(null)
            .withTimeOffsetToken(null)
    );
    Progress item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CreateProgressByUserIdResult> asyncResult = null;
yield return client.CreateProgressByUserId(
    new Gs2.Gs2Enhance.Request.CreateProgressByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRateName("character-level")
        .WithTargetItemSetId("item-set-0001")
        .WithMaterials(new Gs2.Gs2Enhance.Model.Material[] {
            new Gs2.Gs2Enhance.Model.Material()
                .WithMaterialItemSetId("material-0001")
                .WithCount(1),
        })
        .WithForce(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.createProgressByUserId(
        new Gs2Enhance.CreateProgressByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRateName("character-level")
            .withTargetItemSetId("item-set-0001")
            .withMaterials([
                new Gs2Enhance.model.Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1),
            ])
            .withForce(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.create_progress_by_user_id(
        enhance.CreateProgressByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_rate_name('character-level')
            .with_target_item_set_id('item-set-0001')
            .with_materials([
                enhance.Material()
                    .with_material_item_set_id('material-0001')
                    .with_count(1),
            ])
            .with_force(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.create_progress_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rateName="character-level",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    force=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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.create_progress_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rateName="character-level",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    force=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;

```



---

### getProgress

Retrieve running enhancements

Retrieves the progress information of the enhancement currently in progress for the authenticated user.
The progress record contains the rate name, target item set, materials, calculated experience, and drawn bonus rate that were determined at the start of the enhancement.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Progress](#progress) | Progress information for the enhancement currently in the running |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetProgress(
    &enhance.GetProgressRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetProgressRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getProgress(
        (new GetProgressRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetProgressRequest;
import io.gs2.enhance.result.GetProgressResult;

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

try {
    GetProgressResult result = client.getProgress(
        new GetProgressRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    Progress item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetProgressResult> asyncResult = null;
yield return client.GetProgress(
    new Gs2.Gs2Enhance.Request.GetProgressRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getProgress(
        new Gs2Enhance.GetProgressRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.get_progress(
        enhance.GetProgressRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### getProgressByUserId

Get running enhancements by User ID

Retrieves the progress information of the enhancement currently in progress for the specified user.
The progress record contains the rate name, target item set, materials, calculated experience, and drawn bonus rate that were determined at the start of the enhancement.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Progress](#progress) | Progress information for the enhancement currently in the running |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetProgressByUserId(
    &enhance.GetProgressByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetProgressByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getProgressByUserId(
        (new GetProgressByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetProgressByUserIdRequest;
import io.gs2.enhance.result.GetProgressByUserIdResult;

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

try {
    GetProgressByUserIdResult result = client.getProgressByUserId(
        new GetProgressByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Progress item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetProgressByUserIdResult> asyncResult = null;
yield return client.GetProgressByUserId(
    new Gs2.Gs2Enhance.Request.GetProgressByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getProgressByUserId(
        new Gs2Enhance.GetProgressByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.get_progress_by_user_id(
        enhance.GetProgressByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### start

Start enhancement

Initiates a 2-phase enhancement process for the authenticated user.
Creates a progress record by validating the target and materials against the rate model, calculating experience, and drawing a bonus rate.
A transaction (transaction) is issued to consume the specified materials.
If force is true, any existing progress for the user will be discarded and replaced.
After materials are consumed, call the End API to complete the enhancement and grant the calculated experience.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>The name of the Enhancement Rate Model that defines the parameters for this enhancement operation. References the model that specifies the target inventory, material inventory, experience hierarchy, and bonus rates. |
| targetItemSetId | string |  | ✓|  |  ~ 1024 chars | GRN of the Item Set to be enhanced |
| materials | [List&lt;Material&gt;](#material) |  | |  | 0 ~ 10 items | List of materials |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| force | bool |  | | false |  | If there is an enhancement that has already been started, it can be discarded and started, or |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |

#### Result

|  | Type | Description |
| --- | --- | --- |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to execute the enhancement initiation process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.Start(
    &enhance.StartRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
        TargetItemSetId: pointy.String("item-set-0001"),
        Materials: []enhance.Material{
            enhance.Material{
                MaterialItemSetId: pointy.String("material-0001"),
                Count: pointy.Int32(1),
            },
        },
        AccessToken: pointy.String("accessToken-0001"),
        Force: nil,
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\StartRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->start(
        (new StartRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
            ->withTargetItemSetId("item-set-0001")
            ->withMaterials([
                (new Material())
                    ->withMaterialItemSetId("material-0001")
                    ->withCount(1),
            ])
            ->withAccessToken("accessToken-0001")
            ->withForce(null)
            ->withConfig(null)
    );
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.StartRequest;
import io.gs2.enhance.result.StartResult;

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

try {
    StartResult result = client.start(
        new StartRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withTargetItemSetId("item-set-0001")
            .withMaterials(Arrays.asList(
                new Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1)
            ))
            .withAccessToken("accessToken-0001")
            .withForce(null)
            .withConfig(null)
    );
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.StartResult> asyncResult = null;
yield return client.Start(
    new Gs2.Gs2Enhance.Request.StartRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level")
        .WithTargetItemSetId("item-set-0001")
        .WithMaterials(new Gs2.Gs2Enhance.Model.Material[] {
            new Gs2.Gs2Enhance.Model.Material()
                .WithMaterialItemSetId("material-0001")
                .WithCount(1),
        })
        .WithAccessToken("accessToken-0001")
        .WithForce(null)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.start(
        new Gs2Enhance.StartRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withTargetItemSetId("item-set-0001")
            .withMaterials([
                new Gs2Enhance.model.Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1),
            ])
            .withAccessToken("accessToken-0001")
            .withForce(null)
            .withConfig(null)
    );
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.start(
        enhance.StartRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
            .with_target_item_set_id('item-set-0001')
            .with_materials([
                enhance.Material()
                    .with_material_item_set_id('material-0001')
                    .with_count(1),
            ])
            .with_access_token('accessToken-0001')
            .with_force(None)
            .with_config(None)
    )
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.start({
    namespaceName="namespace-0001",
    rateName="character-level",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    accessToken="accessToken-0001",
    force=nil,
    config=nil,
})

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

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.start_async({
    namespaceName="namespace-0001",
    rateName="character-level",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    accessToken="accessToken-0001",
    force=nil,
    config=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
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```



---

### startByUserId

Start enhancement by User ID

Initiates a 2-phase enhancement process for the specified user.
Creates a progress record by validating the target and materials against the rate model, calculating experience, and drawing a bonus rate.
A transaction (transaction) is issued to consume the specified materials.
If force is true, any existing progress for the user will be discarded and replaced.
After materials are consumed, call the End API to complete the enhancement and grant the calculated experience.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>The name of the Enhancement Rate Model that defines the parameters for this enhancement operation. References the model that specifies the target inventory, material inventory, experience hierarchy, and bonus rates. |
| targetItemSetId | string |  | ✓|  |  ~ 1024 chars | GRN of the Item Set to be enhanced |
| materials | [List&lt;Material&gt;](#material) |  | |  | 0 ~ 10 items | List of materials |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| force | bool |  | | false |  | If there is an enhancement that has already been started, it can be discarded and started, or |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to execute the enhancement initiation process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.StartByUserId(
    &enhance.StartByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
        TargetItemSetId: pointy.String("item-set-0001"),
        Materials: []enhance.Material{
            enhance.Material{
                MaterialItemSetId: pointy.String("material-0001"),
                Count: pointy.Int32(1),
            },
        },
        UserId: pointy.String("user-0001"),
        Force: nil,
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\StartByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->startByUserId(
        (new StartByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
            ->withTargetItemSetId("item-set-0001")
            ->withMaterials([
                (new Material())
                    ->withMaterialItemSetId("material-0001")
                    ->withCount(1),
            ])
            ->withUserId("user-0001")
            ->withForce(null)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.StartByUserIdRequest;
import io.gs2.enhance.result.StartByUserIdResult;

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

try {
    StartByUserIdResult result = client.startByUserId(
        new StartByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withTargetItemSetId("item-set-0001")
            .withMaterials(Arrays.asList(
                new Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1)
            ))
            .withUserId("user-0001")
            .withForce(null)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.StartByUserIdResult> asyncResult = null;
yield return client.StartByUserId(
    new Gs2.Gs2Enhance.Request.StartByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level")
        .WithTargetItemSetId("item-set-0001")
        .WithMaterials(new Gs2.Gs2Enhance.Model.Material[] {
            new Gs2.Gs2Enhance.Model.Material()
                .WithMaterialItemSetId("material-0001")
                .WithCount(1),
        })
        .WithUserId("user-0001")
        .WithForce(null)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.startByUserId(
        new Gs2Enhance.StartByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withTargetItemSetId("item-set-0001")
            .withMaterials([
                new Gs2Enhance.model.Material()
                    .withMaterialItemSetId("material-0001")
                    .withCount(1),
            ])
            .withUserId("user-0001")
            .withForce(null)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.start_by_user_id(
        enhance.StartByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
            .with_target_item_set_id('item-set-0001')
            .with_materials([
                enhance.Material()
                    .with_material_item_set_id('material-0001')
                    .with_count(1),
            ])
            .with_user_id('user-0001')
            .with_force(None)
            .with_config(None)
            .with_time_offset_token(None)
    )
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.start_by_user_id({
    namespaceName="namespace-0001",
    rateName="character-level",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    userId="user-0001",
    force=nil,
    config=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.start_by_user_id_async({
    namespaceName="namespace-0001",
    rateName="character-level",
    targetItemSetId="item-set-0001",
    materials={
        {
            material_item_set_id="material-0001",
            count=1,
        }
    },
    userId="user-0001",
    force=nil,
    config=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
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

```



---

### end

Complete enhancement

Completes the 2-phase enhancement process for the authenticated user.
Retrieves the progress record created during the Start phase, which contains the pre-calculated experience and bonus rate.
A transaction (transaction) is issued to grant the calculated experience (with bonus rate applied) to the target item.
The progress record is deleted after the enhancement is completed.
The response includes the acquired experience amount and the bonus rate that was applied.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Progress](#progress) | progress information for enhancement |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to execute the reward granting process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |
| acquireExperience | long | Amount of experience gained |
| bonusRate | float | Experience bonus multiplier (1.0 = no bonus) |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.End(
    &enhance.EndRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
acquireExperience := result.AcquireExperience
bonusRate := result.BonusRate

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\EndRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->end(
        (new EndRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withConfig(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
    $acquireExperience = $result->getAcquireExperience();
    $bonusRate = $result->getBonusRate();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.EndRequest;
import io.gs2.enhance.result.EndResult;

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

try {
    EndResult result = client.end(
        new EndRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withConfig(null)
    );
    Progress item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
    long acquireExperience = result.getAcquireExperience();
    float bonusRate = result.getBonusRate();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.EndResult> asyncResult = null;
yield return client.End(
    new Gs2.Gs2Enhance.Request.EndRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
var acquireExperience = result.AcquireExperience;
var bonusRate = result.BonusRate;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.end(
        new Gs2Enhance.EndRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withConfig(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
    const acquireExperience = result.getAcquireExperience();
    const bonusRate = result.getBonusRate();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.end(
        enhance.EndRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_config(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
    acquire_experience = result.acquire_experience
    bonus_rate = result.bonus_rate
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.end({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    config=nil,
})

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

result = api_result.result
item = result.item;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.end_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```



---

### endByUserId

Complete enhancement by User ID

Completes the 2-phase enhancement process for the specified user.
Retrieves the progress record created during the Start phase, which contains the pre-calculated experience and bonus rate.
A transaction (transaction) is issued to grant the calculated experience (with bonus rate applied) to the target item.
The progress record is deleted after the enhancement is completed.
The response includes the acquired experience amount and the bonus rate that was applied.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| config | [List&lt;Config&gt;](#config) |  | | [] | 0 ~ 32 items | Configuration values applied to transaction variables |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Progress](#progress) | progress information for enhancement |
| transactionId | string | Issued transaction ID |
| stampSheet | string | Stamp sheet used to execute the reward granting process |
| stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
| autoRunStampSheet | bool? | Whether automatic transaction execution is enabled |
| atomicCommit | bool? | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | [TransactionResult](#transactionresult) | Transaction Execution Result |
| acquireExperience | long | Amount of experience gained |
| bonusRate | float | Experience bonus multiplier (1.0 = no bonus) |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.EndByUserId(
    &enhance.EndByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
acquireExperience := result.AcquireExperience
bonusRate := result.BonusRate

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\EndByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->endByUserId(
        (new EndByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
    $acquireExperience = $result->getAcquireExperience();
    $bonusRate = $result->getBonusRate();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.EndByUserIdRequest;
import io.gs2.enhance.result.EndByUserIdResult;

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

try {
    EndByUserIdResult result = client.endByUserId(
        new EndByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    Progress item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
    long acquireExperience = result.getAcquireExperience();
    float bonusRate = result.getBonusRate();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.EndByUserIdResult> asyncResult = null;
yield return client.EndByUserId(
    new Gs2.Gs2Enhance.Request.EndByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
var acquireExperience = result.AcquireExperience;
var bonusRate = result.BonusRate;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.endByUserId(
        new Gs2Enhance.EndByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
    const acquireExperience = result.getAcquireExperience();
    const bonusRate = result.getBonusRate();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.end_by_user_id(
        enhance.EndByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
    acquire_experience = result.acquire_experience
    bonus_rate = result.bonus_rate
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.end_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.end_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
acquireExperience = result.acquireExperience;
bonusRate = result.bonusRate;

```



---

### deleteProgress

Delete running enhancement

Deletes the progress record of the enhancement currently in progress for the authenticated user.
This cancels the ongoing 2-phase enhancement, discarding the pre-calculated experience and bonus rate.
Materials that were already consumed during the Start phase are not automatically refunded.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Progress](#progress) | Progress information for enhancement |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DeleteProgress(
    &enhance.DeleteProgressRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DeleteProgressRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->deleteProgress(
        (new DeleteProgressRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DeleteProgressRequest;
import io.gs2.enhance.result.DeleteProgressResult;

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

try {
    DeleteProgressResult result = client.deleteProgress(
        new DeleteProgressRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    Progress item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DeleteProgressResult> asyncResult = null;
yield return client.DeleteProgress(
    new Gs2.Gs2Enhance.Request.DeleteProgressRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.deleteProgress(
        new Gs2Enhance.DeleteProgressRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.delete_progress(
        enhance.DeleteProgressRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### deleteProgressByUserId

Delete running enhancement by User ID

Deletes the progress record of the enhancement currently in progress for the specified user.
This cancels the ongoing 2-phase enhancement, discarding the pre-calculated experience and bonus rate.
Materials that were already consumed during the Start phase are not automatically refunded.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Progress](#progress) | Progress information for enhancement |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DeleteProgressByUserId(
    &enhance.DeleteProgressByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DeleteProgressByUserIdRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->deleteProgressByUserId(
        (new DeleteProgressByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DeleteProgressByUserIdRequest;
import io.gs2.enhance.result.DeleteProgressByUserIdResult;

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

try {
    DeleteProgressByUserIdResult result = client.deleteProgressByUserId(
        new DeleteProgressByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Progress item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DeleteProgressByUserIdResult> asyncResult = null;
yield return client.DeleteProgressByUserId(
    new Gs2.Gs2Enhance.Request.DeleteProgressByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.deleteProgressByUserId(
        new Gs2Enhance.DeleteProgressByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.delete_progress_by_user_id(
        enhance.DeleteProgressByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### describeRateModels

List Enhancement Rate Models

Retrieves the list of currently active (published) Enhancement Rate Models in the specified Namespace.
Each Rate Model defines the enhancement configuration including the target inventory model, material inventory model, experience hierarchy, experience suffix, and bonus rates.
Only models that have been activated via the CurrentRateMaster are returned.


#### Request

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

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;RateModel&gt;](#ratemodel) | List of Enhancement Rate Models |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DescribeRateModels(
    &enhance.DescribeRateModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DescribeRateModelsRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->describeRateModels(
        (new DescribeRateModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeRateModelsRequest;
import io.gs2.enhance.result.DescribeRateModelsResult;

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

try {
    DescribeRateModelsResult result = client.describeRateModels(
        new DescribeRateModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<RateModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DescribeRateModelsResult> asyncResult = null;
yield return client.DescribeRateModels(
    new Gs2.Gs2Enhance.Request.DescribeRateModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.describeRateModels(
        new Gs2Enhance.DescribeRateModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.describe_rate_models(
        enhance.DescribeRateModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.describe_rate_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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

```



---

### getRateModel

Get Enhancement Rate Model

Retrieves the detailed information of a specific currently active Enhancement Rate Model by name.
The returned model includes the target inventory model ID, material inventory model ID, acquire experience suffix, acquire experience hierarchy, experience model ID, and bonus rate definitions.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [RateModel](#ratemodel) | Enhancement Rate Model |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetRateModel(
    &enhance.GetRateModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetRateModelRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getRateModel(
        (new GetRateModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetRateModelRequest;
import io.gs2.enhance.result.GetRateModelResult;

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

try {
    GetRateModelResult result = client.getRateModel(
        new GetRateModelRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    RateModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetRateModelResult> asyncResult = null;
yield return client.GetRateModel(
    new Gs2.Gs2Enhance.Request.GetRateModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getRateModel(
        new Gs2Enhance.GetRateModelRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.get_rate_model(
        enhance.GetRateModelRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### describeUnleashRateModels

List Unleash Rate Models

Retrieves the list of currently active (published) Unleash Rate Models in the specified Namespace.
Each Unleash Rate Model defines the limit break configuration including the target inventory model, grade model, and grade entries that specify materials required for each grade level.
Only models that have been activated via the CurrentRateMaster are returned.


#### Request

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

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;UnleashRateModel&gt;](#unleashratemodel) | List of Unleash Rate Model |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DescribeUnleashRateModels(
    &enhance.DescribeUnleashRateModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DescribeUnleashRateModelsRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->describeUnleashRateModels(
        (new DescribeUnleashRateModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeUnleashRateModelsRequest;
import io.gs2.enhance.result.DescribeUnleashRateModelsResult;

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

try {
    DescribeUnleashRateModelsResult result = client.describeUnleashRateModels(
        new DescribeUnleashRateModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<UnleashRateModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DescribeUnleashRateModelsResult> asyncResult = null;
yield return client.DescribeUnleashRateModels(
    new Gs2.Gs2Enhance.Request.DescribeUnleashRateModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.describeUnleashRateModels(
        new Gs2Enhance.DescribeUnleashRateModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.describe_unleash_rate_models(
        enhance.DescribeUnleashRateModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.describe_unleash_rate_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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

```



---

### getUnleashRateModel

Get Unleash Rate Model

Retrieves the detailed information of a specific currently active Unleash Rate Model by name.
The returned model includes the target inventory model ID, grade model ID, and grade entries that define the material requirements for each grade level of the limit break.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Unleash Rate Model name<br>Unique Unleash Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [UnleashRateModel](#unleashratemodel) | Unleash Rate Model |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetUnleashRateModel(
    &enhance.GetUnleashRateModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetUnleashRateModelRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getUnleashRateModel(
        (new GetUnleashRateModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetUnleashRateModelRequest;
import io.gs2.enhance.result.GetUnleashRateModelResult;

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

try {
    GetUnleashRateModelResult result = client.getUnleashRateModel(
        new GetUnleashRateModelRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    UnleashRateModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetUnleashRateModelResult> asyncResult = null;
yield return client.GetUnleashRateModel(
    new Gs2.Gs2Enhance.Request.GetUnleashRateModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getUnleashRateModel(
        new Gs2Enhance.GetUnleashRateModelRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.get_unleash_rate_model(
        enhance.GetUnleashRateModelRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### exportMaster

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

Exports the current Rate Model Master data (both Enhancement Rate Models and Unleash Rate 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.


#### Request

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

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentRateMaster](#currentratemaster) | Rate Model master data that can be activated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &enhance.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.ExportMasterRequest;
import io.gs2.enhance.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRateMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Enhance.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.exportMaster(
        new Gs2Enhance.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

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


```

**GS2-Script**
```lua

client = gs2('enhance')

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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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;

```



---

### getCurrentRateMaster

Get currently active Rate Model master data

Retrieves the master data of the Rate Models (both Enhancement Rate Models and Unleash Rate Models) that are currently active (published) in the specified Namespace.
This represents the configuration that is actually being used in production, as opposed to the editable master data.


#### Request

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

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentRateMaster](#currentratemaster) | Currently active Rate Model master data |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetCurrentRateMaster(
    &enhance.GetCurrentRateMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetCurrentRateMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getCurrentRateMaster(
        (new GetCurrentRateMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetCurrentRateMasterRequest;
import io.gs2.enhance.result.GetCurrentRateMasterResult;

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

try {
    GetCurrentRateMasterResult result = client.getCurrentRateMaster(
        new GetCurrentRateMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRateMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetCurrentRateMasterResult> asyncResult = null;
yield return client.GetCurrentRateMaster(
    new Gs2.Gs2Enhance.Request.GetCurrentRateMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getCurrentRateMaster(
        new Gs2Enhance.GetCurrentRateMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.get_current_rate_master(
        enhance.GetCurrentRateMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.get_current_rate_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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

```



---

### preUpdateCurrentRateMaster

Update currently active Rate 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 UpdateCurrentRateMaster by passing the token obtained from the upload to reflect the master data.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace 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




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentRateMaster(
    &enhance.PreUpdateCurrentRateMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\PreUpdateCurrentRateMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentRateMaster(
        (new PreUpdateCurrentRateMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.PreUpdateCurrentRateMasterRequest;
import io.gs2.enhance.result.PreUpdateCurrentRateMasterResult;

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

try {
    PreUpdateCurrentRateMasterResult result = client.preUpdateCurrentRateMaster(
        new PreUpdateCurrentRateMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.PreUpdateCurrentRateMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentRateMaster(
    new Gs2.Gs2Enhance.Request.PreUpdateCurrentRateMasterRequest()
        .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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.preUpdateCurrentRateMaster(
        new Gs2Enhance.PreUpdateCurrentRateMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.pre_update_current_rate_master(
        enhance.PreUpdateCurrentRateMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.pre_update_current_rate_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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

```



---

### updateCurrentRateMaster

Update currently active Rate Model master data

Updates and activates (publishes) the master data of the Rate 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.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| mode | string (enum)<br>enum {<br>"direct",<br>"preUpload"<br>}<br> |  | | "direct" |  | Update modedirect: Directly update master data / preUpload: Upload master data and then update /  |
| settings | string | {mode} == "direct" | ✓*|  |  ~ 5242880 bytes (5MB) | Master Data<br>* Required if mode is "direct" |
| uploadToken | string | {mode} == "preUpload" | ✓*|  |  ~ 1024 chars | Token obtained by pre-upload<br>Used to apply the uploaded master data.<br>* Required if mode is "preUpload" |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentRateMaster](#currentratemaster) | Updated master data of the currently active Rate Models |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRateMaster(
    &enhance.UpdateCurrentRateMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2020-08-22\",\n  \"rateModels\": [\n    {\n      \"name\": \"character-friendly\",\n      \"metadata\": \"CHARACTER_FRIENDLY\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":friendly\",\n      \"materialInventoryModelId\": \"grn:inventory:sweet\",\n      \"acquireExperienceHierarchy\": [\n        \"taste\"\n      ],\n      \"experienceModelId\": \"grn:experience:friendly\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        }\n      ]\n    },\n    {\n      \"name\": \"character-level\",\n      \"metadata\": \"CHARACTER_LEVEL\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":level\",\n      \"materialInventoryModelId\": \"grn:inventory:material\",\n      \"acquireExperienceHierarchy\": [\n        \"experience\"\n      ],\n      \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        },\n        {\n          \"rate\": 1.5,\n          \"weight\": 9\n        },\n        {\n          \"rate\": 2,\n          \"weight\": 1\n        }\n      ]\n    }\n  ],\n  \"unleashRateModels\": []\n}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UpdateCurrentRateMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->updateCurrentRateMaster(
        (new UpdateCurrentRateMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2020-08-22\",\n  \"rateModels\": [\n    {\n      \"name\": \"character-friendly\",\n      \"metadata\": \"CHARACTER_FRIENDLY\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":friendly\",\n      \"materialInventoryModelId\": \"grn:inventory:sweet\",\n      \"acquireExperienceHierarchy\": [\n        \"taste\"\n      ],\n      \"experienceModelId\": \"grn:experience:friendly\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        }\n      ]\n    },\n    {\n      \"name\": \"character-level\",\n      \"metadata\": \"CHARACTER_LEVEL\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":level\",\n      \"materialInventoryModelId\": \"grn:inventory:material\",\n      \"acquireExperienceHierarchy\": [\n        \"experience\"\n      ],\n      \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        },\n        {\n          \"rate\": 1.5,\n          \"weight\": 9\n        },\n        {\n          \"rate\": 2,\n          \"weight\": 1\n        }\n      ]\n    }\n  ],\n  \"unleashRateModels\": []\n}")
            ->withUploadToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UpdateCurrentRateMasterRequest;
import io.gs2.enhance.result.UpdateCurrentRateMasterResult;

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

try {
    UpdateCurrentRateMasterResult result = client.updateCurrentRateMaster(
        new UpdateCurrentRateMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2020-08-22\",\n  \"rateModels\": [\n    {\n      \"name\": \"character-friendly\",\n      \"metadata\": \"CHARACTER_FRIENDLY\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":friendly\",\n      \"materialInventoryModelId\": \"grn:inventory:sweet\",\n      \"acquireExperienceHierarchy\": [\n        \"taste\"\n      ],\n      \"experienceModelId\": \"grn:experience:friendly\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        }\n      ]\n    },\n    {\n      \"name\": \"character-level\",\n      \"metadata\": \"CHARACTER_LEVEL\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":level\",\n      \"materialInventoryModelId\": \"grn:inventory:material\",\n      \"acquireExperienceHierarchy\": [\n        \"experience\"\n      ],\n      \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        },\n        {\n          \"rate\": 1.5,\n          \"weight\": 9\n        },\n        {\n          \"rate\": 2,\n          \"weight\": 1\n        }\n      ]\n    }\n  ],\n  \"unleashRateModels\": []\n}")
            .withUploadToken(null)
    );
    CurrentRateMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.UpdateCurrentRateMasterResult> asyncResult = null;
yield return client.UpdateCurrentRateMaster(
    new Gs2.Gs2Enhance.Request.UpdateCurrentRateMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2020-08-22\",\n  \"rateModels\": [\n    {\n      \"name\": \"character-friendly\",\n      \"metadata\": \"CHARACTER_FRIENDLY\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":friendly\",\n      \"materialInventoryModelId\": \"grn:inventory:sweet\",\n      \"acquireExperienceHierarchy\": [\n        \"taste\"\n      ],\n      \"experienceModelId\": \"grn:experience:friendly\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        }\n      ]\n    },\n    {\n      \"name\": \"character-level\",\n      \"metadata\": \"CHARACTER_LEVEL\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":level\",\n      \"materialInventoryModelId\": \"grn:inventory:material\",\n      \"acquireExperienceHierarchy\": [\n        \"experience\"\n      ],\n      \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        },\n        {\n          \"rate\": 1.5,\n          \"weight\": 9\n        },\n        {\n          \"rate\": 2,\n          \"weight\": 1\n        }\n      ]\n    }\n  ],\n  \"unleashRateModels\": []\n}")
        .WithUploadToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.updateCurrentRateMaster(
        new Gs2Enhance.UpdateCurrentRateMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2020-08-22\",\n  \"rateModels\": [\n    {\n      \"name\": \"character-friendly\",\n      \"metadata\": \"CHARACTER_FRIENDLY\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":friendly\",\n      \"materialInventoryModelId\": \"grn:inventory:sweet\",\n      \"acquireExperienceHierarchy\": [\n        \"taste\"\n      ],\n      \"experienceModelId\": \"grn:experience:friendly\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        }\n      ]\n    },\n    {\n      \"name\": \"character-level\",\n      \"metadata\": \"CHARACTER_LEVEL\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":level\",\n      \"materialInventoryModelId\": \"grn:inventory:material\",\n      \"acquireExperienceHierarchy\": [\n        \"experience\"\n      ],\n      \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        },\n        {\n          \"rate\": 1.5,\n          \"weight\": 9\n        },\n        {\n          \"rate\": 2,\n          \"weight\": 1\n        }\n      ]\n    }\n  ],\n  \"unleashRateModels\": []\n}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.update_current_rate_master(
        enhance.UpdateCurrentRateMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2020-08-22",\n  "rateModels": [\n    {\n      "name": "character-friendly",\n      "metadata": "CHARACTER_FRIENDLY",\n      "targetInventoryModelId": "grn:inventory:character",\n      "acquireExperienceSuffix": ":friendly",\n      "materialInventoryModelId": "grn:inventory:sweet",\n      "acquireExperienceHierarchy": [\n        "taste"\n      ],\n      "experienceModelId": "grn:experience:friendly",\n      "bonusRates": [\n        {\n          "rate": 1,\n          "weight": 90\n        }\n      ]\n    },\n    {\n      "name": "character-level",\n      "metadata": "CHARACTER_LEVEL",\n      "targetInventoryModelId": "grn:inventory:character",\n      "acquireExperienceSuffix": ":level",\n      "materialInventoryModelId": "grn:inventory:material",\n      "acquireExperienceHierarchy": [\n        "experience"\n      ],\n      "experienceModelId": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level",\n      "bonusRates": [\n        {\n          "rate": 1,\n          "weight": 90\n        },\n        {\n          "rate": 1.5,\n          "weight": 9\n        },\n        {\n          "rate": 2,\n          "weight": 1\n        }\n      ]\n    }\n  ],\n  "unleashRateModels": []\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.update_current_rate_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2020-08-22\",\n  \"rateModels\": [\n    {\n      \"name\": \"character-friendly\",\n      \"metadata\": \"CHARACTER_FRIENDLY\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":friendly\",\n      \"materialInventoryModelId\": \"grn:inventory:sweet\",\n      \"acquireExperienceHierarchy\": [\n        \"taste\"\n      ],\n      \"experienceModelId\": \"grn:experience:friendly\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        }\n      ]\n    },\n    {\n      \"name\": \"character-level\",\n      \"metadata\": \"CHARACTER_LEVEL\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":level\",\n      \"materialInventoryModelId\": \"grn:inventory:material\",\n      \"acquireExperienceHierarchy\": [\n        \"experience\"\n      ],\n      \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        },\n        {\n          \"rate\": 1.5,\n          \"weight\": 9\n        },\n        {\n          \"rate\": 2,\n          \"weight\": 1\n        }\n      ]\n    }\n  ],\n  \"unleashRateModels\": []\n}",
    uploadToken=nil,
})

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.update_current_rate_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2020-08-22\",\n  \"rateModels\": [\n    {\n      \"name\": \"character-friendly\",\n      \"metadata\": \"CHARACTER_FRIENDLY\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":friendly\",\n      \"materialInventoryModelId\": \"grn:inventory:sweet\",\n      \"acquireExperienceHierarchy\": [\n        \"taste\"\n      ],\n      \"experienceModelId\": \"grn:experience:friendly\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        }\n      ]\n    },\n    {\n      \"name\": \"character-level\",\n      \"metadata\": \"CHARACTER_LEVEL\",\n      \"targetInventoryModelId\": \"grn:inventory:character\",\n      \"acquireExperienceSuffix\": \":level\",\n      \"materialInventoryModelId\": \"grn:inventory:material\",\n      \"acquireExperienceHierarchy\": [\n        \"experience\"\n      ],\n      \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\",\n      \"bonusRates\": [\n        {\n          \"rate\": 1,\n          \"weight\": 90\n        },\n        {\n          \"rate\": 1.5,\n          \"weight\": 9\n        },\n        {\n          \"rate\": 2,\n          \"weight\": 1\n        }\n      ]\n    }\n  ],\n  \"unleashRateModels\": []\n}",
    uploadToken=nil,
})

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

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

result = api_result.result
item = result.item;

```



---

### updateCurrentRateMasterFromGitHub

Update currently active Rate 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.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| checkoutSetting | [GitHubCheckoutSetting](#githubcheckoutsetting) |  | ✓|  |  | Setting for checking out master data from GitHub |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentRateMaster](#currentratemaster) | Updated master data of the currently active Rate Models |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRateMasterFromGitHub(
    &enhance.UpdateCurrentRateMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &enhance.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

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UpdateCurrentRateMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->updateCurrentRateMasterFromGitHub(
        (new UpdateCurrentRateMasterFromGitHubRequest())
            ->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")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UpdateCurrentRateMasterFromGitHubRequest;
import io.gs2.enhance.result.UpdateCurrentRateMasterFromGitHubResult;

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

try {
    UpdateCurrentRateMasterFromGitHubResult result = client.updateCurrentRateMasterFromGitHub(
        new UpdateCurrentRateMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentRateMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.UpdateCurrentRateMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentRateMasterFromGitHub(
    new Gs2.Gs2Enhance.Request.UpdateCurrentRateMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Enhance.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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.updateCurrentRateMasterFromGitHub(
        new Gs2Enhance.UpdateCurrentRateMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Enhance.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);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.update_current_rate_master_from_git_hub(
        enhance.UpdateCurrentRateMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(enhance.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)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.update_current_rate_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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

```



---

### describeRateModelMasters

List Enhancement Rate Model Masters

Retrieves a paginated list of editable Enhancement Rate Model Masters with optional name prefix filtering.
Enhancement Rate Model Masters are the editable definitions for enhancement rate configurations. Changes to masters do not take effect until the master data is activated via the CurrentRateMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| namePrefix | string |  | |  |  ~ 64 chars | Filter by Enhancement Rate 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&lt;RateModelMaster&gt;](#ratemodelmaster) | List of Enhancement Rate Model Master |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DescribeRateModelMasters(
    &enhance.DescribeRateModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DescribeRateModelMastersRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->describeRateModelMasters(
        (new DescribeRateModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeRateModelMastersRequest;
import io.gs2.enhance.result.DescribeRateModelMastersResult;

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

try {
    DescribeRateModelMastersResult result = client.describeRateModelMasters(
        new DescribeRateModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RateModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DescribeRateModelMastersResult> asyncResult = null;
yield return client.DescribeRateModelMasters(
    new Gs2.Gs2Enhance.Request.DescribeRateModelMastersRequest()
        .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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.describeRateModelMasters(
        new Gs2Enhance.DescribeRateModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.describe_rate_model_masters(
        enhance.DescribeRateModelMastersRequest()
            .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)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.describe_rate_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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

```



---

### createRateModelMaster

Create Enhancement Rate Master

Creates a new editable Enhancement Rate Model Master definition.
The rate model defines the target inventory model, material inventory model, experience hierarchy, experience suffix, experience model, and bonus rates.
Bonus rates define the probability of experience multipliers being applied during enhancement.
Changes do not take effect until the master data is activated via the CurrentRateMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| name | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| metadata | string |  | |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| targetInventoryModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for enhancement targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for enhancement. The item to be enhanced must belong to this inventory model. |
| acquireExperienceSuffix | string |  | ✓|  |  ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience<br>A string appended to the item's property ID to form the GS2-Experience property ID where experience is stored. This allows the same item to have multiple experience types (e.g., "level" for character level, "like" for affinity). |
| materialInventoryModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable as enhancement material<br>Specifies the GS2-Inventory inventory model that holds the items usable as enhancement materials. The experience value each material provides is defined in the item model's metadata using the JSON hierarchy specified by acquireExperienceHierarchy. |
| acquireExperienceHierarchy | List&lt;string&gt; |  | |  | 0 ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata<br>GS2-Enhance features a mechanism that works in conjunction with GS2-Inventory to perform enhancements. It sets the experience value when used as enhancement material in JSON format within the ItemModel metadata.<br>For example, if you have metadata like { "aaa": { "bbb": { "experienceValue": 100 } } }, specify [ "aaa", "bbb", "experienceValue" ].<br>Details are explained in the [Microservices Introduction / GS2-Enhance](/microservices/enhance/#enhancement-rate) section. |
| experienceModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Experience Experience Model GRN gained as a result of enhancement<br>Specifies the GS2-Experience experience model where the experience points obtained from enhancement are recorded. The experience is added to the property identified by combining the target item's property ID with the acquireExperienceSuffix. |
| bonusRates | [List&lt;BonusRate&gt;](#bonusrate) |  | |  | 0 ~ 1000 items | Experience gain bonus<br>Defines a weighted lottery for bonus experience multipliers during enhancement. Each entry specifies a multiplier (e.g., 1.5 for 150%) and a draw weight. When enhancement is performed, one entry is selected by weighted lottery to determine whether a "great success" bonus applies to the experience gained. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [RateModelMaster](#ratemodelmaster) | Enhancement Rate Master created |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CreateRateModelMaster(
    &enhance.CreateRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("character-level"),
        Description: nil,
        Metadata: pointy.String("CHARACTER_LEVEL"),
        TargetInventoryModelId: pointy.String("grn:inventory:character"),
        AcquireExperienceSuffix: pointy.String(":level"),
        MaterialInventoryModelId: pointy.String("grn:inventory:material"),
        AcquireExperienceHierarchy: []*string{
            pointy.String("experience"),
        },
        ExperienceModelId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level"),
        BonusRates: []enhance.BonusRate{
            enhance.BonusRate{
                Rate: pointy.Float32(1.0),
                Weight: pointy.Int32(90),
            },
            enhance.BonusRate{
                Rate: pointy.Float32(1.5),
                Weight: pointy.Int32(9),
            },
            enhance.BonusRate{
                Rate: pointy.Float32(2.0),
                Weight: pointy.Int32(1),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CreateRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->createRateModelMaster(
        (new CreateRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("character-level")
            ->withDescription(null)
            ->withMetadata("CHARACTER_LEVEL")
            ->withTargetInventoryModelId("grn:inventory:character")
            ->withAcquireExperienceSuffix(":level")
            ->withMaterialInventoryModelId("grn:inventory:material")
            ->withAcquireExperienceHierarchy([
                "experience",
            ])
            ->withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
            ->withBonusRates([
                (new \Gs2\Enhance\Model\BonusRate())
                    ->withRate(1.0)
                    ->withWeight(90),
                (new \Gs2\Enhance\Model\BonusRate())
                    ->withRate(1.5)
                    ->withWeight(9),
                (new \Gs2\Enhance\Model\BonusRate())
                    ->withRate(2.0)
                    ->withWeight(1),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CreateRateModelMasterRequest;
import io.gs2.enhance.result.CreateRateModelMasterResult;

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

try {
    CreateRateModelMasterResult result = client.createRateModelMaster(
        new CreateRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("character-level")
            .withDescription(null)
            .withMetadata("CHARACTER_LEVEL")
            .withTargetInventoryModelId("grn:inventory:character")
            .withAcquireExperienceSuffix(":level")
            .withMaterialInventoryModelId("grn:inventory:material")
            .withAcquireExperienceHierarchy(Arrays.asList(
                "experience"
            ))
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
            .withBonusRates(Arrays.asList(
                new io.gs2.enhance.model.BonusRate()
                    .withRate(1.0f)
                    .withWeight(90),
                new io.gs2.enhance.model.BonusRate()
                    .withRate(1.5f)
                    .withWeight(9),
                new io.gs2.enhance.model.BonusRate()
                    .withRate(2.0f)
                    .withWeight(1)
            ))
    );
    RateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CreateRateModelMasterResult> asyncResult = null;
yield return client.CreateRateModelMaster(
    new Gs2.Gs2Enhance.Request.CreateRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("character-level")
        .WithDescription(null)
        .WithMetadata("CHARACTER_LEVEL")
        .WithTargetInventoryModelId("grn:inventory:character")
        .WithAcquireExperienceSuffix(":level")
        .WithMaterialInventoryModelId("grn:inventory:material")
        .WithAcquireExperienceHierarchy(new string[] {
            "experience",
        })
        .WithExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
        .WithBonusRates(new Gs2.Gs2Enhance.Model.BonusRate[] {
            new Gs2.Gs2Enhance.Model.BonusRate()
                .WithRate(1.0f)
                .WithWeight(90),
            new Gs2.Gs2Enhance.Model.BonusRate()
                .WithRate(1.5f)
                .WithWeight(9),
            new Gs2.Gs2Enhance.Model.BonusRate()
                .WithRate(2.0f)
                .WithWeight(1),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.createRateModelMaster(
        new Gs2Enhance.CreateRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("character-level")
            .withDescription(null)
            .withMetadata("CHARACTER_LEVEL")
            .withTargetInventoryModelId("grn:inventory:character")
            .withAcquireExperienceSuffix(":level")
            .withMaterialInventoryModelId("grn:inventory:material")
            .withAcquireExperienceHierarchy([
                "experience",
            ])
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
            .withBonusRates([
                new Gs2Enhance.model.BonusRate()
                    .withRate(1.0)
                    .withWeight(90),
                new Gs2Enhance.model.BonusRate()
                    .withRate(1.5)
                    .withWeight(9),
                new Gs2Enhance.model.BonusRate()
                    .withRate(2.0)
                    .withWeight(1),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.create_rate_model_master(
        enhance.CreateRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('character-level')
            .with_description(None)
            .with_metadata('CHARACTER_LEVEL')
            .with_target_inventory_model_id('grn:inventory:character')
            .with_acquire_experience_suffix(':level')
            .with_material_inventory_model_id('grn:inventory:material')
            .with_acquire_experience_hierarchy([
                'experience',
            ])
            .with_experience_model_id('grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level')
            .with_bonus_rates([
                enhance.BonusRate()
                    .with_rate(1.0)
                    .with_weight(90),
                enhance.BonusRate()
                    .with_rate(1.5)
                    .with_weight(9),
                enhance.BonusRate()
                    .with_rate(2.0)
                    .with_weight(1),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.create_rate_model_master({
    namespaceName="namespace-0001",
    name="character-level",
    description=nil,
    metadata="CHARACTER_LEVEL",
    targetInventoryModelId="grn:inventory:character",
    acquireExperienceSuffix=":level",
    materialInventoryModelId="grn:inventory:material",
    acquireExperienceHierarchy={
        "experience"
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level",
    bonusRates={
        {
            rate=1.0,
            weight=90,
        },
        {
            rate=1.5,
            weight=9,
        },
        {
            rate=2.0,
            weight=1,
        }
    },
})

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.create_rate_model_master_async({
    namespaceName="namespace-0001",
    name="character-level",
    description=nil,
    metadata="CHARACTER_LEVEL",
    targetInventoryModelId="grn:inventory:character",
    acquireExperienceSuffix=":level",
    materialInventoryModelId="grn:inventory:material",
    acquireExperienceHierarchy={
        "experience"
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level",
    bonusRates={
        {
            rate=1.0,
            weight=90,
        },
        {
            rate=1.5,
            weight=9,
        },
        {
            rate=2.0,
            weight=1,
        }
    },
})

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;

```



---

### getRateModelMaster

Get Enhancement Rate Master

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


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [RateModelMaster](#ratemodelmaster) | Enhancement Rate Master |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetRateModelMaster(
    &enhance.GetRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getRateModelMaster(
        (new GetRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetRateModelMasterRequest;
import io.gs2.enhance.result.GetRateModelMasterResult;

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

try {
    GetRateModelMasterResult result = client.getRateModelMaster(
        new GetRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    RateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetRateModelMasterResult> asyncResult = null;
yield return client.GetRateModelMaster(
    new Gs2.Gs2Enhance.Request.GetRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getRateModelMaster(
        new Gs2Enhance.GetRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.get_rate_model_master(
        enhance.GetRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### updateRateModelMaster

Update Enhancement Rate Master

Updates the description, metadata, target inventory model, material inventory model, experience hierarchy, experience suffix, experience model, and bonus rates of an existing Enhancement Rate Model Master.
The rate model name cannot be changed after creation.
Changes do not take effect until the master data is re-activated via the CurrentRateMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| metadata | string |  | |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| targetInventoryModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for enhancement targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for enhancement. The item to be enhanced must belong to this inventory model. |
| acquireExperienceSuffix | string |  | ✓|  |  ~ 1024 chars | Suffix to be assigned to the property ID that stores the experience value obtained from GS2-Experience<br>A string appended to the item's property ID to form the GS2-Experience property ID where experience is stored. This allows the same item to have multiple experience types (e.g., "level" for character level, "like" for affinity). |
| materialInventoryModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable as enhancement material<br>Specifies the GS2-Inventory inventory model that holds the items usable as enhancement materials. The experience value each material provides is defined in the item model's metadata using the JSON hierarchy specified by acquireExperienceHierarchy. |
| acquireExperienceHierarchy | List&lt;string&gt; |  | |  | 0 ~ 10 items | Hierarchical structure of JSON data defining acquisition experience values to be stored in ItemModel metadata<br>GS2-Enhance features a mechanism that works in conjunction with GS2-Inventory to perform enhancements. It sets the experience value when used as enhancement material in JSON format within the ItemModel metadata.<br>For example, if you have metadata like { "aaa": { "bbb": { "experienceValue": 100 } } }, specify [ "aaa", "bbb", "experienceValue" ].<br>Details are explained in the [Microservices Introduction / GS2-Enhance](/microservices/enhance/#enhancement-rate) section. |
| experienceModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Experience Experience Model GRN gained as a result of enhancement<br>Specifies the GS2-Experience experience model where the experience points obtained from enhancement are recorded. The experience is added to the property identified by combining the target item's property ID with the acquireExperienceSuffix. |
| bonusRates | [List&lt;BonusRate&gt;](#bonusrate) |  | |  | 0 ~ 1000 items | Experience gain bonus<br>Defines a weighted lottery for bonus experience multipliers during enhancement. Each entry specifies a multiplier (e.g., 1.5 for 150%) and a draw weight. When enhancement is performed, one entry is selected by weighted lottery to determine whether a "great success" bonus applies to the experience gained. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [RateModelMaster](#ratemodelmaster) | Enhancement Rate Master updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.UpdateRateModelMaster(
    &enhance.UpdateRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
        Description: nil,
        Metadata: pointy.String("CHARACTER_LEVEL2"),
        TargetInventoryModelId: pointy.String("grn:inventory:character2"),
        AcquireExperienceSuffix: pointy.String(":level2"),
        MaterialInventoryModelId: pointy.String("grn:inventory:material2"),
        AcquireExperienceHierarchy: []*string{
            pointy.String("experience2"),
        },
        ExperienceModelId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2"),
        BonusRates: []enhance.BonusRate{
            enhance.BonusRate{
                Rate: pointy.Float32(1.05),
                Weight: pointy.Int32(905),
            },
            enhance.BonusRate{
                Rate: pointy.Float32(1.55),
                Weight: pointy.Int32(95),
            },
            enhance.BonusRate{
                Rate: pointy.Float32(2.05),
                Weight: pointy.Int32(15),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UpdateRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->updateRateModelMaster(
        (new UpdateRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
            ->withDescription(null)
            ->withMetadata("CHARACTER_LEVEL2")
            ->withTargetInventoryModelId("grn:inventory:character2")
            ->withAcquireExperienceSuffix(":level2")
            ->withMaterialInventoryModelId("grn:inventory:material2")
            ->withAcquireExperienceHierarchy([
                "experience2",
            ])
            ->withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
            ->withBonusRates([
                (new \Gs2\Enhance\Model\BonusRate())
                    ->withRate(1.05)
                    ->withWeight(905),
                (new \Gs2\Enhance\Model\BonusRate())
                    ->withRate(1.55)
                    ->withWeight(95),
                (new \Gs2\Enhance\Model\BonusRate())
                    ->withRate(2.05)
                    ->withWeight(15),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UpdateRateModelMasterRequest;
import io.gs2.enhance.result.UpdateRateModelMasterResult;

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

try {
    UpdateRateModelMasterResult result = client.updateRateModelMaster(
        new UpdateRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withDescription(null)
            .withMetadata("CHARACTER_LEVEL2")
            .withTargetInventoryModelId("grn:inventory:character2")
            .withAcquireExperienceSuffix(":level2")
            .withMaterialInventoryModelId("grn:inventory:material2")
            .withAcquireExperienceHierarchy(Arrays.asList(
                "experience2"
            ))
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
            .withBonusRates(Arrays.asList(
                new io.gs2.enhance.model.BonusRate()
                    .withRate(1.05f)
                    .withWeight(905),
                new io.gs2.enhance.model.BonusRate()
                    .withRate(1.55f)
                    .withWeight(95),
                new io.gs2.enhance.model.BonusRate()
                    .withRate(2.05f)
                    .withWeight(15)
            ))
    );
    RateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.UpdateRateModelMasterResult> asyncResult = null;
yield return client.UpdateRateModelMaster(
    new Gs2.Gs2Enhance.Request.UpdateRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level")
        .WithDescription(null)
        .WithMetadata("CHARACTER_LEVEL2")
        .WithTargetInventoryModelId("grn:inventory:character2")
        .WithAcquireExperienceSuffix(":level2")
        .WithMaterialInventoryModelId("grn:inventory:material2")
        .WithAcquireExperienceHierarchy(new string[] {
            "experience2",
        })
        .WithExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
        .WithBonusRates(new Gs2.Gs2Enhance.Model.BonusRate[] {
            new Gs2.Gs2Enhance.Model.BonusRate()
                .WithRate(1.05f)
                .WithWeight(905),
            new Gs2.Gs2Enhance.Model.BonusRate()
                .WithRate(1.55f)
                .WithWeight(95),
            new Gs2.Gs2Enhance.Model.BonusRate()
                .WithRate(2.05f)
                .WithWeight(15),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.updateRateModelMaster(
        new Gs2Enhance.UpdateRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withDescription(null)
            .withMetadata("CHARACTER_LEVEL2")
            .withTargetInventoryModelId("grn:inventory:character2")
            .withAcquireExperienceSuffix(":level2")
            .withMaterialInventoryModelId("grn:inventory:material2")
            .withAcquireExperienceHierarchy([
                "experience2",
            ])
            .withExperienceModelId("grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
            .withBonusRates([
                new Gs2Enhance.model.BonusRate()
                    .withRate(1.05)
                    .withWeight(905),
                new Gs2Enhance.model.BonusRate()
                    .withRate(1.55)
                    .withWeight(95),
                new Gs2Enhance.model.BonusRate()
                    .withRate(2.05)
                    .withWeight(15),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.update_rate_model_master(
        enhance.UpdateRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
            .with_description(None)
            .with_metadata('CHARACTER_LEVEL2')
            .with_target_inventory_model_id('grn:inventory:character2')
            .with_acquire_experience_suffix(':level2')
            .with_material_inventory_model_id('grn:inventory:material2')
            .with_acquire_experience_hierarchy([
                'experience2',
            ])
            .with_experience_model_id('grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2')
            .with_bonus_rates([
                enhance.BonusRate()
                    .with_rate(1.05)
                    .with_weight(905),
                enhance.BonusRate()
                    .with_rate(1.55)
                    .with_weight(95),
                enhance.BonusRate()
                    .with_rate(2.05)
                    .with_weight(15),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.update_rate_model_master({
    namespaceName="namespace-0001",
    rateName="character-level",
    description=nil,
    metadata="CHARACTER_LEVEL2",
    targetInventoryModelId="grn:inventory:character2",
    acquireExperienceSuffix=":level2",
    materialInventoryModelId="grn:inventory:material2",
    acquireExperienceHierarchy={
        "experience2"
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2",
    bonusRates={
        {
            rate=1.05,
            weight=905,
        },
        {
            rate=1.55,
            weight=95,
        },
        {
            rate=2.05,
            weight=15,
        }
    },
})

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.update_rate_model_master_async({
    namespaceName="namespace-0001",
    rateName="character-level",
    description=nil,
    metadata="CHARACTER_LEVEL2",
    targetInventoryModelId="grn:inventory:character2",
    acquireExperienceSuffix=":level2",
    materialInventoryModelId="grn:inventory:material2",
    acquireExperienceHierarchy={
        "experience2"
    },
    experienceModelId="grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2",
    bonusRates={
        {
            rate=1.05,
            weight=905,
        },
        {
            rate=1.55,
            weight=95,
        },
        {
            rate=2.05,
            weight=15,
        }
    },
})

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;

```



---

### deleteRateModelMaster

Delete Enhancement Rate Master

Deletes an editable Enhancement Rate Model Master.
This only affects the master data; the currently active (published) model is not affected until the master data is re-activated.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Enhancement Rate Model name<br>Unique Enhancement Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [RateModelMaster](#ratemodelmaster) | Enhancement Rate Model Master deleted |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DeleteRateModelMaster(
    &enhance.DeleteRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DeleteRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->deleteRateModelMaster(
        (new DeleteRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DeleteRateModelMasterRequest;
import io.gs2.enhance.result.DeleteRateModelMasterResult;

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

try {
    DeleteRateModelMasterResult result = client.deleteRateModelMaster(
        new DeleteRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    RateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DeleteRateModelMasterResult> asyncResult = null;
yield return client.DeleteRateModelMaster(
    new Gs2.Gs2Enhance.Request.DeleteRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.deleteRateModelMaster(
        new Gs2Enhance.DeleteRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.delete_rate_model_master(
        enhance.DeleteRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### describeUnleashRateModelMasters

List Unleash Rate Model Masters

Retrieves a paginated list of editable Unleash Rate Model Masters with optional name prefix filtering.
Unleash Rate Model Masters are the editable definitions for limit break rate configurations. Changes to masters do not take effect until the master data is activated via the CurrentRateMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| namePrefix | string |  | |  |  ~ 64 chars | Filter by Unleash Rate 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&lt;UnleashRateModelMaster&gt;](#unleashratemodelmaster) | List of Unleash Rate Model Masters |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DescribeUnleashRateModelMasters(
    &enhance.DescribeUnleashRateModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DescribeUnleashRateModelMastersRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->describeUnleashRateModelMasters(
        (new DescribeUnleashRateModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DescribeUnleashRateModelMastersRequest;
import io.gs2.enhance.result.DescribeUnleashRateModelMastersResult;

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

try {
    DescribeUnleashRateModelMastersResult result = client.describeUnleashRateModelMasters(
        new DescribeUnleashRateModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<UnleashRateModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DescribeUnleashRateModelMastersResult> asyncResult = null;
yield return client.DescribeUnleashRateModelMasters(
    new Gs2.Gs2Enhance.Request.DescribeUnleashRateModelMastersRequest()
        .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;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.describeUnleashRateModelMasters(
        new Gs2Enhance.DescribeUnleashRateModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.describe_unleash_rate_model_masters(
        enhance.DescribeUnleashRateModelMastersRequest()
            .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)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.describe_unleash_rate_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;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

```



---

### createUnleashRateModelMaster

Create Unleash Rate Model Master

Creates a new editable Unleash Rate Model Master definition.
The unleash rate model defines the target inventory model, grade model, and grade entries that specify the materials required to raise each grade level.
Grade entries map grade values to the material requirements needed for limit breaking to that grade.
Changes do not take effect until the master data is activated via the CurrentRateMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| name | string |  | ✓|  |  ~ 128 chars | Unleash Rate Model name<br>Unique Unleash Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| metadata | string |  | |  |  ~ 2048 chars | Metadata<br>Any value can be set for metadata.<br>It does not affect the operation of GS2 in any way, and should be used as a storage location for values used in the game. |
| targetInventoryModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for unleash targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for limit breaking. The item to be unleashed and the duplicate items consumed as material must both belong to this inventory model. |
| gradeModelId | string |  | ✓|  |  ~ 1024 chars | Grade Model GRN<br>Specifies the GS2-Grade grade model that tracks the limit break level of the target item. When a limit break is successfully performed, the item's grade is incremented in this grade model. |
| groupKeyHierarchy | List&lt;string&gt; |  | | [] | 0 ~ 10 items | Hierarchy of the JSON data that stores the group key in the ItemModel metadata<br>The group key classifies item models, such as the equipment slot, and is used by recipes to compare materials with the target.<br>For metadata with a structure like { "unleash": { "group": "weapon" } }, specify [ "unleash", "group" ].<br>The value must be a string. Required when a recipe uses "Same Group" or targetGroupKeys. |
| gradeEntries | [List&lt;UnleashRateEntryModel&gt;](#unleashrateentrymodel) |  | ✓|  | 1 ~ 1000 items | List of Grade Entry<br>Defines the material cost for each grade level of the limit break. Each entry maps a grade value to the number of duplicate items that must be consumed to reach that grade. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [UnleashRateModelMaster](#unleashratemodelmaster) | Unleash Rate Model Master created |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.CreateUnleashRateModelMaster(
    &enhance.CreateUnleashRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("character-level"),
        Description: nil,
        Metadata: pointy.String("CHARACTER_LEVEL"),
        TargetInventoryModelId: pointy.String("grn:inventory:character"),
        GradeModelId: pointy.String("grn:grade:character"),
        GroupKeyHierarchy: []*string{
            pointy.String("unleash"),
            pointy.String("group"),
        },
        GradeEntries: []enhance.UnleashRateEntryModel{
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(1),
                NeedCount: pointy.Int32(2),
            },
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(2),
                NeedCount: pointy.Int32(2),
            },
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(3),
                NeedCount: pointy.Int32(3),
            },
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(4),
                Type: pointy.String("recipe"),
                Recipes: []enhance.UnleashRecipe{
                    enhance.UnleashRecipe{
                        Name: pointy.String("merge"),
                        Materials: []enhance.UnleashMaterial{
                            enhance.UnleashMaterial{
                                Name: pointy.String("same"),
                                MaterialType: pointy.String("individual"),
                                IndividualSetting: enhance.UnleashIndividualMaterialSetting{
                                    MatchType: pointy.String("sameItem"),
                                    GradeCondition: pointy.String("sameAsTarget"),
                                    Count: pointy.Int32(1),
                                },
                            },
                        },
                    },
                    enhance.UnleashRecipe{
                        Name: pointy.String("material"),
                        TargetGroupKeys: []*string{
                            pointy.String("weapon"),
                        },
                        Materials: []enhance.UnleashMaterial{
                            enhance.UnleashMaterial{
                                Name: pointy.String("material"),
                                MaterialType: pointy.String("quantity"),
                                QuantitySetting: enhance.UnleashQuantityMaterialSetting{
                                    MatchType: pointy.String("specified"),
                                    ItemModelId: pointy.String("grn:inventory:material:item:weapon-material"),
                                    Count: pointy.Int32(2),
                                },
                            },
                        },
                    },
                },
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\CreateUnleashRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->createUnleashRateModelMaster(
        (new CreateUnleashRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("character-level")
            ->withDescription(null)
            ->withMetadata("CHARACTER_LEVEL")
            ->withTargetInventoryModelId("grn:inventory:character")
            ->withGradeModelId("grn:grade:character")
            ->withGroupKeyHierarchy([
                "unleash",
                "group",
            ])
            ->withGradeEntries([
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(1)
                    ->withNeedCount(2),
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(2)
                    ->withNeedCount(2),
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(3)
                    ->withNeedCount(3),
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(4)
                    ->withType("recipe")
                    ->withRecipes([
                        (new \Gs2\Enhance\Model\UnleashRecipe())
                            ->withName("merge")
                            ->withMaterials([
                                (new \Gs2\Enhance\Model\UnleashMaterial())
                                    ->withName("same")
                                    ->withMaterialType("individual")
                                    ->withIndividualSetting((new \Gs2\Enhance\Model\UnleashIndividualMaterialSetting())
                                        ->withMatchType("sameItem")
                                        ->withGradeCondition("sameAsTarget")
                                        ->withCount(1)),
                            ]),
                        (new \Gs2\Enhance\Model\UnleashRecipe())
                            ->withName("material")
                            ->withTargetGroupKeys([
                                "weapon",
                            ])
                            ->withMaterials([
                                (new \Gs2\Enhance\Model\UnleashMaterial())
                                    ->withName("material")
                                    ->withMaterialType("quantity")
                                    ->withQuantitySetting((new \Gs2\Enhance\Model\UnleashQuantityMaterialSetting())
                                        ->withMatchType("specified")
                                        ->withItemModelId("grn:inventory:material:item:weapon-material")
                                        ->withCount(2)),
                            ]),
                    ]),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.CreateUnleashRateModelMasterRequest;
import io.gs2.enhance.result.CreateUnleashRateModelMasterResult;

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

try {
    CreateUnleashRateModelMasterResult result = client.createUnleashRateModelMaster(
        new CreateUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("character-level")
            .withDescription(null)
            .withMetadata("CHARACTER_LEVEL")
            .withTargetInventoryModelId("grn:inventory:character")
            .withGradeModelId("grn:grade:character")
            .withGroupKeyHierarchy(Arrays.asList(
                "unleash",
                "group"
            ))
            .withGradeEntries(Arrays.asList(
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(1L)
                    .withNeedCount(2),
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(2L)
                    .withNeedCount(2),
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(3L)
                    .withNeedCount(3),
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(4L)
                    .withType("recipe")
                    .withRecipes(Arrays.asList(
                        new io.gs2.enhance.model.UnleashRecipe()
                            .withName("merge")
                            .withMaterials(Arrays.asList(
                                new io.gs2.enhance.model.UnleashMaterial()
                                    .withName("same")
                                    .withMaterialType("individual")
                                    .withIndividualSetting(new io.gs2.enhance.model.UnleashIndividualMaterialSetting()
                                        .withMatchType("sameItem")
                                        .withGradeCondition("sameAsTarget")
                                        .withCount(1))
                            )),
                        new io.gs2.enhance.model.UnleashRecipe()
                            .withName("material")
                            .withTargetGroupKeys(Arrays.asList(
                                "weapon"
                            ))
                            .withMaterials(Arrays.asList(
                                new io.gs2.enhance.model.UnleashMaterial()
                                    .withName("material")
                                    .withMaterialType("quantity")
                                    .withQuantitySetting(new io.gs2.enhance.model.UnleashQuantityMaterialSetting()
                                        .withMatchType("specified")
                                        .withItemModelId("grn:inventory:material:item:weapon-material")
                                        .withCount(2))
                            ))
                    ))
            ))
    );
    UnleashRateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.CreateUnleashRateModelMasterResult> asyncResult = null;
yield return client.CreateUnleashRateModelMaster(
    new Gs2.Gs2Enhance.Request.CreateUnleashRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("character-level")
        .WithDescription(null)
        .WithMetadata("CHARACTER_LEVEL")
        .WithTargetInventoryModelId("grn:inventory:character")
        .WithGradeModelId("grn:grade:character")
        .WithGroupKeyHierarchy(new string[] {
            "unleash",
            "group",
        })
        .WithGradeEntries(new Gs2.Gs2Enhance.Model.UnleashRateEntryModel[] {
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(1L)
                .WithNeedCount(2),
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(2L)
                .WithNeedCount(2),
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(3L)
                .WithNeedCount(3),
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(4L)
                .WithType("recipe")
                .WithRecipes(new Gs2.Gs2Enhance.Model.UnleashRecipe[] {
                    new Gs2.Gs2Enhance.Model.UnleashRecipe()
                        .WithName("merge")
                        .WithMaterials(new Gs2.Gs2Enhance.Model.UnleashMaterial[] {
                            new Gs2.Gs2Enhance.Model.UnleashMaterial()
                                .WithName("same")
                                .WithMaterialType("individual")
                                .WithIndividualSetting(new Gs2.Gs2Enhance.Model.UnleashIndividualMaterialSetting()
                                    .WithMatchType("sameItem")
                                    .WithGradeCondition("sameAsTarget")
                                    .WithCount(1)),
                        }),
                    new Gs2.Gs2Enhance.Model.UnleashRecipe()
                        .WithName("material")
                        .WithTargetGroupKeys(new string[] {
                            "weapon",
                        })
                        .WithMaterials(new Gs2.Gs2Enhance.Model.UnleashMaterial[] {
                            new Gs2.Gs2Enhance.Model.UnleashMaterial()
                                .WithName("material")
                                .WithMaterialType("quantity")
                                .WithQuantitySetting(new Gs2.Gs2Enhance.Model.UnleashQuantityMaterialSetting()
                                    .WithMatchType("specified")
                                    .WithItemModelId("grn:inventory:material:item:weapon-material")
                                    .WithCount(2)),
                        }),
                }),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.createUnleashRateModelMaster(
        new Gs2Enhance.CreateUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("character-level")
            .withDescription(null)
            .withMetadata("CHARACTER_LEVEL")
            .withTargetInventoryModelId("grn:inventory:character")
            .withGradeModelId("grn:grade:character")
            .withGroupKeyHierarchy([
                "unleash",
                "group",
            ])
            .withGradeEntries([
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(1)
                    .withNeedCount(2),
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(2)
                    .withNeedCount(2),
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(3)
                    .withNeedCount(3),
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(4)
                    .withType("recipe")
                    .withRecipes([
                        new Gs2Enhance.model.UnleashRecipe()
                            .withName("merge")
                            .withMaterials([
                                new Gs2Enhance.model.UnleashMaterial()
                                    .withName("same")
                                    .withMaterialType("individual")
                                    .withIndividualSetting(new Gs2Enhance.model.UnleashIndividualMaterialSetting()
                                        .withMatchType("sameItem")
                                        .withGradeCondition("sameAsTarget")
                                        .withCount(1)),
                            ]),
                        new Gs2Enhance.model.UnleashRecipe()
                            .withName("material")
                            .withTargetGroupKeys([
                                "weapon",
                            ])
                            .withMaterials([
                                new Gs2Enhance.model.UnleashMaterial()
                                    .withName("material")
                                    .withMaterialType("quantity")
                                    .withQuantitySetting(new Gs2Enhance.model.UnleashQuantityMaterialSetting()
                                        .withMatchType("specified")
                                        .withItemModelId("grn:inventory:material:item:weapon-material")
                                        .withCount(2)),
                            ]),
                    ]),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.create_unleash_rate_model_master(
        enhance.CreateUnleashRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('character-level')
            .with_description(None)
            .with_metadata('CHARACTER_LEVEL')
            .with_target_inventory_model_id('grn:inventory:character')
            .with_grade_model_id('grn:grade:character')
            .with_group_key_hierarchy([
                'unleash',
                'group',
            ])
            .with_grade_entries([
                enhance.UnleashRateEntryModel()
                    .with_grade_value(1)
                    .with_need_count(2),
                enhance.UnleashRateEntryModel()
                    .with_grade_value(2)
                    .with_need_count(2),
                enhance.UnleashRateEntryModel()
                    .with_grade_value(3)
                    .with_need_count(3),
                enhance.UnleashRateEntryModel()
                    .with_grade_value(4)
                    .with_type('recipe')
                    .with_recipes([
                        enhance.UnleashRecipe()
                            .with_name('merge')
                            .with_materials([
                                enhance.UnleashMaterial()
                                    .with_name('same')
                                    .with_material_type('individual')
                                    .with_individual_setting(enhance.UnleashIndividualMaterialSetting()
                                        .with_match_type('sameItem')
                                        .with_grade_condition('sameAsTarget')
                                        .with_count(1)),
                            ]),
                        enhance.UnleashRecipe()
                            .with_name('material')
                            .with_target_group_keys([
                                'weapon',
                            ])
                            .with_materials([
                                enhance.UnleashMaterial()
                                    .with_name('material')
                                    .with_material_type('quantity')
                                    .with_quantity_setting(enhance.UnleashQuantityMaterialSetting()
                                        .with_match_type('specified')
                                        .with_item_model_id('grn:inventory:material:item:weapon-material')
                                        .with_count(2)),
                            ]),
                    ]),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.create_unleash_rate_model_master({
    namespaceName="namespace-0001",
    name="character-level",
    description=nil,
    metadata="CHARACTER_LEVEL",
    targetInventoryModelId="grn:inventory:character",
    gradeModelId="grn:grade:character",
    groupKeyHierarchy={
        "unleash",
        "group"
    },
    gradeEntries={
        {
            gradeValue=1,
            needCount=2,
        },
        {
            gradeValue=2,
            needCount=2,
        },
        {
            gradeValue=3,
            needCount=3,
        },
        {
            gradeValue=4,
            type="recipe",
            recipes={
                {
                    name="merge",
                    materials={
                        {
                            name="same",
                            materialType="individual",
                            individualSetting={
                                matchType="sameItem",
                                gradeCondition="sameAsTarget",
                                count=1,
                            },
                        }
                    },
                },
                {
                    name="material",
                    targetGroupKeys={
                        "weapon"
                    },
                    materials={
                        {
                            name="material",
                            materialType="quantity",
                            quantitySetting={
                                matchType="specified",
                                itemModelId="grn:inventory:material:item:weapon-material",
                                count=2,
                            },
                        }
                    },
                }
            },
        }
    },
})

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.create_unleash_rate_model_master_async({
    namespaceName="namespace-0001",
    name="character-level",
    description=nil,
    metadata="CHARACTER_LEVEL",
    targetInventoryModelId="grn:inventory:character",
    gradeModelId="grn:grade:character",
    groupKeyHierarchy={
        "unleash",
        "group"
    },
    gradeEntries={
        {
            gradeValue=1,
            needCount=2,
        },
        {
            gradeValue=2,
            needCount=2,
        },
        {
            gradeValue=3,
            needCount=3,
        },
        {
            gradeValue=4,
            type="recipe",
            recipes={
                {
                    name="merge",
                    materials={
                        {
                            name="same",
                            materialType="individual",
                            individualSetting={
                                matchType="sameItem",
                                gradeCondition="sameAsTarget",
                                count=1,
                            },
                        }
                    },
                },
                {
                    name="material",
                    targetGroupKeys={
                        "weapon"
                    },
                    materials={
                        {
                            name="material",
                            materialType="quantity",
                            quantitySetting={
                                matchType="specified",
                                itemModelId="grn:inventory:material:item:weapon-material",
                                count=2,
                            },
                        }
                    },
                }
            },
        }
    },
})

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;

```



---

### getUnleashRateModelMaster

Get Unleash Rate Model Master

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


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Unleash Rate Model name<br>Unique Unleash Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [UnleashRateModelMaster](#unleashratemodelmaster) | Unleash Rate Model Master |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.GetUnleashRateModelMaster(
    &enhance.GetUnleashRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\GetUnleashRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->getUnleashRateModelMaster(
        (new GetUnleashRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.GetUnleashRateModelMasterRequest;
import io.gs2.enhance.result.GetUnleashRateModelMasterResult;

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

try {
    GetUnleashRateModelMasterResult result = client.getUnleashRateModelMaster(
        new GetUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    UnleashRateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.GetUnleashRateModelMasterResult> asyncResult = null;
yield return client.GetUnleashRateModelMaster(
    new Gs2.Gs2Enhance.Request.GetUnleashRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.getUnleashRateModelMaster(
        new Gs2Enhance.GetUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.get_unleash_rate_model_master(
        enhance.GetUnleashRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---

### updateUnleashRateModelMaster

Update Unleash Rate Model Master

Updates the description, metadata, target inventory model, grade model, and grade entries of an existing Unleash Rate Model Master.
The unleash rate model name cannot be changed after creation.
Changes do not take effect until the master data is re-activated via the CurrentRateMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Unleash Rate Model name<br>Unique Unleash Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| metadata | string |  | |  |  ~ 2048 chars | Metadata<br>Any value can be set for metadata.<br>It does not affect the operation of GS2 in any way, and should be used as a storage location for values used in the game. |
| targetInventoryModelId | string |  | ✓|  |  ~ 1024 chars | GS2-Inventory Inventory Model GRN usable for unleash targets<br>Specifies the GS2-Inventory inventory model that holds the items eligible for limit breaking. The item to be unleashed and the duplicate items consumed as material must both belong to this inventory model. |
| gradeModelId | string |  | ✓|  |  ~ 1024 chars | Grade Model GRN<br>Specifies the GS2-Grade grade model that tracks the limit break level of the target item. When a limit break is successfully performed, the item's grade is incremented in this grade model. |
| groupKeyHierarchy | List&lt;string&gt; |  | | [] | 0 ~ 10 items | Hierarchy of the JSON data that stores the group key in the ItemModel metadata<br>The group key classifies item models, such as the equipment slot, and is used by recipes to compare materials with the target.<br>For metadata with a structure like { "unleash": { "group": "weapon" } }, specify [ "unleash", "group" ].<br>The value must be a string. Required when a recipe uses "Same Group" or targetGroupKeys. |
| gradeEntries | [List&lt;UnleashRateEntryModel&gt;](#unleashrateentrymodel) |  | ✓|  | 1 ~ 1000 items | List of Grade Entry<br>Defines the material cost for each grade level of the limit break. Each entry maps a grade value to the number of duplicate items that must be consumed to reach that grade. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [UnleashRateModelMaster](#unleashratemodelmaster) | Unleash Rate Model Master updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.UpdateUnleashRateModelMaster(
    &enhance.UpdateUnleashRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
        Description: nil,
        Metadata: nil,
        TargetInventoryModelId: pointy.String("grn:inventory:character2"),
        GradeModelId: pointy.String("grn:grade:character2"),
        GroupKeyHierarchy: []*string{
            pointy.String("unleash"),
            pointy.String("slot"),
        },
        GradeEntries: []enhance.UnleashRateEntryModel{
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(1),
                NeedCount: pointy.Int32(3),
            },
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(2),
                NeedCount: pointy.Int32(3),
            },
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(3),
                NeedCount: pointy.Int32(4),
            },
            enhance.UnleashRateEntryModel{
                GradeValue: pointy.Int64(4),
                Type: pointy.String("recipe"),
                Recipes: []enhance.UnleashRecipe{
                    enhance.UnleashRecipe{
                        Name: pointy.String("merge"),
                        Materials: []enhance.UnleashMaterial{
                            enhance.UnleashMaterial{
                                Name: pointy.String("same"),
                                MaterialType: pointy.String("individual"),
                                IndividualSetting: enhance.UnleashIndividualMaterialSetting{
                                    MatchType: pointy.String("sameItem"),
                                    GradeCondition: pointy.String("sameAsTarget"),
                                    Count: pointy.Int32(2),
                                },
                            },
                        },
                    },
                    enhance.UnleashRecipe{
                        Name: pointy.String("material"),
                        TargetGroupKeys: []*string{
                            pointy.String("armor"),
                        },
                        Materials: []enhance.UnleashMaterial{
                            enhance.UnleashMaterial{
                                Name: pointy.String("material"),
                                MaterialType: pointy.String("quantity"),
                                QuantitySetting: enhance.UnleashQuantityMaterialSetting{
                                    MatchType: pointy.String("specified"),
                                    ItemModelId: pointy.String("grn:inventory:material:item:armor-material"),
                                    Count: pointy.Int32(3),
                                },
                            },
                        },
                    },
                },
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\UpdateUnleashRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->updateUnleashRateModelMaster(
        (new UpdateUnleashRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
            ->withDescription(null)
            ->withMetadata(null)
            ->withTargetInventoryModelId("grn:inventory:character2")
            ->withGradeModelId("grn:grade:character2")
            ->withGroupKeyHierarchy([
                "unleash",
                "slot",
            ])
            ->withGradeEntries([
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(1)
                    ->withNeedCount(3),
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(2)
                    ->withNeedCount(3),
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(3)
                    ->withNeedCount(4),
                (new \Gs2\Enhance\Model\UnleashRateEntryModel())
                    ->withGradeValue(4)
                    ->withType("recipe")
                    ->withRecipes([
                        (new \Gs2\Enhance\Model\UnleashRecipe())
                            ->withName("merge")
                            ->withMaterials([
                                (new \Gs2\Enhance\Model\UnleashMaterial())
                                    ->withName("same")
                                    ->withMaterialType("individual")
                                    ->withIndividualSetting((new \Gs2\Enhance\Model\UnleashIndividualMaterialSetting())
                                        ->withMatchType("sameItem")
                                        ->withGradeCondition("sameAsTarget")
                                        ->withCount(2)),
                            ]),
                        (new \Gs2\Enhance\Model\UnleashRecipe())
                            ->withName("material")
                            ->withTargetGroupKeys([
                                "armor",
                            ])
                            ->withMaterials([
                                (new \Gs2\Enhance\Model\UnleashMaterial())
                                    ->withName("material")
                                    ->withMaterialType("quantity")
                                    ->withQuantitySetting((new \Gs2\Enhance\Model\UnleashQuantityMaterialSetting())
                                        ->withMatchType("specified")
                                        ->withItemModelId("grn:inventory:material:item:armor-material")
                                        ->withCount(3)),
                            ]),
                    ]),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.UpdateUnleashRateModelMasterRequest;
import io.gs2.enhance.result.UpdateUnleashRateModelMasterResult;

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

try {
    UpdateUnleashRateModelMasterResult result = client.updateUnleashRateModelMaster(
        new UpdateUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withDescription(null)
            .withMetadata(null)
            .withTargetInventoryModelId("grn:inventory:character2")
            .withGradeModelId("grn:grade:character2")
            .withGroupKeyHierarchy(Arrays.asList(
                "unleash",
                "slot"
            ))
            .withGradeEntries(Arrays.asList(
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(1L)
                    .withNeedCount(3),
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(2L)
                    .withNeedCount(3),
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(3L)
                    .withNeedCount(4),
                new io.gs2.enhance.model.UnleashRateEntryModel()
                    .withGradeValue(4L)
                    .withType("recipe")
                    .withRecipes(Arrays.asList(
                        new io.gs2.enhance.model.UnleashRecipe()
                            .withName("merge")
                            .withMaterials(Arrays.asList(
                                new io.gs2.enhance.model.UnleashMaterial()
                                    .withName("same")
                                    .withMaterialType("individual")
                                    .withIndividualSetting(new io.gs2.enhance.model.UnleashIndividualMaterialSetting()
                                        .withMatchType("sameItem")
                                        .withGradeCondition("sameAsTarget")
                                        .withCount(2))
                            )),
                        new io.gs2.enhance.model.UnleashRecipe()
                            .withName("material")
                            .withTargetGroupKeys(Arrays.asList(
                                "armor"
                            ))
                            .withMaterials(Arrays.asList(
                                new io.gs2.enhance.model.UnleashMaterial()
                                    .withName("material")
                                    .withMaterialType("quantity")
                                    .withQuantitySetting(new io.gs2.enhance.model.UnleashQuantityMaterialSetting()
                                        .withMatchType("specified")
                                        .withItemModelId("grn:inventory:material:item:armor-material")
                                        .withCount(3))
                            ))
                    ))
            ))
    );
    UnleashRateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.UpdateUnleashRateModelMasterResult> asyncResult = null;
yield return client.UpdateUnleashRateModelMaster(
    new Gs2.Gs2Enhance.Request.UpdateUnleashRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level")
        .WithDescription(null)
        .WithMetadata(null)
        .WithTargetInventoryModelId("grn:inventory:character2")
        .WithGradeModelId("grn:grade:character2")
        .WithGroupKeyHierarchy(new string[] {
            "unleash",
            "slot",
        })
        .WithGradeEntries(new Gs2.Gs2Enhance.Model.UnleashRateEntryModel[] {
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(1L)
                .WithNeedCount(3),
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(2L)
                .WithNeedCount(3),
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(3L)
                .WithNeedCount(4),
            new Gs2.Gs2Enhance.Model.UnleashRateEntryModel()
                .WithGradeValue(4L)
                .WithType("recipe")
                .WithRecipes(new Gs2.Gs2Enhance.Model.UnleashRecipe[] {
                    new Gs2.Gs2Enhance.Model.UnleashRecipe()
                        .WithName("merge")
                        .WithMaterials(new Gs2.Gs2Enhance.Model.UnleashMaterial[] {
                            new Gs2.Gs2Enhance.Model.UnleashMaterial()
                                .WithName("same")
                                .WithMaterialType("individual")
                                .WithIndividualSetting(new Gs2.Gs2Enhance.Model.UnleashIndividualMaterialSetting()
                                    .WithMatchType("sameItem")
                                    .WithGradeCondition("sameAsTarget")
                                    .WithCount(2)),
                        }),
                    new Gs2.Gs2Enhance.Model.UnleashRecipe()
                        .WithName("material")
                        .WithTargetGroupKeys(new string[] {
                            "armor",
                        })
                        .WithMaterials(new Gs2.Gs2Enhance.Model.UnleashMaterial[] {
                            new Gs2.Gs2Enhance.Model.UnleashMaterial()
                                .WithName("material")
                                .WithMaterialType("quantity")
                                .WithQuantitySetting(new Gs2.Gs2Enhance.Model.UnleashQuantityMaterialSetting()
                                    .WithMatchType("specified")
                                    .WithItemModelId("grn:inventory:material:item:armor-material")
                                    .WithCount(3)),
                        }),
                }),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.updateUnleashRateModelMaster(
        new Gs2Enhance.UpdateUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
            .withDescription(null)
            .withMetadata(null)
            .withTargetInventoryModelId("grn:inventory:character2")
            .withGradeModelId("grn:grade:character2")
            .withGroupKeyHierarchy([
                "unleash",
                "slot",
            ])
            .withGradeEntries([
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(1)
                    .withNeedCount(3),
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(2)
                    .withNeedCount(3),
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(3)
                    .withNeedCount(4),
                new Gs2Enhance.model.UnleashRateEntryModel()
                    .withGradeValue(4)
                    .withType("recipe")
                    .withRecipes([
                        new Gs2Enhance.model.UnleashRecipe()
                            .withName("merge")
                            .withMaterials([
                                new Gs2Enhance.model.UnleashMaterial()
                                    .withName("same")
                                    .withMaterialType("individual")
                                    .withIndividualSetting(new Gs2Enhance.model.UnleashIndividualMaterialSetting()
                                        .withMatchType("sameItem")
                                        .withGradeCondition("sameAsTarget")
                                        .withCount(2)),
                            ]),
                        new Gs2Enhance.model.UnleashRecipe()
                            .withName("material")
                            .withTargetGroupKeys([
                                "armor",
                            ])
                            .withMaterials([
                                new Gs2Enhance.model.UnleashMaterial()
                                    .withName("material")
                                    .withMaterialType("quantity")
                                    .withQuantitySetting(new Gs2Enhance.model.UnleashQuantityMaterialSetting()
                                        .withMatchType("specified")
                                        .withItemModelId("grn:inventory:material:item:armor-material")
                                        .withCount(3)),
                            ]),
                    ]),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.update_unleash_rate_model_master(
        enhance.UpdateUnleashRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
            .with_description(None)
            .with_metadata(None)
            .with_target_inventory_model_id('grn:inventory:character2')
            .with_grade_model_id('grn:grade:character2')
            .with_group_key_hierarchy([
                'unleash',
                'slot',
            ])
            .with_grade_entries([
                enhance.UnleashRateEntryModel()
                    .with_grade_value(1)
                    .with_need_count(3),
                enhance.UnleashRateEntryModel()
                    .with_grade_value(2)
                    .with_need_count(3),
                enhance.UnleashRateEntryModel()
                    .with_grade_value(3)
                    .with_need_count(4),
                enhance.UnleashRateEntryModel()
                    .with_grade_value(4)
                    .with_type('recipe')
                    .with_recipes([
                        enhance.UnleashRecipe()
                            .with_name('merge')
                            .with_materials([
                                enhance.UnleashMaterial()
                                    .with_name('same')
                                    .with_material_type('individual')
                                    .with_individual_setting(enhance.UnleashIndividualMaterialSetting()
                                        .with_match_type('sameItem')
                                        .with_grade_condition('sameAsTarget')
                                        .with_count(2)),
                            ]),
                        enhance.UnleashRecipe()
                            .with_name('material')
                            .with_target_group_keys([
                                'armor',
                            ])
                            .with_materials([
                                enhance.UnleashMaterial()
                                    .with_name('material')
                                    .with_material_type('quantity')
                                    .with_quantity_setting(enhance.UnleashQuantityMaterialSetting()
                                        .with_match_type('specified')
                                        .with_item_model_id('grn:inventory:material:item:armor-material')
                                        .with_count(3)),
                            ]),
                    ]),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

api_result = client.update_unleash_rate_model_master({
    namespaceName="namespace-0001",
    rateName="character-level",
    description=nil,
    metadata=nil,
    targetInventoryModelId="grn:inventory:character2",
    gradeModelId="grn:grade:character2",
    groupKeyHierarchy={
        "unleash",
        "slot"
    },
    gradeEntries={
        {
            gradeValue=1,
            needCount=3,
        },
        {
            gradeValue=2,
            needCount=3,
        },
        {
            gradeValue=3,
            needCount=4,
        },
        {
            gradeValue=4,
            type="recipe",
            recipes={
                {
                    name="merge",
                    materials={
                        {
                            name="same",
                            materialType="individual",
                            individualSetting={
                                matchType="sameItem",
                                gradeCondition="sameAsTarget",
                                count=2,
                            },
                        }
                    },
                },
                {
                    name="material",
                    targetGroupKeys={
                        "armor"
                    },
                    materials={
                        {
                            name="material",
                            materialType="quantity",
                            quantitySetting={
                                matchType="specified",
                                itemModelId="grn:inventory:material:item:armor-material",
                                count=3,
                            },
                        }
                    },
                }
            },
        }
    },
})

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

api_result_handler = client.update_unleash_rate_model_master_async({
    namespaceName="namespace-0001",
    rateName="character-level",
    description=nil,
    metadata=nil,
    targetInventoryModelId="grn:inventory:character2",
    gradeModelId="grn:grade:character2",
    groupKeyHierarchy={
        "unleash",
        "slot"
    },
    gradeEntries={
        {
            gradeValue=1,
            needCount=3,
        },
        {
            gradeValue=2,
            needCount=3,
        },
        {
            gradeValue=3,
            needCount=4,
        },
        {
            gradeValue=4,
            type="recipe",
            recipes={
                {
                    name="merge",
                    materials={
                        {
                            name="same",
                            materialType="individual",
                            individualSetting={
                                matchType="sameItem",
                                gradeCondition="sameAsTarget",
                                count=2,
                            },
                        }
                    },
                },
                {
                    name="material",
                    targetGroupKeys={
                        "armor"
                    },
                    materials={
                        {
                            name="material",
                            materialType="quantity",
                            quantitySetting={
                                matchType="specified",
                                itemModelId="grn:inventory:material:item:armor-material",
                                count=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;

```



---

### deleteUnleashRateModelMaster

Delete Unleash Rate Model Master

Deletes an editable Unleash Rate Model Master definition.
This only affects the master data; the currently active (published) model is not affected until the master data is re-activated.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| rateName | string |  | ✓|  |  ~ 128 chars | Unleash Rate Model name<br>Unique Unleash Rate Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [UnleashRateModelMaster](#unleashratemodelmaster) | Unleash Rate Model Master deleted |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance.Gs2EnhanceRestClient{
    Session: &session,
}
result, err := client.DeleteUnleashRateModelMaster(
    &enhance.DeleteUnleashRateModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RateName: pointy.String("character-level"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Enhance\Gs2EnhanceRestClient;
use Gs2\Enhance\Request\DeleteUnleashRateModelMasterRequest;

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

$session->open();

$client = new Gs2EnhanceRestClient(
    $session
);

try {
    $result = $client->deleteUnleashRateModelMaster(
        (new DeleteUnleashRateModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRateName("character-level")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

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.enhance.rest.Gs2EnhanceRestClient;
import io.gs2.enhance.request.DeleteUnleashRateModelMasterRequest;
import io.gs2.enhance.result.DeleteUnleashRateModelMasterResult;

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

try {
    DeleteUnleashRateModelMasterResult result = client.deleteUnleashRateModelMaster(
        new DeleteUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    UnleashRateModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

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 Gs2EnhanceRestClient(session);

AsyncResult<Gs2.Gs2Enhance.Result.DeleteUnleashRateModelMasterResult> asyncResult = null;
yield return client.DeleteUnleashRateModelMaster(
    new Gs2.Gs2Enhance.Request.DeleteUnleashRateModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRateName("character-level"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Enhance from '@/gs2/enhance';

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

try {
    const result = await client.deleteUnleashRateModelMaster(
        new Gs2Enhance.DeleteUnleashRateModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRateName("character-level")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import enhance

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

try:
    result = client.delete_unleash_rate_model_master(
        enhance.DeleteUnleashRateModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rate_name('character-level')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('enhance')

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

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

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('enhance')

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

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

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

result = api_result.result
item = result.item;

```



---



