GS2-Inventory SDK API Reference
Model
Namespace
Namespace
A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.
Therefore, you must create a namespace before you can start using each service.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceId | string | * | ~ 1024 chars | Namespace GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | Transaction Setting Configures distributed transaction processing for inventory operations such as acquiring and consuming items. Supports auto-run mode for seamless execution, atomic commit for consistent multi-resource operations, and async processing for large-scale reward distribution. | ||||
| acquireScript | ScriptSetting | Script setting to be executed when an Items is acquired Script Trigger Reference - acquire | ||||
| overflowScript | ScriptSetting | Script to execute when unable to obtain due to reaching the acquisition limit Script Trigger Reference - overflowDone | ||||
| consumeScript | ScriptSetting | Script to run when consuming Items Script Trigger Reference - consume | ||||
| simpleItemAcquireScript | ScriptSetting | Script setting to be executed when acquiring Simple Items Script Trigger Reference - simpleItemAcquire | ||||
| simpleItemConsumeScript | ScriptSetting | Script to run when consuming Simple Items Script Trigger Reference - simpleItemConsume | ||||
| bigItemAcquireScript | ScriptSetting | Script setting to be executed when acquiring Big Items Script Trigger Reference - bigItemAcquire | ||||
| bigItemConsumeScript | ScriptSetting | Script to run when consuming Big Items Script Trigger Reference - bigItemConsume | ||||
| logSetting | LogSetting | Log Output Settings Specifies the GS2-Log namespace for outputting API request and response logs of inventory operations. Useful for tracking item acquisition, consumption, and capacity changes for debugging and analytics. | ||||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
TransactionSetting
Transaction Setting
Transaction Setting controls how transactions are executed, including their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | false | Whether to automatically execute issued transactions on the server side | |||
| enableAtomicCommit | bool | {enableAutoRun} == true | false | Whether to commit the execution of transactions atomically * Applicable only if enableAutoRun is true | ||
| transactionUseDistributor | bool | {enableAtomicCommit} == true | false | Whether to execute transactions asynchronously * Applicable only if enableAtomicCommit is true | ||
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | false | Whether to execute the commit processing of the script result asynchronously * Applicable only if transactionUseDistributor is true | ||
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | Whether to use GS2-JobQueue to execute the acquire action * Applicable only if enableAtomicCommit is true | ||
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions | ||
| queueNamespaceId | string | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute transactions |
ScriptSetting
Script Setting
In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.
There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script’s execution results to halt API execution or control the API’s response content.
In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.
There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.
Details
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| triggerScriptId | string | ~ 1024 chars | GS2-Script script GRN
executed synchronously when the API is executed Must be specified in GRN format starting with “grn:gs2:”. | |||||||||||
| doneTriggerTargetType | String Enum enum { “none”, “gs2_script”, “aws” } | “none” | How to execute asynchronous scripts Specifies the type of script to use for asynchronous execution. You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
| |||||||||||
| doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-Script script GRN
for asynchronous execution Must be specified in GRN format starting with “grn:gs2:”. * Applicable only if doneTriggerTargetType is “gs2_script” | ||||||||||
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-JobQueue namespace GRN
to execute asynchronous execution scripts If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN. There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason. * Applicable only if doneTriggerTargetType is “gs2_script” |
LogSetting
Log Output Setting
Log Output Settings define how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024 chars | GS2-Log namespace GRN
to output logs Must be specified in GRN format starting with “grn:gs2:”. |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Details
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apiKeyId | string | ✓ | ~ 1024 chars | GitHub API Key GRN | ||||||||||
| repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||||||||||
| sourcePath | string | ✓ | ~ 1024 chars | Master data (JSON) file path | ||||||||||
| referenceType | String Enum enum { “commit_hash”, “branch”, “tag” } | ✓ | Source of code
| |||||||||||
| commitHash | string | {referenceType} == “commit_hash” | ✓* | ~ 1024 chars | Commit hash * Required if referenceType is “commit_hash” | |||||||||
| branchName | string | {referenceType} == “branch” | ✓* | ~ 1024 chars | Branch Name * Required if referenceType is “branch” | |||||||||
| tagName | string | {referenceType} == “tag” | ✓* | ~ 1024 chars | Tag Name * Required if referenceType is “tag” |
Inventory
Inventory
Inventory is like a bag that stores items owned by game players. The bag has a capacity, and the capacity can be expanded by each player.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryId | string | * | ~ 1024 chars | Inventory GRN * Set automatically by the server | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| currentInventoryCapacityUsage | int | 0 | 0 ~ 2147483646 | Capacity Usage The number of inventory slots currently occupied by item sets. Incremented when a new item stack is added (e.g., when allowMultipleStacks creates a new slot) and decremented when an item set is fully consumed or deleted. Cannot exceed currentInventoryMaxCapacity. | ||
| currentInventoryMaxCapacity | int | ✓ | 1 ~ 2147483646 | Maximum Capacity The current maximum number of inventory slots available to this user. Initialized from the inventory model’s initialCapacity and can be expanded up to the model’s maxCapacity through acquire actions or direct API calls. | ||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
ItemSet
Item Set
Item Set represents the possessions stored in the game player’s inventory. Item Set holds the Inventory Model name, Item Model name, quantity held, expiration time, and other details.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemSetId | string | * | ~ 1024 chars | Item Set GRN * Set automatically by the server | ||
| name | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Quantity in Possession The number of items in this stack. Ranges from 1 to the item model’s stacking limit. When items are acquired, this count increases up to the stacking limit; when consumed, it decreases. If count reaches 0, the item set is deleted and the inventory slot is freed. | ||
| referenceOf | List<string> | [] | 0 ~ 24 items | List of References The external references registered on this item set. Used to track which systems are using this item (e.g., equipped as weapon, assigned to formation). Up to 24 references per item set. | ||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display Order A numeric value copied from the item model’s sortValue, used to sort item sets within the inventory for display purposes. Lower values are displayed first. | ||
| expiresAt | long | 0 | Expiration time Unix time, milliseconds | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server |
ReferenceOf
Reference of Possessions
Represents an external reference registered on an item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with active references are protected from consumption or deletion, preventing items in use from being accidentally removed.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| referenceOfId | string | * | ~ 1024 chars | Reference GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Name Identifying the Item Set The UUID name of the item set that this reference is attached to. Used to identify which specific item stack within the inventory is being referenced by an external system. |
SimpleInventory
Simple Inventory
Simple inventory is like a bag that stores Simple Items owned by game players. Simple inventory does not have functions such as a cap on the number of items possessed or the capacity of the inventory, but it can increase or decrease multiple items at once.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryId | string | * | ~ 1024 chars | Simple Inventory GRN * Set automatically by the server | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model Name The name of the simple inventory model that defines the item types for this inventory. Links the user’s simple inventory instance to its model definition. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| simpleItems | List<SimpleItem> | [] | 0 ~ 1000 items | List of Simple Items All item possessions stored in this simple inventory. Multiple items can be acquired or consumed in a single batch operation. Up to 1000 items per simple inventory. | ||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
SimpleItem
Simple Item
Simple Item represents a possession stored in the game player’s inventory. Simple Item has a model name and the quantity possessed.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemId | string | * | ~ 1024 chars | Simple Item GRN * Set automatically by the server | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| count | long | ✓ | 0 ~ 9223372036854775805 | Quantity in Possession The number of this item type held by the user. Unlike standard inventory items, simple items have no stacking limit and the count can be any value within the int64 range. Can be increased or decreased through batch operations along with other simple items. | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
BigInventory
Big Inventory
Big inventory is like a bag that stores huge items owned by the game player. Big inventory is an inventory that can hold a quantity of items beyond the int64 range.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryId | string | * | ~ 1024 chars | Big Inventory GRN * Set automatically by the server | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model Name The name of the big inventory model that defines the item types for this inventory. Links the user’s big inventory instance to its model definition. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| bigItems | List<BigItem> | 0 ~ 1000 items | List of Big Items All big item possessions stored in this big inventory. Each item holds its quantity as a big decimal integer string. Up to 1000 items per big inventory. | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server |
BigItem
Big Item
Big item represents possessions stored in the game player’s Big Inventory. Big Items can hold quantities beyond the range of int64.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemId | string | * | ~ 1024 chars | Big Item GRN * Set automatically by the server | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model Name The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to. | ||
| count | string | ✓ | ~ 1024 chars | Quantity in possession Integer value strings up to 1024 digits | ||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
InventoryModel
Inventory Model
Inventory is like a bag that stores items owned by game players. Inventory can have a set capacity and cannot be owned beyond its capacity.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | * | ~ 1024 chars | Inventory Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| initialCapacity | int | ✓ | 0 ~ 2147483646 | Initial Capacity The number of inventory slots available to a user when the inventory is first created. Each slot can hold one item stack. Users can expand their capacity up to maxCapacity through gameplay actions. | ||
| maxCapacity | int | ✓ | 0 ~ 2147483646 | Maximum Capacity The upper limit of inventory slots that a user can expand to. Capacity cannot be increased beyond this value. When all slots are occupied and items cannot be stacked further, acquisition attempts will fail unless the overflow script handles the excess. | ||
| protectReferencedItem | bool? | false | Protect Referenced Items When enabled, item sets that have references registered (via the referenceOf mechanism) cannot be consumed or deleted. This prevents items that are in use by other systems (e.g., equipped gear, items bound to formations) from being accidentally removed. | |||
| itemModels | List<ItemModel> | [] | 1 ~ 1000 items | List of Item Models The item types that can be stored in this inventory. Each item model defines the stacking and acquisition behavior for one type of item. Up to 1000 item models per inventory model. |
ItemModel
Item Model
Items can be held in groups within a single inventory slot, such as Potion ×99. This grouping of multiple items into one slot is called “stacking,” and a maximum stack size can be set for each item.
The behavior when the stack limit is reached can also be set for each item. Specifically, you can choose one of the following:
- Add a new inventory slot to allow further acquisition
- Prevent further acquisition once the limit is reached
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemModelId | string | * | ~ 1024 chars | Item Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata 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. Details are explained in the Microservices Introduction / GS2-Enhance section. | |||
| stackingLimit | long | ✓ | 1 ~ 9223372036854775805 | Maximum Stackable Quantity The maximum number of this item that can be held in a single inventory slot (stack). When this limit is reached, the behavior depends on the allowMultipleStacks setting: either a new slot is allocated or further acquisition is blocked. | ||
| allowMultipleStacks | bool | ✓ | Allow Multiple Stacks When enabled, if the stacking limit is reached, a new inventory slot is automatically allocated to store additional quantities of this item (consuming additional capacity). When disabled, acquisition is blocked once the stacking limit is reached in the existing slot. | |||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display Order A numeric value used to sort items within the inventory for display purposes. Lower values are displayed first. This value is also copied to ItemSet records to enable consistent ordering of possessed items. |
SimpleInventoryModel
Simple Inventory Model
In a normal InventoryModel, you could limit the amount of items that could be stored in your inventory. Simple Inventory, however, has no such functionality and simply stores the number of items in the inventory.
However, the Simple Inventory provides APIs that allow increasing or decreasing multiple items in a single operation.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | * | ~ 1024 chars | Simple Inventory Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| simpleItemModels | List<SimpleItemModel> | [] | 1 ~ 1000 items | List of Simple Item Models The item types that can be stored in this simple inventory. Unlike standard inventory, simple items have no stacking limits or capacity constraints. Up to 1000 item models per simple inventory model. |
SimpleItemModel
Simple Item Model
ItemModel allowed setting a maximum stackable quantity, enabling implementation where items exceeding a certain number could be split into multiple stacks. SimpleItem does not have such a function and simply stores the number of items in the possession of the item.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemModelId | string | * | ~ 1024 chars | Simple Item Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
BigInventoryModel
Big Inventory Model
In the normal InventoryModel and SimpleInventoryModel, the number of items that can be stored in the inventory is limited to the range of int64. In inflationary games, you may need a wider range of values.
In the Big Inventory Model, the number of items that can be stored in the inventory can have an integer value of 1024 digits.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | * | ~ 1024 chars | Big Inventory Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| bigItemModels | List<BigItemModel> | [] | 1 ~ 1000 items | List of Big Item Models The item types that can be stored in this big inventory. Each big item model can hold quantities represented as integer strings up to 1024 digits. Up to 1000 item models per big inventory model. |
BigItemModel
Big Item Model
The Big Item Model defines items stored in a Big Inventory Model. Big Items can hold quantities that exceed the range of int64.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemModelId | string | * | ~ 1024 chars | Big Item Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
AcquireCount
Acquisition quantity of Simple Item
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Acquisition quantity |
ConsumeCount
Consumption quantity of Simple Item
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Consumption quantity |
HeldCount
Quantity of Simple Items in possession
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| count | long | ✓ | 0 ~ 9223372036854775805 | Number of items held |
CurrentItemModelMaster
Currently active Item Model master data
This master data describes the definitions of Item Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.
To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Inventory for the JSON file format.Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceId | string | * | ~ 1024 chars | Namespace GRN * Set automatically by the server | ||
| settings | string | ✓ | ~ 5242880 bytes (5MB) | Master Data |
InventoryModelMaster
Inventory Model Master
Inventory Model Master is data used to edit and manage Inventory Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Inventory Model actually referenced by the game.
Inventory is like a bag that stores items owned by game players. Inventory can have a set capacity and cannot be owned beyond its capacity.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | * | ~ 1024 chars | Inventory Model Master GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| description | string | ~ 1024 chars | Description | |||
| initialCapacity | int | ✓ | 0 ~ 2147483646 | Initial Capacity The number of inventory slots available to a user when the inventory is first created. Each slot can hold one item stack. Users can expand their capacity up to maxCapacity through gameplay actions. | ||
| maxCapacity | int | ✓ | 0 ~ 2147483646 | Maximum Capacity The upper limit of inventory slots that a user can expand to. Capacity cannot be increased beyond this value. When all slots are occupied and items cannot be stacked further, acquisition attempts will fail unless the overflow script handles the excess. | ||
| protectReferencedItem | bool | false | Protect Referenced Items When enabled, item sets that have references registered (via the referenceOf mechanism) cannot be consumed or deleted. This prevents items that are in use by other systems (e.g., equipped gear, items bound to formations) from being accidentally removed. | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
ItemModelMaster
Item Model Master
Item Model Master is data used to edit and manage Item Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Item Model actually referenced by the game.
Items can be held in groups within a single inventory slot, such as Potion ×99. This grouping of multiple items into one slot is called “stacking,” and a maximum stack size can be set for each item.
The behavior when the stack limit is reached can also be set for each item. Specifically, you can choose one of the following:
- Add a new inventory slot to allow further acquisition
- Prevent further acquisition once the limit is reached
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemModelId | string | * | ~ 1024 chars | Item Model Master GRN * Set automatically by the server | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that this item belongs to. Determines which inventory bag this item type can be stored in and associates it with the inventory’s capacity and protection settings. | ||
| name | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata 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. Details are explained in the Microservices Introduction / GS2-Enhance section. | |||
| stackingLimit | long | ✓ | 1 ~ 9223372036854775805 | Maximum Stackable Quantity The maximum number of this item that can be held in a single inventory slot (stack). When this limit is reached, the behavior depends on the allowMultipleStacks setting: either a new slot is allocated or further acquisition is blocked. | ||
| allowMultipleStacks | bool | ✓ | Allow Multiple Stacks When enabled, if the stacking limit is reached, a new inventory slot is automatically allocated to store additional quantities of this item (consuming additional capacity). When disabled, acquisition is blocked once the stacking limit is reached in the existing slot. | |||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display Order A numeric value used to sort items within the inventory for display purposes. Lower values are displayed first. This value is also copied to ItemSet records to enable consistent ordering of possessed items. | ||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
SimpleInventoryModelMaster
Simple Inventory Model Master
Simple Inventory Model Master is data used to edit and manage Simple Inventory Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Simple Inventory Model actually referenced by the game.
In a normal InventoryModel, you could limit the amount of items that could be stored in your inventory. Simple Inventory, however, has no such functionality and simply stores the number of items in the inventory.
However, the Simple Inventory provides APIs that allow increasing or decreasing multiple items in a single operation.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | * | ~ 1024 chars | Simple Inventory Model Master GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| description | string | ~ 1024 chars | Description | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
SimpleItemModelMaster
Simple Item Model Master
Simple Item Model Master is data used to edit and manage Simple Item Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Simple Item Model actually referenced by the game.
ItemModel allowed setting a maximum stackable quantity, enabling implementation where items exceeding a certain number could be split into multiple stacks. Simple Item does not have such a function and simply stores the number of items in the possession of the item.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemModelId | string | * | ~ 1024 chars | Simple Item Model Master GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
BigInventoryModelMaster
Big Inventory Model Master
Big Inventory Model Master is data used to edit and manage Big Inventory Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Big Inventory Model actually referenced by the game.
In the normal InventoryModel and SimpleInventoryModel, the number of items that can be stored in the inventory is limited to the range of int64. In inflationary games, you may need a wider range of values.
In the Big Inventory Model, the number of items that can be stored in the inventory can have an integer value of 1024 digits.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | * | ~ 1024 chars | Big Inventory Model Master GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| description | string | ~ 1024 chars | Description | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
BigItemModelMaster
Big Item Model Master
Big Item Model Master is data used to edit and manage Big Item Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Big Item Model actually referenced by the game.
The Big Item Model defines items that are stored in a Big Inventory Model. Big Items can hold quantities that exceed the range of int64.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemModelId | string | * | ~ 1024 chars | Big Item Model Master GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
Methods
describeNamespaces
Get a list of Namespaces
Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namePrefix | string | ~ 64 chars | Filter by Namespace name prefix | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<Namespace> | List of Namespace |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&inventory.DescribeNamespacesRequest {
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeNamespacesRequest;
import io.gs2.inventory.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Inventory.Request.DescribeNamespacesRequest()
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Inventory.DescribeNamespacesRequest()
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_namespaces(
inventory.DescribeNamespacesRequest()
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_namespaces({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_namespaces_async({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createNamespace
Create a new Namespace
Creates a new inventory namespace with the specified settings. You can configure GS2-Script triggers for item acquisition (acquireScript), overflow handling (overflowScript), and consumption (consumeScript) for standard inventory items. Separate script settings are available for simple items (simpleItemAcquireScript, simpleItemConsumeScript) and big items (bigItemAcquireScript, bigItemConsumeScript). The overflow script is invoked when acquiring items would exceed the inventory capacity, enabling forwarding to systems like GS2-Inbox.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | Transaction Setting Configures distributed transaction processing for inventory operations such as acquiring and consuming items. Supports auto-run mode for seamless execution, atomic commit for consistent multi-resource operations, and async processing for large-scale reward distribution. | ||||
| acquireScript | ScriptSetting | Script setting to be executed when an Items is acquired Script Trigger Reference - acquire | ||||
| overflowScript | ScriptSetting | Script to execute when unable to obtain due to reaching the acquisition limit Script Trigger Reference - overflowDone | ||||
| consumeScript | ScriptSetting | Script to run when consuming Items Script Trigger Reference - consume | ||||
| simpleItemAcquireScript | ScriptSetting | Script setting to be executed when acquiring Simple Items Script Trigger Reference - simpleItemAcquire | ||||
| simpleItemConsumeScript | ScriptSetting | Script to run when consuming Simple Items Script Trigger Reference - simpleItemConsume | ||||
| bigItemAcquireScript | ScriptSetting | Script setting to be executed when acquiring Big Items Script Trigger Reference - bigItemAcquire | ||||
| bigItemConsumeScript | ScriptSetting | Script to run when consuming Big Items Script Trigger Reference - bigItemConsume | ||||
| logSetting | LogSetting | Log Output Settings Specifies the GS2-Log namespace for outputting API request and response logs of inventory operations. Useful for tracking item acquisition, consumption, and capacity changes for debugging and analytics. |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&inventory.CreateNamespaceRequest {
Name: pointy.String("namespace-0001"),
Description: nil,
TransactionSetting: nil,
AcquireScript: nil,
OverflowScript: nil,
ConsumeScript: nil,
SimpleItemAcquireScript: nil,
SimpleItemConsumeScript: nil,
BigItemAcquireScript: nil,
BigItemConsumeScript: nil,
LogSetting: &inventory.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName("namespace-0001")
->withDescription(null)
->withTransactionSetting(null)
->withAcquireScript(null)
->withOverflowScript(null)
->withConsumeScript(null)
->withSimpleItemAcquireScript(null)
->withSimpleItemConsumeScript(null)
->withBigItemAcquireScript(null)
->withBigItemConsumeScript(null)
->withLogSetting((new \Gs2\Inventory\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateNamespaceRequest;
import io.gs2.inventory.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withAcquireScript(null)
.withOverflowScript(null)
.withConsumeScript(null)
.withSimpleItemAcquireScript(null)
.withSimpleItemConsumeScript(null)
.withBigItemAcquireScript(null)
.withBigItemConsumeScript(null)
.withLogSetting(new io.gs2.inventory.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Inventory.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.WithDescription(null)
.WithTransactionSetting(null)
.WithAcquireScript(null)
.WithOverflowScript(null)
.WithConsumeScript(null)
.WithSimpleItemAcquireScript(null)
.WithSimpleItemConsumeScript(null)
.WithBigItemAcquireScript(null)
.WithBigItemConsumeScript(null)
.WithLogSetting(new Gs2.Gs2Inventory.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Inventory.CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withAcquireScript(null)
.withOverflowScript(null)
.withConsumeScript(null)
.withSimpleItemAcquireScript(null)
.withSimpleItemConsumeScript(null)
.withBigItemAcquireScript(null)
.withBigItemConsumeScript(null)
.withLogSetting(new Gs2Inventory.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.create_namespace(
inventory.CreateNamespaceRequest()
.with_name('namespace-0001')
.with_description(None)
.with_transaction_setting(None)
.with_acquire_script(None)
.with_overflow_script(None)
.with_consume_script(None)
.with_simple_item_acquire_script(None)
.with_simple_item_consume_script(None)
.with_big_item_acquire_script(None)
.with_big_item_consume_script(None)
.with_log_setting(
inventory.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.create_namespace({
name="namespace-0001",
description=nil,
transactionSetting=nil,
acquireScript=nil,
overflowScript=nil,
consumeScript=nil,
simpleItemAcquireScript=nil,
simpleItemConsumeScript=nil,
bigItemAcquireScript=nil,
bigItemConsumeScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.create_namespace_async({
name="namespace-0001",
description=nil,
transactionSetting=nil,
acquireScript=nil,
overflowScript=nil,
consumeScript=nil,
simpleItemAcquireScript=nil,
simpleItemConsumeScript=nil,
bigItemAcquireScript=nil,
bigItemConsumeScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getNamespaceStatus
Get Namespace status
Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| status | string |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&inventory.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Statususe Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName("namespace-0001")
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetNamespaceStatusRequest;
import io.gs2.inventory.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Inventory.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Inventory.GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_namespace_status(
inventory.GetNamespaceStatusRequest()
.with_namespace_name('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;client = gs2('inventory')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;getNamespace
Get namespace
Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&inventory.GetNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetNamespaceRequest;
import io.gs2.inventory.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Inventory.Request.GetNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Inventory.GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_namespace(
inventory.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
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
Updates the settings of the specified inventory namespace. You can modify GS2-Script triggers for item acquisition, overflow handling, and consumption for standard, simple, and big items. Changes to script settings take effect immediately for subsequent operations.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | Transaction Setting Configures distributed transaction processing for inventory operations such as acquiring and consuming items. Supports auto-run mode for seamless execution, atomic commit for consistent multi-resource operations, and async processing for large-scale reward distribution. | ||||
| acquireScript | ScriptSetting | Script setting to be executed when an Items is acquired Script Trigger Reference - acquire | ||||
| overflowScript | ScriptSetting | Script to execute when unable to obtain due to reaching the acquisition limit Script Trigger Reference - overflowDone | ||||
| consumeScript | ScriptSetting | Script to run when consuming Items Script Trigger Reference - consume | ||||
| simpleItemAcquireScript | ScriptSetting | Script setting to be executed when acquiring Simple Items Script Trigger Reference - simpleItemAcquire | ||||
| simpleItemConsumeScript | ScriptSetting | Script to run when consuming Simple Items Script Trigger Reference - simpleItemConsume | ||||
| bigItemAcquireScript | ScriptSetting | Script setting to be executed when acquiring Big Items Script Trigger Reference - bigItemAcquire | ||||
| bigItemConsumeScript | ScriptSetting | Script to run when consuming Big Items Script Trigger Reference - bigItemConsume | ||||
| logSetting | LogSetting | Log Output Settings Specifies the GS2-Log namespace for outputting API request and response logs of inventory operations. Useful for tracking item acquisition, consumption, and capacity changes for debugging and analytics. |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&inventory.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
Description: pointy.String("description1"),
TransactionSetting: nil,
AcquireScript: &inventory.ScriptSetting{
TriggerScriptId: pointy.String("script-1001"),
DoneTriggerScriptId: pointy.String("script-1002"),
DoneTriggerQueueNamespaceId: pointy.String("namespace-1001"),
},
OverflowScript: &inventory.ScriptSetting{
DoneTriggerScriptId: pointy.String("script-1003"),
DoneTriggerQueueNamespaceId: pointy.String("script-1004"),
},
ConsumeScript: &inventory.ScriptSetting{
TriggerScriptId: pointy.String("script-1005"),
DoneTriggerScriptId: pointy.String("script-1006"),
DoneTriggerQueueNamespaceId: pointy.String("namespace-1001"),
},
SimpleItemAcquireScript: nil,
SimpleItemConsumeScript: nil,
BigItemAcquireScript: nil,
BigItemConsumeScript: nil,
LogSetting: &inventory.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName("namespace-0001")
->withDescription("description1")
->withTransactionSetting(null)
->withAcquireScript((new \Gs2\Inventory\Model\ScriptSetting())
->withTriggerScriptId("script-1001")
->withDoneTriggerScriptId("script-1002")
->withDoneTriggerQueueNamespaceId("namespace-1001"))
->withOverflowScript((new \Gs2\Inventory\Model\ScriptSetting())
->withDoneTriggerScriptId("script-1003")
->withDoneTriggerQueueNamespaceId("script-1004"))
->withConsumeScript((new \Gs2\Inventory\Model\ScriptSetting())
->withTriggerScriptId("script-1005")
->withDoneTriggerScriptId("script-1006")
->withDoneTriggerQueueNamespaceId("namespace-1001"))
->withSimpleItemAcquireScript(null)
->withSimpleItemConsumeScript(null)
->withBigItemAcquireScript(null)
->withBigItemConsumeScript(null)
->withLogSetting((new \Gs2\Inventory\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateNamespaceRequest;
import io.gs2.inventory.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withAcquireScript(new io.gs2.inventory.model.ScriptSetting()
.withTriggerScriptId("script-1001")
.withDoneTriggerScriptId("script-1002")
.withDoneTriggerQueueNamespaceId("namespace-1001"))
.withOverflowScript(new io.gs2.inventory.model.ScriptSetting()
.withDoneTriggerScriptId("script-1003")
.withDoneTriggerQueueNamespaceId("script-1004"))
.withConsumeScript(new io.gs2.inventory.model.ScriptSetting()
.withTriggerScriptId("script-1005")
.withDoneTriggerScriptId("script-1006")
.withDoneTriggerQueueNamespaceId("namespace-1001"))
.withSimpleItemAcquireScript(null)
.withSimpleItemConsumeScript(null)
.withBigItemAcquireScript(null)
.withBigItemConsumeScript(null)
.withLogSetting(new io.gs2.inventory.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Inventory.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.WithDescription("description1")
.WithTransactionSetting(null)
.WithAcquireScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
.WithTriggerScriptId("script-1001")
.WithDoneTriggerScriptId("script-1002")
.WithDoneTriggerQueueNamespaceId("namespace-1001"))
.WithOverflowScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
.WithDoneTriggerScriptId("script-1003")
.WithDoneTriggerQueueNamespaceId("script-1004"))
.WithConsumeScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
.WithTriggerScriptId("script-1005")
.WithDoneTriggerScriptId("script-1006")
.WithDoneTriggerQueueNamespaceId("namespace-1001"))
.WithSimpleItemAcquireScript(null)
.WithSimpleItemConsumeScript(null)
.WithBigItemAcquireScript(null)
.WithBigItemConsumeScript(null)
.WithLogSetting(new Gs2.Gs2Inventory.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Inventory.UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withAcquireScript(new Gs2Inventory.model.ScriptSetting()
.withTriggerScriptId("script-1001")
.withDoneTriggerScriptId("script-1002")
.withDoneTriggerQueueNamespaceId("namespace-1001"))
.withOverflowScript(new Gs2Inventory.model.ScriptSetting()
.withDoneTriggerScriptId("script-1003")
.withDoneTriggerQueueNamespaceId("script-1004"))
.withConsumeScript(new Gs2Inventory.model.ScriptSetting()
.withTriggerScriptId("script-1005")
.withDoneTriggerScriptId("script-1006")
.withDoneTriggerQueueNamespaceId("namespace-1001"))
.withSimpleItemAcquireScript(null)
.withSimpleItemConsumeScript(null)
.withBigItemAcquireScript(null)
.withBigItemConsumeScript(null)
.withLogSetting(new Gs2Inventory.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_namespace(
inventory.UpdateNamespaceRequest()
.with_namespace_name('namespace-0001')
.with_description('description1')
.with_transaction_setting(None)
.with_acquire_script(
inventory.ScriptSetting()
.with_trigger_script_id('script-1001')
.with_done_trigger_script_id('script-1002')
.with_done_trigger_queue_namespace_id('namespace-1001'))
.with_overflow_script(
inventory.ScriptSetting()
.with_done_trigger_script_id('script-1003')
.with_done_trigger_queue_namespace_id('script-1004'))
.with_consume_script(
inventory.ScriptSetting()
.with_trigger_script_id('script-1005')
.with_done_trigger_script_id('script-1006')
.with_done_trigger_queue_namespace_id('namespace-1001'))
.with_simple_item_acquire_script(None)
.with_simple_item_consume_script(None)
.with_big_item_acquire_script(None)
.with_big_item_consume_script(None)
.with_log_setting(
inventory.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_namespace({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
acquireScript={
triggerScriptId="script-1001",
doneTriggerScriptId="script-1002",
doneTriggerQueueNamespaceId="namespace-1001",
},
overflowScript={
doneTriggerScriptId="script-1003",
doneTriggerQueueNamespaceId="script-1004",
},
consumeScript={
triggerScriptId="script-1005",
doneTriggerScriptId="script-1006",
doneTriggerQueueNamespaceId="namespace-1001",
},
simpleItemAcquireScript=nil,
simpleItemConsumeScript=nil,
bigItemAcquireScript=nil,
bigItemConsumeScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
acquireScript={
triggerScriptId="script-1001",
doneTriggerScriptId="script-1002",
doneTriggerQueueNamespaceId="namespace-1001",
},
overflowScript={
doneTriggerScriptId="script-1003",
doneTriggerQueueNamespaceId="script-1004",
},
consumeScript={
triggerScriptId="script-1005",
doneTriggerScriptId="script-1006",
doneTriggerQueueNamespaceId="namespace-1001",
},
simpleItemAcquireScript=nil,
simpleItemConsumeScript=nil,
bigItemAcquireScript=nil,
bigItemConsumeScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteNamespace
Delete Namespace
Delete the specified namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | The deleted Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&inventory.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteNamespaceRequest;
import io.gs2.inventory.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Inventory.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Inventory.DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_namespace(
inventory.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getServiceVersion
Get the microservice version
Details
Request
Request parameters: None
Result
| Type | Description | |
|---|---|---|
| item | string | Version |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetServiceVersion(
&inventory.GetServiceVersionRequest {
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetServiceVersionRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getServiceVersion(
(new GetServiceVersionRequest())
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetServiceVersionRequest;
import io.gs2.inventory.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetServiceVersionResult result = client.getServiceVersion(
new GetServiceVersionRequest()
);
String item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
new Gs2.Gs2Inventory.Request.GetServiceVersionRequest(),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getServiceVersion(
new Gs2Inventory.GetServiceVersionRequest()
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_service_version(
inventory.GetServiceVersionRequest()
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_service_version({
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_service_version_async({
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;dumpUserDataByUserId
Dump data associated with the specified user ID
Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&inventory.DumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->dumpUserDataByUserId(
(new DumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DumpUserDataByUserIdRequest;
import io.gs2.inventory.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Inventory.Request.DumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Inventory.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.dump_user_data_by_user_id(
inventory.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
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.resultclient = gs2('inventory')
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.resultcheckDumpUserDataByUserId
Check if the dump of the data associated with the specified user ID is complete
Checks the progress of a previously initiated user data dump operation. The dump includes all inventory data, item sets, simple items, and big items owned by the user. When complete, returns a URL to download the exported data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| url | string | URL of output data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&inventory.CheckDumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Urluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CheckDumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->checkDumpUserDataByUserId(
(new CheckDumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.inventory.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
new CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Inventory.Request.CheckDumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Inventory.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
inventory.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('inventory')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;cleanUserDataByUserId
Delete user data
Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&inventory.CleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->cleanUserDataByUserId(
(new CleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CleanUserDataByUserIdRequest;
import io.gs2.inventory.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Inventory.Request.CleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Inventory.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.clean_user_data_by_user_id(
inventory.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
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.resultclient = gs2('inventory')
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.resultcheckCleanUserDataByUserId
Check if the cleaning of the data associated with the specified user ID is complete
Checks the progress of a previously initiated user data cleaning operation. The cleaning removes all inventory data, item sets, simple items, and big items owned by the user across all namespaces in this service.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&inventory.CheckCleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CheckCleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->checkCleanUserDataByUserId(
(new CheckCleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.inventory.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Inventory.Request.CheckCleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Inventory.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
inventory.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
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.resultclient = gs2('inventory')
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.resultprepareImportUserDataByUserId
Execute import of data associated with the specified user ID
The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.
You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| uploadToken | string | Token used to reflect results after upload |
| uploadUrl | string | URL used to upload user data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&inventory.PrepareImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\PrepareImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->prepareImportUserDataByUserId(
(new PrepareImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.inventory.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
new PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Inventory.Request.PrepareImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Inventory.PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
inventory.PrepareImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('inventory')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;importUserDataByUserId
Execute import of data associated with the specified user ID
The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.
Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&inventory.ImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->importUserDataByUserId(
(new ImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ImportUserDataByUserIdRequest;
import io.gs2.inventory.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ImportUserDataByUserIdResult result = client.importUserDataByUserId(
new ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Inventory.Request.ImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Inventory.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.import_user_data_by_user_id(
inventory.ImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
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.resultclient = gs2('inventory')
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.resultcheckImportUserDataByUserId
Check if the import of the data associated with the specified user ID is complete
Checks the progress of a previously initiated user data import operation. The import restores inventory data, item sets, simple items, and big items from previously exported data. When complete, returns a URL to download the import log.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| url | string | URL of log data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&inventory.CheckImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Urluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CheckImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->checkImportUserDataByUserId(
(new CheckImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CheckImportUserDataByUserIdRequest;
import io.gs2.inventory.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
new CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Inventory.Request.CheckImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Inventory.CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
inventory.CheckImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('inventory')
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;describeInventories
Get a list of Inventories
Retrieves a paginated list of the requesting user’s inventories. Each inventory tracks the current capacity (number of item slots) for a specific inventory model. Inventories are automatically created when a user first acquires an item, with the initial capacity set by the inventory model’s initialCapacity.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<Inventory> | List of Inventories |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeInventories(
&inventory.DescribeInventoriesRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoriesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeInventories(
(new DescribeInventoriesRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoriesRequest;
import io.gs2.inventory.result.DescribeInventoriesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeInventoriesResult result = client.describeInventories(
new DescribeInventoriesRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<Inventory> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoriesResult> asyncResult = null;
yield return client.DescribeInventories(
new Gs2.Gs2Inventory.Request.DescribeInventoriesRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeInventories(
new Gs2Inventory.DescribeInventoriesRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_inventories(
inventory.DescribeInventoriesRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_inventories({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_inventories_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeInventoriesByUserId
Get a list of Inventories by specifying a user ID
Retrieves a paginated list of inventories for the specified user. Each inventory tracks the current capacity (number of item slots) for a specific inventory model.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<Inventory> | List of Inventories |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeInventoriesByUserId(
&inventory.DescribeInventoriesByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoriesByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeInventoriesByUserId(
(new DescribeInventoriesByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoriesByUserIdRequest;
import io.gs2.inventory.result.DescribeInventoriesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeInventoriesByUserIdResult result = client.describeInventoriesByUserId(
new DescribeInventoriesByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<Inventory> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoriesByUserIdResult> asyncResult = null;
yield return client.DescribeInventoriesByUserId(
new Gs2.Gs2Inventory.Request.DescribeInventoriesByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeInventoriesByUserId(
new Gs2Inventory.DescribeInventoriesByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_inventories_by_user_id(
inventory.DescribeInventoriesByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_inventories_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_inventories_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;getInventory
Get Inventory
Retrieves the requesting user’s inventory for the specified inventory model, including the current capacity. If the user has never acquired an item in this inventory, no data will be returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token |
Result
| Type | Description | |
|---|---|---|
| item | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetInventory(
&inventory.GetInventoryRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getInventory(
(new GetInventoryRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryRequest;
import io.gs2.inventory.result.GetInventoryResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetInventoryResult result = client.getInventory(
new GetInventoryRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
);
Inventory item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryResult> asyncResult = null;
yield return client.GetInventory(
new Gs2.Gs2Inventory.Request.GetInventoryRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getInventory(
new Gs2Inventory.GetInventoryRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_inventory(
inventory.GetInventoryRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_inventory({
namespaceName="namespace-0001",
inventoryName="inventory-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;client = gs2('inventory')
api_result_handler = client.get_inventory_async({
namespaceName="namespace-0001",
inventoryName="inventory-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;getInventoryByUserId
Get Inventory by specifying a user ID
Retrieves the specified user’s inventory for the given inventory model, including the current capacity.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetInventoryByUserId(
&inventory.GetInventoryByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getInventoryByUserId(
(new GetInventoryByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryByUserIdRequest;
import io.gs2.inventory.result.GetInventoryByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetInventoryByUserIdResult result = client.getInventoryByUserId(
new GetInventoryByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Inventory item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryByUserIdResult> asyncResult = null;
yield return client.GetInventoryByUserId(
new Gs2.Gs2Inventory.Request.GetInventoryByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getInventoryByUserId(
new Gs2Inventory.GetInventoryByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_inventory_by_user_id(
inventory.GetInventoryByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_inventory_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_inventory_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-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;addCapacityByUserId
Add inventory capacity size by specifying a user ID
Incrementally increases the user’s inventory capacity by the specified amount. The resulting capacity cannot exceed the inventory model’s maxCapacity. If the inventory does not yet exist, it is automatically created with initialCapacity before adding the specified value.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| addCapacityValue | int | ✓ | 1 ~ 2147483646 | Capacity size to be added | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Inventory | Inventory after capacity addition |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.AddCapacityByUserId(
&inventory.AddCapacityByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
AddCapacityValue: pointy.Int32(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AddCapacityByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->addCapacityByUserId(
(new AddCapacityByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withAddCapacityValue(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AddCapacityByUserIdRequest;
import io.gs2.inventory.result.AddCapacityByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
AddCapacityByUserIdResult result = client.addCapacityByUserId(
new AddCapacityByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withAddCapacityValue(1)
.withTimeOffsetToken(null)
);
Inventory item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.AddCapacityByUserIdResult> asyncResult = null;
yield return client.AddCapacityByUserId(
new Gs2.Gs2Inventory.Request.AddCapacityByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithAddCapacityValue(1)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.addCapacityByUserId(
new Gs2Inventory.AddCapacityByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withAddCapacityValue(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.add_capacity_by_user_id(
inventory.AddCapacityByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_add_capacity_value(1)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.add_capacity_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
addCapacityValue=1,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.add_capacity_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
addCapacityValue=1,
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;setCapacityByUserId
Set inventory capacity size by specifying a user ID
Sets the user’s inventory capacity to the specified absolute value. Returns both the inventory state before and after the update, allowing you to compare old and new capacity values. The new capacity value cannot exceed the inventory model’s maxCapacity.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| newCapacityValue | int | ✓ | 1 ~ 2147483646 | New maximum capacity for inventory | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Inventory | Inventory after update |
| old | Inventory | Inventory before update |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.SetCapacityByUserId(
&inventory.SetCapacityByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
NewCapacityValue: pointy.Int32(10),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Olduse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\SetCapacityByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->setCapacityByUserId(
(new SetCapacityByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withNewCapacityValue(10)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$old = $result->getOld();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.SetCapacityByUserIdRequest;
import io.gs2.inventory.result.SetCapacityByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
SetCapacityByUserIdResult result = client.setCapacityByUserId(
new SetCapacityByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withNewCapacityValue(10)
.withTimeOffsetToken(null)
);
Inventory item = result.getItem();
Inventory old = result.getOld();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.SetCapacityByUserIdResult> asyncResult = null;
yield return client.SetCapacityByUserId(
new Gs2.Gs2Inventory.Request.SetCapacityByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithNewCapacityValue(10)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.setCapacityByUserId(
new Gs2Inventory.SetCapacityByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withNewCapacityValue(10)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const old = result.getOld();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.set_capacity_by_user_id(
inventory.SetCapacityByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_new_capacity_value(10)
.with_time_offset_token(None)
)
item = result.item
old = result.old
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.set_capacity_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
newCapacityValue=10,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
old = result.old;client = gs2('inventory')
api_result_handler = client.set_capacity_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
newCapacityValue=10,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
old = result.old;deleteInventoryByUserId
Delete inventory
Deletes the specified user’s inventory along with all associated item sets. This operation permanently removes the inventory and all items stored within it.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteInventoryByUserId(
&inventory.DeleteInventoryByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteInventoryByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteInventoryByUserId(
(new DeleteInventoryByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteInventoryByUserIdRequest;
import io.gs2.inventory.result.DeleteInventoryByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteInventoryByUserIdResult result = client.deleteInventoryByUserId(
new DeleteInventoryByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Inventory item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteInventoryByUserIdResult> asyncResult = null;
yield return client.DeleteInventoryByUserId(
new Gs2.Gs2Inventory.Request.DeleteInventoryByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteInventoryByUserId(
new Gs2Inventory.DeleteInventoryByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_inventory_by_user_id(
inventory.DeleteInventoryByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_inventory_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_inventory_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-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;verifyInventoryCurrentMaxCapacity
Verify current max inventory capacity
Verifies that the user’s current maximum inventory capacity satisfies the specified condition. Supports 6 comparison operators: less, lessEqual, greater, greaterEqual, equal, notEqual. The verification uses the buffed capacity value (reflecting any active buff effects from GS2-Buff), not the raw stored value. If the condition is not met, an error is returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| currentInventoryMaxCapacity | int | ✓ | 0 ~ 2147483646 | Current max inventory capacity | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity |
Result
| Type | Description | |
|---|---|---|
| item | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyInventoryCurrentMaxCapacity(
&inventory.VerifyInventoryCurrentMaxCapacityRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
InventoryName: pointy.String("inventory-0001"),
VerifyType: pointy.String("less"),
CurrentInventoryMaxCapacity: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyInventoryCurrentMaxCapacityRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyInventoryCurrentMaxCapacity(
(new VerifyInventoryCurrentMaxCapacityRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withInventoryName("inventory-0001")
->withVerifyType("less")
->withCurrentInventoryMaxCapacity(10)
->withMultiplyValueSpecifyingQuantity(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyInventoryCurrentMaxCapacityRequest;
import io.gs2.inventory.result.VerifyInventoryCurrentMaxCapacityResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyInventoryCurrentMaxCapacityResult result = client.verifyInventoryCurrentMaxCapacity(
new VerifyInventoryCurrentMaxCapacityRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withVerifyType("less")
.withCurrentInventoryMaxCapacity(10)
.withMultiplyValueSpecifyingQuantity(null)
);
Inventory item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityResult> asyncResult = null;
yield return client.VerifyInventoryCurrentMaxCapacity(
new Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithInventoryName("inventory-0001")
.WithVerifyType("less")
.WithCurrentInventoryMaxCapacity(10)
.WithMultiplyValueSpecifyingQuantity(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyInventoryCurrentMaxCapacity(
new Gs2Inventory.VerifyInventoryCurrentMaxCapacityRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withVerifyType("less")
.withCurrentInventoryMaxCapacity(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_inventory_current_max_capacity(
inventory.VerifyInventoryCurrentMaxCapacityRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_inventory_name('inventory-0001')
.with_verify_type('less')
.with_current_inventory_max_capacity(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_inventory_current_max_capacity({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
verifyType="less",
currentInventoryMaxCapacity=10,
multiplyValueSpecifyingQuantity=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.verify_inventory_current_max_capacity_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
verifyType="less",
currentInventoryMaxCapacity=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;verifyInventoryCurrentMaxCapacityByUserId
Verify current max inventory capacity by specifying a user ID
Verifies that the specified user’s current maximum inventory capacity satisfies the given condition. Supports 6 comparison operators: less, lessEqual, greater, greaterEqual, equal, notEqual. The verification uses the buffed capacity value (reflecting any active buff effects from GS2-Buff).
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| userId | string | ✓ | ~ 128 chars | User ID | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| currentInventoryMaxCapacity | int | ✓ | 0 ~ 2147483646 | Current max inventory capacity | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity | |||||||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyInventoryCurrentMaxCapacityByUserId(
&inventory.VerifyInventoryCurrentMaxCapacityByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
InventoryName: pointy.String("inventory-0001"),
VerifyType: pointy.String("less"),
CurrentInventoryMaxCapacity: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyInventoryCurrentMaxCapacityByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyInventoryCurrentMaxCapacityByUserId(
(new VerifyInventoryCurrentMaxCapacityByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withInventoryName("inventory-0001")
->withVerifyType("less")
->withCurrentInventoryMaxCapacity(10)
->withMultiplyValueSpecifyingQuantity(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyInventoryCurrentMaxCapacityByUserIdRequest;
import io.gs2.inventory.result.VerifyInventoryCurrentMaxCapacityByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyInventoryCurrentMaxCapacityByUserIdResult result = client.verifyInventoryCurrentMaxCapacityByUserId(
new VerifyInventoryCurrentMaxCapacityByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withVerifyType("less")
.withCurrentInventoryMaxCapacity(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
Inventory item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityByUserIdResult> asyncResult = null;
yield return client.VerifyInventoryCurrentMaxCapacityByUserId(
new Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithInventoryName("inventory-0001")
.WithVerifyType("less")
.WithCurrentInventoryMaxCapacity(10)
.WithMultiplyValueSpecifyingQuantity(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyInventoryCurrentMaxCapacityByUserId(
new Gs2Inventory.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withVerifyType("less")
.withCurrentInventoryMaxCapacity(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_inventory_current_max_capacity_by_user_id(
inventory.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_inventory_name('inventory-0001')
.with_verify_type('less')
.with_current_inventory_max_capacity(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_inventory_current_max_capacity_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
verifyType="less",
currentInventoryMaxCapacity=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.verify_inventory_current_max_capacity_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
verifyType="less",
currentInventoryMaxCapacity=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeItemSets
Get a list of Item Sets
Retrieves a paginated list of the requesting user’s item sets within the specified inventory. Each item set represents a stack of items with a specific quantity, optional expiration time, and optional references. When an item model allows multiple stacks, the same item type may appear as multiple item set entries with different quantities and expiration times.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeItemSets(
&inventory.DescribeItemSetsRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemSetsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeItemSets(
(new DescribeItemSetsRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withAccessToken("accessToken-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemSetsRequest;
import io.gs2.inventory.result.DescribeItemSetsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeItemSetsResult result = client.describeItemSets(
new DescribeItemSetsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<ItemSet> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemSetsResult> asyncResult = null;
yield return client.DescribeItemSets(
new Gs2.Gs2Inventory.Request.DescribeItemSetsRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeItemSets(
new Gs2Inventory.DescribeItemSetsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_item_sets(
inventory.DescribeItemSetsRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_access_token('accessToken-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_item_sets({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_item_sets_async({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeItemSetsByUserId
Get a list of Item Sets by specifying a user ID
Retrieves a paginated list of the specified user’s item sets within the given inventory. Each item set represents a stack of items with a specific quantity, optional expiration time, and optional references.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeItemSetsByUserId(
&inventory.DescribeItemSetsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemSetsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeItemSetsByUserId(
(new DescribeItemSetsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemSetsByUserIdRequest;
import io.gs2.inventory.result.DescribeItemSetsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeItemSetsByUserIdResult result = client.describeItemSetsByUserId(
new DescribeItemSetsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ItemSet> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemSetsByUserIdResult> asyncResult = null;
yield return client.DescribeItemSetsByUserId(
new Gs2.Gs2Inventory.Request.DescribeItemSetsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeItemSetsByUserId(
new Gs2Inventory.DescribeItemSetsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_item_sets_by_user_id(
inventory.DescribeItemSetsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_item_sets_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_item_sets_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;getItemSet
Get Item Set
Retrieves the item sets for the specified item within the requesting user’s inventory. An optional itemSetName can filter to a specific stack; without it, all stacks for the item are returned. Also returns the associated item model and inventory information.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ~ 36 chars | Name identifying the item set |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetItemSet(
&inventory.GetItemSetRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("itemSet-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemSetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getItemSet(
(new GetItemSetRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withItemSetName("itemSet-0001")
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemSetRequest;
import io.gs2.inventory.result.GetItemSetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetItemSetResult result = client.getItemSet(
new GetItemSetRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("itemSet-0001")
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetItemSetResult> asyncResult = null;
yield return client.GetItemSet(
new Gs2.Gs2Inventory.Request.GetItemSetRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithItemSetName("itemSet-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getItemSet(
new Gs2Inventory.GetItemSetRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("itemSet-0001")
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_item_set(
inventory.GetItemSetRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_item_set_name('itemSet-0001')
)
items = result.items
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_item_set({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="itemSet-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.get_item_set_async({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="itemSet-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;
itemModel = result.itemModel;
inventory = result.inventory;getItemSetByUserId
Get Item Set by specifying the user ID
Retrieves the item sets for the specified item within the given user’s inventory. An optional itemSetName can filter to a specific stack; without it, all stacks for the item are returned. Also returns the associated item model and inventory information.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ~ 36 chars | Name identifying the item set | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetItemSetByUserId(
&inventory.GetItemSetByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemSetByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getItemSetByUserId(
(new GetItemSetByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemSetByUserIdRequest;
import io.gs2.inventory.result.GetItemSetByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetItemSetByUserIdResult result = client.getItemSetByUserId(
new GetItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName(null)
.withTimeOffsetToken(null)
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetItemSetByUserIdResult> asyncResult = null;
yield return client.GetItemSetByUserId(
new Gs2.Gs2Inventory.Request.GetItemSetByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getItemSetByUserId(
new Gs2Inventory.GetItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_item_set_by_user_id(
inventory.GetItemSetByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name(None)
.with_time_offset_token(None)
)
items = result.items
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_item_set_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.get_item_set_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;getItemWithSignature
Get Item Set along with the signature
Retrieves the item sets with a cryptographic signature that can be used to verify the data’s authenticity. The signature is generated using the specified encryption key, allowing external systems to validate that the item data has not been tampered with. Useful for server-authoritative validation scenarios where item possession must be verified by a third party.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ~ 36 chars | Name identifying the Item Set | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
| body | string | Item Set Information for Signature Subject |
| signature | string | Signature |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetItemWithSignature(
&inventory.GetItemWithSignatureRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: nil,
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
body := result.Body
signature := result.Signatureuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemWithSignatureRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getItemWithSignature(
(new GetItemWithSignatureRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withItemSetName(null)
->withKeyId("key-0001")
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
$body = $result->getBody();
$signature = $result->getSignature();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemWithSignatureRequest;
import io.gs2.inventory.result.GetItemWithSignatureResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetItemWithSignatureResult result = client.getItemWithSignature(
new GetItemWithSignatureRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName(null)
.withKeyId("key-0001")
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetItemWithSignatureResult> asyncResult = null;
yield return client.GetItemWithSignature(
new Gs2.Gs2Inventory.Request.GetItemWithSignatureRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithItemSetName(null)
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var body = result.Body;
var signature = result.Signature;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getItemWithSignature(
new Gs2Inventory.GetItemWithSignatureRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName(null)
.withKeyId("key-0001")
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
const body = result.getBody();
const signature = result.getSignature();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_item_with_signature(
inventory.GetItemWithSignatureRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_item_set_name(None)
.with_key_id('key-0001')
)
items = result.items
item_model = result.item_model
inventory = result.inventory
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_item_with_signature({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName=nil,
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;client = gs2('inventory')
api_result_handler = client.get_item_with_signature_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName=nil,
keyId="key-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;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;getItemWithSignatureByUserId
Get Item Set with signature by specifying the user ID
Retrieves the item sets with a cryptographic signature for the specified user. The signature is generated using the specified encryption key for external authenticity verification.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ~ 36 chars | Name identifying the Item Set | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
| body | string | Item Set Information for Signature Subject |
| signature | string | Signature |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetItemWithSignatureByUserId(
&inventory.GetItemWithSignatureByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: nil,
KeyId: pointy.String("key-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
body := result.Body
signature := result.Signatureuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemWithSignatureByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getItemWithSignatureByUserId(
(new GetItemWithSignatureByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName(null)
->withKeyId("key-0001")
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
$body = $result->getBody();
$signature = $result->getSignature();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemWithSignatureByUserIdRequest;
import io.gs2.inventory.result.GetItemWithSignatureByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetItemWithSignatureByUserIdResult result = client.getItemWithSignatureByUserId(
new GetItemWithSignatureByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName(null)
.withKeyId("key-0001")
.withTimeOffsetToken(null)
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetItemWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetItemWithSignatureByUserId(
new Gs2.Gs2Inventory.Request.GetItemWithSignatureByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName(null)
.WithKeyId("key-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var body = result.Body;
var signature = result.Signature;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getItemWithSignatureByUserId(
new Gs2Inventory.GetItemWithSignatureByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName(null)
.withKeyId("key-0001")
.withTimeOffsetToken(null)
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
const body = result.getBody();
const signature = result.getSignature();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_item_with_signature_by_user_id(
inventory.GetItemWithSignatureByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name(None)
.with_key_id('key-0001')
.with_time_offset_token(None)
)
items = result.items
item_model = result.item_model
inventory = result.inventory
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_item_with_signature_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName=nil,
keyId="key-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;client = gs2('inventory')
api_result_handler = client.get_item_with_signature_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName=nil,
keyId="key-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;acquireItemSetByUserId
Acquire Item Sets by specifying the user ID
Adds items to the user’s inventory. If an existing item set has room (below the stacking limit), items are added to it; otherwise, a new item set is created if multiple stacks are allowed. An optional expiresAt can set an expiration time for newly created item sets. Items with an expiration time already in the past are treated as empty. When createNewItemSet is true, a new item set is always created even if existing sets have room. If the total quantity exceeds the inventory capacity, the overflow count is returned, and overflow items may be forwarded to GS2-Inbox depending on the namespace configuration.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| acquireCount | long | ✓ | 1 ~ 9223372036854775805 | Acquisition quantity | ||
| expiresAt | long | 0 | Expiration time Unix time, milliseconds | |||
| createNewItemSet | bool | false | Even if there is room in an existing Item Set, you can create a new Item Set | |||
| itemSetName | string | ~ 36 chars | Name identifying the Item Set | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Set after addition |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
| overflowCount | long | Quantity of items transferred to GS2-Inbox that were not received beyond the possession limit |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.AcquireItemSetByUserId(
&inventory.AcquireItemSetByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-0001"),
UserId: pointy.String("user-0001"),
AcquireCount: pointy.Int64(5),
ExpiresAt: pointy.Int64(0),
CreateNewItemSet: nil,
ItemSetName: pointy.String("itemSet-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
overflowCount := result.OverflowCountuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireItemSetByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->acquireItemSetByUserId(
(new AcquireItemSetByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-0001")
->withUserId("user-0001")
->withAcquireCount(5)
->withExpiresAt(0)
->withCreateNewItemSet(null)
->withItemSetName("itemSet-0001")
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
$overflowCount = $result->getOverflowCount();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireItemSetByUserIdRequest;
import io.gs2.inventory.result.AcquireItemSetByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
AcquireItemSetByUserIdResult result = client.acquireItemSetByUserId(
new AcquireItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-0001")
.withUserId("user-0001")
.withAcquireCount(5L)
.withExpiresAt(0L)
.withCreateNewItemSet(null)
.withItemSetName("itemSet-0001")
.withTimeOffsetToken(null)
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
long overflowCount = result.getOverflowCount();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.AcquireItemSetByUserIdResult> asyncResult = null;
yield return client.AcquireItemSetByUserId(
new Gs2.Gs2Inventory.Request.AcquireItemSetByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-0001")
.WithUserId("user-0001")
.WithAcquireCount(5L)
.WithExpiresAt(0L)
.WithCreateNewItemSet(null)
.WithItemSetName("itemSet-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var overflowCount = result.OverflowCount;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.acquireItemSetByUserId(
new Gs2Inventory.AcquireItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-0001")
.withUserId("user-0001")
.withAcquireCount(5)
.withExpiresAt(0)
.withCreateNewItemSet(null)
.withItemSetName("itemSet-0001")
.withTimeOffsetToken(null)
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
const overflowCount = result.getOverflowCount();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.acquire_item_set_by_user_id(
inventory.AcquireItemSetByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-0001')
.with_user_id('user-0001')
.with_acquire_count(5)
.with_expires_at(0)
.with_create_new_item_set(None)
.with_item_set_name('itemSet-0001')
.with_time_offset_token(None)
)
items = result.items
item_model = result.item_model
inventory = result.inventory
overflow_count = result.overflow_count
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.acquire_item_set_by_user_id({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-0001",
userId="user-0001",
acquireCount=5,
expiresAt=0,
createNewItemSet=nil,
itemSetName="itemSet-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;client = gs2('inventory')
api_result_handler = client.acquire_item_set_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-0001",
userId="user-0001",
acquireCount=5,
expiresAt=0,
createNewItemSet=nil,
itemSetName="itemSet-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;acquireItemSetWithGradeByUserId
Acquire one Item Set while setting the grade to GS2-Grade by specifying the user ID
Acquires exactly one item and simultaneously sets a grade value on it via GS2-Grade. This is used for items that have a quality/rank system where each individual item has a different grade value (e.g., equipment with varying stats). A new item set is always created (createNewItemSet behavior), and the grade is set through GS2-Grade’s SetGradeByUserId after the item acquisition.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| gradeModelId | string | ✓ | ~ 1024 chars | Grade Model GRN | ||
| gradeValue | long | ✓ | 1 ~ 9223372036854775805 | Grade value to set | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | ItemSet | Item Set after addition |
| status | Status | Grade status set |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
| overflowCount | long | Quantity of items transferred to GS2-Inbox that were not received beyond the possession limit |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.AcquireItemSetWithGradeByUserId(
&inventory.AcquireItemSetWithGradeByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
ItemName: pointy.String("item-0001"),
UserId: pointy.String("user-0001"),
GradeModelId: pointy.String("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001"),
GradeValue: pointy.Int64(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
status := result.Status
itemModel := result.ItemModel
inventory := result.Inventory
overflowCount := result.OverflowCountuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireItemSetWithGradeByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->acquireItemSetWithGradeByUserId(
(new AcquireItemSetWithGradeByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withItemName("item-0001")
->withUserId("user-0001")
->withGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
->withGradeValue(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$status = $result->getStatus();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
$overflowCount = $result->getOverflowCount();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireItemSetWithGradeByUserIdRequest;
import io.gs2.inventory.result.AcquireItemSetWithGradeByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
AcquireItemSetWithGradeByUserIdResult result = client.acquireItemSetWithGradeByUserId(
new AcquireItemSetWithGradeByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withUserId("user-0001")
.withGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
.withGradeValue(1L)
.withTimeOffsetToken(null)
);
ItemSet item = result.getItem();
Status status = result.getStatus();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
long overflowCount = result.getOverflowCount();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.AcquireItemSetWithGradeByUserIdResult> asyncResult = null;
yield return client.AcquireItemSetWithGradeByUserId(
new Gs2.Gs2Inventory.Request.AcquireItemSetWithGradeByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithItemName("item-0001")
.WithUserId("user-0001")
.WithGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
.WithGradeValue(1L)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var status = result.Status;
var itemModel = result.ItemModel;
var inventory = result.Inventory;
var overflowCount = result.OverflowCount;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.acquireItemSetWithGradeByUserId(
new Gs2Inventory.AcquireItemSetWithGradeByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withUserId("user-0001")
.withGradeModelId("grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001")
.withGradeValue(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const status = result.getStatus();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
const overflowCount = result.getOverflowCount();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.acquire_item_set_with_grade_by_user_id(
inventory.AcquireItemSetWithGradeByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_item_name('item-0001')
.with_user_id('user-0001')
.with_grade_model_id('grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001')
.with_grade_value(1)
.with_time_offset_token(None)
)
item = result.item
status = result.status
item_model = result.item_model
inventory = result.inventory
overflow_count = result.overflow_count
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.acquire_item_set_with_grade_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
itemName="item-0001",
userId="user-0001",
gradeModelId="grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001",
gradeValue=1,
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;
status = result.status;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;client = gs2('inventory')
api_result_handler = client.acquire_item_set_with_grade_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
itemName="item-0001",
userId="user-0001",
gradeModelId="grn:ap-northeast-1:YourOwnerId:grade:namespace-0001:model:grade-0001",
gradeValue=1,
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;
status = result.status;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;consumeItemSet
Consume Item Sets
Reduces the quantity of the specified item in the requesting user’s inventory. If itemSetName is specified, consumption targets that specific stack only. Without it, items are consumed across all stacks of that item type. When an item set’s count reaches zero, it is automatically deleted. Returns an Insufficient error if the user does not have enough items to consume the requested amount.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| consumeCount | long | ✓ | 1 ~ 9223372036854775805 | Consumption quantity | ||
| itemSetName | string | ~ 36 chars | Name identifying the Item Set |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets per post-consumption |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ConsumeItemSet(
&inventory.ConsumeItemSetRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ConsumeCount: pointy.Int64(1),
ItemSetName: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeItemSetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->consumeItemSet(
(new ConsumeItemSetRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withConsumeCount(1)
->withItemSetName(null)
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeItemSetRequest;
import io.gs2.inventory.result.ConsumeItemSetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ConsumeItemSetResult result = client.consumeItemSet(
new ConsumeItemSetRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withConsumeCount(1L)
.withItemSetName(null)
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ConsumeItemSetResult> asyncResult = null;
yield return client.ConsumeItemSet(
new Gs2.Gs2Inventory.Request.ConsumeItemSetRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithConsumeCount(1L)
.WithItemSetName(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.consumeItemSet(
new Gs2Inventory.ConsumeItemSetRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withConsumeCount(1)
.withItemSetName(null)
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.consume_item_set(
inventory.ConsumeItemSetRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_consume_count(1)
.with_item_set_name(None)
)
items = result.items
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.consume_item_set({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
consumeCount=1,
itemSetName=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.consume_item_set_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
consumeCount=1,
itemSetName=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;
itemModel = result.itemModel;
inventory = result.inventory;consumeItemSetByUserId
Consume Item Sets by specifying the user ID
Reduces the quantity of the specified item in the given user’s inventory. If itemSetName is specified, consumption targets that specific stack only. Without it, items are consumed across all stacks of that item type. When an item set’s count reaches zero, it is automatically deleted. Returns an Insufficient error if the user does not have enough items.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| consumeCount | long | ✓ | 1 ~ 9223372036854775805 | Consumption quantity | ||
| itemSetName | string | ~ 36 chars | Name identifying the Item Set | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of Item Sets per post-consumption |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ConsumeItemSetByUserId(
&inventory.ConsumeItemSetByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ConsumeCount: pointy.Int64(1),
ItemSetName: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeItemSetByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->consumeItemSetByUserId(
(new ConsumeItemSetByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withConsumeCount(1)
->withItemSetName(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeItemSetByUserIdRequest;
import io.gs2.inventory.result.ConsumeItemSetByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ConsumeItemSetByUserIdResult result = client.consumeItemSetByUserId(
new ConsumeItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withConsumeCount(1L)
.withItemSetName(null)
.withTimeOffsetToken(null)
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ConsumeItemSetByUserIdResult> asyncResult = null;
yield return client.ConsumeItemSetByUserId(
new Gs2.Gs2Inventory.Request.ConsumeItemSetByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithConsumeCount(1L)
.WithItemSetName(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.consumeItemSetByUserId(
new Gs2Inventory.ConsumeItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withConsumeCount(1)
.withItemSetName(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.consume_item_set_by_user_id(
inventory.ConsumeItemSetByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_consume_count(1)
.with_item_set_name(None)
.with_time_offset_token(None)
)
items = result.items
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.consume_item_set_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
consumeCount=1,
itemSetName=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.consume_item_set_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
consumeCount=1,
itemSetName=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;deleteItemSetByUserId
Delete Item Set
Permanently deletes the specified item from the user’s inventory. If itemSetName is specified, only that specific stack is deleted. Without it, all stacks of the item type are deleted. Unlike consume, this operation does not require a specific quantity and removes the entire item set regardless of its count.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ~ 36 chars | Name identifying the item set | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of deleted Item Sets |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteItemSetByUserId(
&inventory.DeleteItemSetByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("itemSet-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteItemSetByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteItemSetByUserId(
(new DeleteItemSetByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName("itemSet-0001")
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteItemSetByUserIdRequest;
import io.gs2.inventory.result.DeleteItemSetByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteItemSetByUserIdResult result = client.deleteItemSetByUserId(
new DeleteItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("itemSet-0001")
.withTimeOffsetToken(null)
);
List<ItemSet> items = result.getItems();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteItemSetByUserIdResult> asyncResult = null;
yield return client.DeleteItemSetByUserId(
new Gs2.Gs2Inventory.Request.DeleteItemSetByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName("itemSet-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteItemSetByUserId(
new Gs2Inventory.DeleteItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("itemSet-0001")
.withTimeOffsetToken(null)
);
const items = result.getItems();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_item_set_by_user_id(
inventory.DeleteItemSetByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name('itemSet-0001')
.with_time_offset_token(None)
)
items = result.items
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_item_set_by_user_id({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
itemName="item-0001",
itemSetName="itemSet-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.delete_item_set_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
itemName="item-0001",
itemSetName="itemSet-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;verifyItemSet
Verify the quantity of Item Sets in possession
Verifies that the requesting user’s total item count satisfies the specified condition. The count is summed across all item sets of the specified item type. Supports 6 comparison operators: less, lessEqual, greater, greaterEqual, equal, notEqual. If the condition is not met, an error is returned with the inverted condition name (e.g., a “less” check failure returns a “greaterEqual” error).
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| itemSetName | string | ~ 36 chars | Name identifying the item set | |||||||||||||||||
| count | long | ✓ | 0 ~ 9223372036854775805 | Quantity in possession | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of deleted Item Sets |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyItemSet(
&inventory.VerifyItemSetRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
InventoryName: pointy.String("inventory-0001"),
ItemName: pointy.String("item-0001"),
VerifyType: pointy.String("less"),
ItemSetName: nil,
Count: pointy.Int64(10),
MultiplyValueSpecifyingQuantity: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyItemSetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyItemSet(
(new VerifyItemSetRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withInventoryName("inventory-0001")
->withItemName("item-0001")
->withVerifyType("less")
->withItemSetName(null)
->withCount(10)
->withMultiplyValueSpecifyingQuantity(null)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyItemSetRequest;
import io.gs2.inventory.result.VerifyItemSetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyItemSetResult result = client.verifyItemSet(
new VerifyItemSetRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withItemSetName(null)
.withCount(10L)
.withMultiplyValueSpecifyingQuantity(null)
);
List<ItemSet> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyItemSetResult> asyncResult = null;
yield return client.VerifyItemSet(
new Gs2.Gs2Inventory.Request.VerifyItemSetRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithInventoryName("inventory-0001")
.WithItemName("item-0001")
.WithVerifyType("less")
.WithItemSetName(null)
.WithCount(10L)
.WithMultiplyValueSpecifyingQuantity(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyItemSet(
new Gs2Inventory.VerifyItemSetRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withItemSetName(null)
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_item_set(
inventory.VerifyItemSetRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_inventory_name('inventory-0001')
.with_item_name('item-0001')
.with_verify_type('less')
.with_item_set_name(None)
.with_count(10)
.with_multiply_value_specifying_quantity(None)
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_item_set({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
itemSetName=nil,
count=10,
multiplyValueSpecifyingQuantity=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.verify_item_set_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
itemSetName=nil,
count=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;verifyItemSetByUserId
Verify the quantity of Item Sets in possession by specifying the user ID
Verifies that the specified user’s total item count satisfies the given condition. The count is summed across all item sets of the specified item type. Supports 6 comparison operators: less, lessEqual, greater, greaterEqual, equal, notEqual.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| userId | string | ✓ | ~ 128 chars | User ID | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| itemSetName | string | ~ 36 chars | Name identifying the item set | |||||||||||||||||
| count | long | ✓ | 0 ~ 9223372036854775805 | Quantity in possession | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity | |||||||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemSet> | List of deleted Item Sets |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyItemSetByUserId(
&inventory.VerifyItemSetByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
InventoryName: pointy.String("inventory-0001"),
ItemName: pointy.String("item-0001"),
VerifyType: pointy.String("less"),
ItemSetName: nil,
Count: pointy.Int64(10),
MultiplyValueSpecifyingQuantity: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyItemSetByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyItemSetByUserId(
(new VerifyItemSetByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withInventoryName("inventory-0001")
->withItemName("item-0001")
->withVerifyType("less")
->withItemSetName(null)
->withCount(10)
->withMultiplyValueSpecifyingQuantity(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyItemSetByUserIdRequest;
import io.gs2.inventory.result.VerifyItemSetByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyItemSetByUserIdResult result = client.verifyItemSetByUserId(
new VerifyItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withItemSetName(null)
.withCount(10L)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
List<ItemSet> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyItemSetByUserIdResult> asyncResult = null;
yield return client.VerifyItemSetByUserId(
new Gs2.Gs2Inventory.Request.VerifyItemSetByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithInventoryName("inventory-0001")
.WithItemName("item-0001")
.WithVerifyType("less")
.WithItemSetName(null)
.WithCount(10L)
.WithMultiplyValueSpecifyingQuantity(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyItemSetByUserId(
new Gs2Inventory.VerifyItemSetByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withItemSetName(null)
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_item_set_by_user_id(
inventory.VerifyItemSetByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_inventory_name('inventory-0001')
.with_item_name('item-0001')
.with_verify_type('less')
.with_item_set_name(None)
.with_count(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_item_set_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
itemSetName=nil,
count=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.verify_item_set_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
itemSetName=nil,
count=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;describeReferenceOf
Get a list of references
Retrieves the list of reference strings registered on a specific item set for the requesting user. References are used to associate item sets with external entities (e.g., equipment slots), and when protectReferencedItem is enabled on the inventory model, items with references cannot be consumed or deleted.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. |
Result
| Type | Description | |
|---|---|---|
| items | List<string> | List of References for this possession |
| itemSet | ItemSet | Item Set |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeReferenceOf(
&inventory.DescribeReferenceOfRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeReferenceOfRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeReferenceOf(
(new DescribeReferenceOfRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
);
$items = $result->getItems();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeReferenceOfRequest;
import io.gs2.inventory.result.DescribeReferenceOfResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeReferenceOfResult result = client.describeReferenceOf(
new DescribeReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
);
List<String> items = result.getItems();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeReferenceOfResult> asyncResult = null;
yield return client.DescribeReferenceOf(
new Gs2.Gs2Inventory.Request.DescribeReferenceOfRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeReferenceOf(
new Gs2Inventory.DescribeReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
);
const items = result.getItems();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_reference_of(
inventory.DescribeReferenceOfRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
)
items = result.items
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_reference_of({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.describe_reference_of_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;describeReferenceOfByUserId
Get a list of references by specifying a user ID
Retrieves the list of reference strings registered on a specific item set for the specified user. References are used to associate item sets with external entities (e.g., equipment slots), and when protectReferencedItem is enabled on the inventory model, items with references cannot be consumed or deleted.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<string> | List of References for this possession |
| itemSet | ItemSet | Item Set |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeReferenceOfByUserId(
&inventory.DescribeReferenceOfByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeReferenceOfByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeReferenceOfByUserId(
(new DescribeReferenceOfByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeReferenceOfByUserIdRequest;
import io.gs2.inventory.result.DescribeReferenceOfByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeReferenceOfByUserIdResult result = client.describeReferenceOfByUserId(
new DescribeReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withTimeOffsetToken(null)
);
List<String> items = result.getItems();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeReferenceOfByUserIdResult> asyncResult = null;
yield return client.DescribeReferenceOfByUserId(
new Gs2.Gs2Inventory.Request.DescribeReferenceOfByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeReferenceOfByUserId(
new Gs2Inventory.DescribeReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withTimeOffsetToken(null)
);
const items = result.getItems();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_reference_of_by_user_id(
inventory.DescribeReferenceOfByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_time_offset_token(None)
)
items = result.items
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_reference_of_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.describe_reference_of_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;getReferenceOf
Get reference source
Retrieves a specific reference string registered on an item set for the requesting user. Also returns the associated item set, item model, and inventory data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. |
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetReferenceOf(
&inventory.GetReferenceOfRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: ['resource-0001'],
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetReferenceOfRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getReferenceOf(
(new GetReferenceOfRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf(['resource-0001'])
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetReferenceOfRequest;
import io.gs2.inventory.result.GetReferenceOfResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetReferenceOfResult result = client.getReferenceOf(
new GetReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetReferenceOfResult> asyncResult = null;
yield return client.GetReferenceOf(
new Gs2.Gs2Inventory.Request.GetReferenceOfRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf(['resource-0001']),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getReferenceOf(
new Gs2Inventory.GetReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_reference_of(
inventory.GetReferenceOfRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of(['resource-0001'])
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_reference_of({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-0001'],
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.get_reference_of_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;getReferenceOfByUserId
Get reference source by specifying a user ID
Retrieves a specific reference string registered on an item set for the specified user. Also returns the associated item set, item model, and inventory data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetReferenceOfByUserId(
&inventory.GetReferenceOfByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: ['resource-0001'],
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetReferenceOfByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getReferenceOfByUserId(
(new GetReferenceOfByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf(['resource-0001'])
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetReferenceOfByUserIdRequest;
import io.gs2.inventory.result.GetReferenceOfByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetReferenceOfByUserIdResult result = client.getReferenceOfByUserId(
new GetReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
.withTimeOffsetToken(null)
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetReferenceOfByUserIdResult> asyncResult = null;
yield return client.GetReferenceOfByUserId(
new Gs2.Gs2Inventory.Request.GetReferenceOfByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf(['resource-0001'])
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getReferenceOfByUserId(
new Gs2Inventory.GetReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
.withTimeOffsetToken(null)
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_reference_of_by_user_id(
inventory.GetReferenceOfByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of(['resource-0001'])
.with_time_offset_token(None)
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_reference_of_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.get_reference_of_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;verifyReferenceOf
Verify the reference source
Verifies the state of a reference on an item set for the requesting user. Supports four verification types: not_entry (reference not yet registered), already_entry (reference already registered), empty (no references at all), and not_empty (at least one reference exists). If the condition is not met, an error is returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||||||||||||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||||||||||||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||||||||||||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |||||||||||
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. | ||||||||||||
| verifyType | String Enum enum { “not_entry”, “already_entry”, “empty”, “not_empty” } | ✓ | Type of verification
|
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyReferenceOf(
&inventory.VerifyReferenceOfRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: pointy.String("resource-0001"),
VerifyType: pointy.String("not_entry"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyReferenceOfRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyReferenceOf(
(new VerifyReferenceOfRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf("resource-0001")
->withVerifyType("not_entry")
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyReferenceOfRequest;
import io.gs2.inventory.result.VerifyReferenceOfResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyReferenceOfResult result = client.verifyReferenceOf(
new VerifyReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
.withVerifyType("not_entry")
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyReferenceOfResult> asyncResult = null;
yield return client.VerifyReferenceOf(
new Gs2.Gs2Inventory.Request.VerifyReferenceOfRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf("resource-0001")
.WithVerifyType("not_entry"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyReferenceOf(
new Gs2Inventory.VerifyReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
.withVerifyType("not_entry")
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_reference_of(
inventory.VerifyReferenceOfRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of('resource-0001')
.with_verify_type('not_entry')
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_reference_of({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-0001",
verifyType="not_entry",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.verify_reference_of_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-0001",
verifyType="not_entry",
})
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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;verifyReferenceOfByUserId
Verify the reference source by specifying the user ID
Verifies the state of a reference on an item set for the specified user. Supports four verification types: not_entry (reference not yet registered), already_entry (reference already registered), empty (no references at all), and not_empty (at least one reference exists). If the condition is not met, an error is returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||||||||||||
| userId | string | ✓ | ~ 128 chars | User ID | ||||||||||||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||||||||||||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |||||||||||
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. | ||||||||||||
| verifyType | String Enum enum { “not_entry”, “already_entry”, “empty”, “not_empty” } | ✓ | Type of verification
| |||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyReferenceOfByUserId(
&inventory.VerifyReferenceOfByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: pointy.String("resource-0001"),
VerifyType: pointy.String("not_entry"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyReferenceOfByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyReferenceOfByUserId(
(new VerifyReferenceOfByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf("resource-0001")
->withVerifyType("not_entry")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyReferenceOfByUserIdRequest;
import io.gs2.inventory.result.VerifyReferenceOfByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyReferenceOfByUserIdResult result = client.verifyReferenceOfByUserId(
new VerifyReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
.withVerifyType("not_entry")
.withTimeOffsetToken(null)
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyReferenceOfByUserIdResult> asyncResult = null;
yield return client.VerifyReferenceOfByUserId(
new Gs2.Gs2Inventory.Request.VerifyReferenceOfByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf("resource-0001")
.WithVerifyType("not_entry")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyReferenceOfByUserId(
new Gs2Inventory.VerifyReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
.withVerifyType("not_entry")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_reference_of_by_user_id(
inventory.VerifyReferenceOfByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of('resource-0001')
.with_verify_type('not_entry')
.with_time_offset_token(None)
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_reference_of_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-0001",
verifyType="not_entry",
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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.verify_reference_of_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-0001",
verifyType="not_entry",
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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;addReferenceOf
Add a reference
Registers a reference string on the specified item set for the requesting user. References associate the item set with an external entity (e.g., an equipment slot or character). When protectReferencedItem is enabled on the inventory model, items with references cannot be consumed or deleted, preventing accidental loss of equipped items.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. |
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set after addition of reference source |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.AddReferenceOf(
&inventory.AddReferenceOfRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: ['resource-0001'],
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AddReferenceOfRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->addReferenceOf(
(new AddReferenceOfRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf(['resource-0001'])
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AddReferenceOfRequest;
import io.gs2.inventory.result.AddReferenceOfResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
AddReferenceOfResult result = client.addReferenceOf(
new AddReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.AddReferenceOfResult> asyncResult = null;
yield return client.AddReferenceOf(
new Gs2.Gs2Inventory.Request.AddReferenceOfRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf(['resource-0001']),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.addReferenceOf(
new Gs2Inventory.AddReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.add_reference_of(
inventory.AddReferenceOfRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of(['resource-0001'])
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.add_reference_of({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-0001'],
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.add_reference_of_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;addReferenceOfByUserId
Add a reference by specifying a user ID
Registers a reference string on the specified item set for the specified user. References associate the item set with an external entity (e.g., an equipment slot or character). When protectReferencedItem is enabled on the inventory model, items with references cannot be consumed or deleted, preventing accidental loss of equipped items.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set after addition of reference source |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.AddReferenceOfByUserId(
&inventory.AddReferenceOfByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: ['resource-0001'],
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AddReferenceOfByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->addReferenceOfByUserId(
(new AddReferenceOfByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf(['resource-0001'])
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AddReferenceOfByUserIdRequest;
import io.gs2.inventory.result.AddReferenceOfByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
AddReferenceOfByUserIdResult result = client.addReferenceOfByUserId(
new AddReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
.withTimeOffsetToken(null)
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.AddReferenceOfByUserIdResult> asyncResult = null;
yield return client.AddReferenceOfByUserId(
new Gs2.Gs2Inventory.Request.AddReferenceOfByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf(['resource-0001'])
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.addReferenceOfByUserId(
new Gs2Inventory.AddReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf(['resource-0001'])
.withTimeOffsetToken(null)
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.add_reference_of_by_user_id(
inventory.AddReferenceOfByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of(['resource-0001'])
.with_time_offset_token(None)
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.add_reference_of_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.add_reference_of_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf=['resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;deleteReferenceOf
Delete References
Removes a specific reference string from the specified item set for the requesting user. After removal, if protectReferencedItem is enabled and no other references remain, the item becomes eligible for consumption or deletion again.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. |
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set after deleting the reference source |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteReferenceOf(
&inventory.DeleteReferenceOfRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: pointy.String("resource-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteReferenceOfRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteReferenceOf(
(new DeleteReferenceOfRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf("resource-0001")
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteReferenceOfRequest;
import io.gs2.inventory.result.DeleteReferenceOfResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteReferenceOfResult result = client.deleteReferenceOf(
new DeleteReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteReferenceOfResult> asyncResult = null;
yield return client.DeleteReferenceOf(
new Gs2.Gs2Inventory.Request.DeleteReferenceOfRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf("resource-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteReferenceOf(
new Gs2Inventory.DeleteReferenceOfRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_reference_of(
inventory.DeleteReferenceOfRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of('resource-0001')
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_reference_of({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.delete_reference_of_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;deleteReferenceOfByUserId
Delete the reference source by specifying the user ID
Removes a specific reference string from the specified item set for the specified user. After removal, if protectReferencedItem is enabled and no other references remain, the item becomes eligible for consumption or deletion again.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| itemSetName | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| referenceOf | string | ✓ | ~ 1024 chars | Reference A string identifier representing an external reference to this item set, such as an equipment slot or formation binding. When protectReferencedItem is enabled on the inventory model, item sets with references cannot be consumed or deleted. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | string | References for this possession |
| itemSet | ItemSet | Item Set after deleting the reference source |
| itemModel | ItemModel | Item Model |
| inventory | Inventory | Inventory |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteReferenceOfByUserId(
&inventory.DeleteReferenceOfByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ItemSetName: pointy.String("item-set-0001"),
ReferenceOf: pointy.String("resource-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventoryuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteReferenceOfByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteReferenceOfByUserId(
(new DeleteReferenceOfByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withItemSetName("item-set-0001")
->withReferenceOf("resource-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$itemSet = $result->getItemSet();
$itemModel = $result->getItemModel();
$inventory = $result->getInventory();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteReferenceOfByUserIdRequest;
import io.gs2.inventory.result.DeleteReferenceOfByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteReferenceOfByUserIdResult result = client.deleteReferenceOfByUserId(
new DeleteReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
.withTimeOffsetToken(null)
);
String item = result.getItem();
ItemSet itemSet = result.getItemSet();
ItemModel itemModel = result.getItemModel();
Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteReferenceOfByUserIdResult> asyncResult = null;
yield return client.DeleteReferenceOfByUserId(
new Gs2.Gs2Inventory.Request.DeleteReferenceOfByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithItemSetName("item-set-0001")
.WithReferenceOf("resource-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemSet = result.ItemSet;
var itemModel = result.ItemModel;
var inventory = result.Inventory;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteReferenceOfByUserId(
new Gs2Inventory.DeleteReferenceOfByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withItemSetName("item-set-0001")
.withReferenceOf("resource-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const itemSet = result.getItemSet();
const itemModel = result.getItemModel();
const inventory = result.getInventory();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_reference_of_by_user_id(
inventory.DeleteReferenceOfByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_item_set_name('item-set-0001')
.with_reference_of('resource-0001')
.with_time_offset_token(None)
)
item = result.item
item_set = result.item_set
item_model = result.item_model
inventory = result.inventory
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_reference_of_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;client = gs2('inventory')
api_result_handler = client.delete_reference_of_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
itemSetName="item-set-0001",
referenceOf="resource-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;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;describeSimpleItems
Get a list of Simple Items
Retrieves a paginated list of the requesting user’s simple items within the specified simple inventory. Each simple item tracks a single count value for an item type, without stacking, expiration, or references.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleItem> | List of Simple Items |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeSimpleItems(
&inventory.DescribeSimpleItemsRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeSimpleItems(
(new DescribeSimpleItemsRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withAccessToken("accessToken-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemsRequest;
import io.gs2.inventory.result.DescribeSimpleItemsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeSimpleItemsResult result = client.describeSimpleItems(
new DescribeSimpleItemsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<SimpleItem> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemsResult> asyncResult = null;
yield return client.DescribeSimpleItems(
new Gs2.Gs2Inventory.Request.DescribeSimpleItemsRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeSimpleItems(
new Gs2Inventory.DescribeSimpleItemsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_simple_items(
inventory.DescribeSimpleItemsRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_access_token('accessToken-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_simple_items({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_simple_items_async({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeSimpleItemsByUserId
Get a list of Simple Items by specifying a user ID
Retrieves a paginated list of the specified user’s simple items within the given simple inventory.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleItem> | List of Simple Items |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeSimpleItemsByUserId(
&inventory.DescribeSimpleItemsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeSimpleItemsByUserId(
(new DescribeSimpleItemsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.DescribeSimpleItemsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeSimpleItemsByUserIdResult result = client.describeSimpleItemsByUserId(
new DescribeSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<SimpleItem> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemsByUserIdResult> asyncResult = null;
yield return client.DescribeSimpleItemsByUserId(
new Gs2.Gs2Inventory.Request.DescribeSimpleItemsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeSimpleItemsByUserId(
new Gs2Inventory.DescribeSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_simple_items_by_user_id(
inventory.DescribeSimpleItemsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_simple_items_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_simple_items_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;getSimpleItem
Get a Simple Item
Retrieves the requesting user’s simple item with the specified name, including its current count and the associated item model.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItem | Simple Item |
| itemModel | SimpleItemModel | Simple Item Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleItem(
&inventory.GetSimpleItemRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemModel := result.ItemModeluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleItem(
(new GetSimpleItemRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
);
$item = $result->getItem();
$itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemRequest;
import io.gs2.inventory.result.GetSimpleItemResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleItemResult result = client.getSimpleItem(
new GetSimpleItemRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
);
SimpleItem item = result.getItem();
SimpleItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemResult> asyncResult = null;
yield return client.GetSimpleItem(
new Gs2.Gs2Inventory.Request.GetSimpleItemRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleItem(
new Gs2Inventory.GetSimpleItemRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
);
const item = result.getItem();
const itemModel = result.getItemModel();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_item(
inventory.GetSimpleItemRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
)
item = result.item
item_model = result.item_model
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_item({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
itemName="item-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
itemModel = result.itemModel;client = gs2('inventory')
api_result_handler = client.get_simple_item_async({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
itemName="item-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;
itemModel = result.itemModel;getSimpleItemByUserId
Get a Simple Item by specifying a user ID
Retrieves the specified user’s simple item with the given name, including its current count and the associated item model.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItem | Simple Item |
| itemModel | SimpleItemModel | Simple Item Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleItemByUserId(
&inventory.GetSimpleItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemModel := result.ItemModeluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleItemByUserId(
(new GetSimpleItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemByUserIdRequest;
import io.gs2.inventory.result.GetSimpleItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleItemByUserIdResult result = client.getSimpleItemByUserId(
new GetSimpleItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withTimeOffsetToken(null)
);
SimpleItem item = result.getItem();
SimpleItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemByUserIdResult> asyncResult = null;
yield return client.GetSimpleItemByUserId(
new Gs2.Gs2Inventory.Request.GetSimpleItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleItemByUserId(
new Gs2Inventory.GetSimpleItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const itemModel = result.getItemModel();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_item_by_user_id(
inventory.GetSimpleItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_time_offset_token(None)
)
item = result.item
item_model = result.item_model
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_item_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-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;
itemModel = result.itemModel;client = gs2('inventory')
api_result_handler = client.get_simple_item_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-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;
itemModel = result.itemModel;getSimpleItemWithSignature
Get a Simple Item along with the signature
Retrieves the simple item with a cryptographic signature for authenticity verification. The signature is generated using the specified encryption key, allowing external systems to validate the item data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItem | Simple Item |
| simpleItemModel | SimpleItemModel | Simple Item Model |
| body | string | Simple Item Information for Signature Subject |
| signature | string | Signature |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleItemWithSignature(
&inventory.GetSimpleItemWithSignatureRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
simpleItemModel := result.SimpleItemModel
body := result.Body
signature := result.Signatureuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemWithSignatureRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleItemWithSignature(
(new GetSimpleItemWithSignatureRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withKeyId("key-0001")
);
$item = $result->getItem();
$simpleItemModel = $result->getSimpleItemModel();
$body = $result->getBody();
$signature = $result->getSignature();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemWithSignatureRequest;
import io.gs2.inventory.result.GetSimpleItemWithSignatureResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleItemWithSignatureResult result = client.getSimpleItemWithSignature(
new GetSimpleItemWithSignatureRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withKeyId("key-0001")
);
SimpleItem item = result.getItem();
SimpleItemModel simpleItemModel = result.getSimpleItemModel();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureResult> asyncResult = null;
yield return client.GetSimpleItemWithSignature(
new Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var simpleItemModel = result.SimpleItemModel;
var body = result.Body;
var signature = result.Signature;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleItemWithSignature(
new Gs2Inventory.GetSimpleItemWithSignatureRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withKeyId("key-0001")
);
const item = result.getItem();
const simpleItemModel = result.getSimpleItemModel();
const body = result.getBody();
const signature = result.getSignature();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_item_with_signature(
inventory.GetSimpleItemWithSignatureRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_key_id('key-0001')
)
item = result.item
simple_item_model = result.simple_item_model
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_item_with_signature({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
simpleItemModel = result.simpleItemModel;
body = result.body;
signature = result.signature;client = gs2('inventory')
api_result_handler = client.get_simple_item_with_signature_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
keyId="key-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;
simpleItemModel = result.simpleItemModel;
body = result.body;
signature = result.signature;getSimpleItemWithSignatureByUserId
Get a Simple Item with signature by specifying the user ID
Retrieves the specified user’s simple item with a cryptographic signature for external authenticity verification.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItem | Simple Item |
| simpleItemModel | SimpleItemModel | Simple Item Model |
| body | string | Simple Item Information for Signature Subject |
| signature | string | Signature |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleItemWithSignatureByUserId(
&inventory.GetSimpleItemWithSignatureByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
KeyId: pointy.String("key-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
simpleItemModel := result.SimpleItemModel
body := result.Body
signature := result.Signatureuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemWithSignatureByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleItemWithSignatureByUserId(
(new GetSimpleItemWithSignatureByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withKeyId("key-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$simpleItemModel = $result->getSimpleItemModel();
$body = $result->getBody();
$signature = $result->getSignature();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemWithSignatureByUserIdRequest;
import io.gs2.inventory.result.GetSimpleItemWithSignatureByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleItemWithSignatureByUserIdResult result = client.getSimpleItemWithSignatureByUserId(
new GetSimpleItemWithSignatureByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withKeyId("key-0001")
.withTimeOffsetToken(null)
);
SimpleItem item = result.getItem();
SimpleItemModel simpleItemModel = result.getSimpleItemModel();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetSimpleItemWithSignatureByUserId(
new Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithKeyId("key-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var simpleItemModel = result.SimpleItemModel;
var body = result.Body;
var signature = result.Signature;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleItemWithSignatureByUserId(
new Gs2Inventory.GetSimpleItemWithSignatureByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withKeyId("key-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const simpleItemModel = result.getSimpleItemModel();
const body = result.getBody();
const signature = result.getSignature();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_item_with_signature_by_user_id(
inventory.GetSimpleItemWithSignatureByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_key_id('key-0001')
.with_time_offset_token(None)
)
item = result.item
simple_item_model = result.simple_item_model
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_item_with_signature_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
keyId="key-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;
simpleItemModel = result.simpleItemModel;
body = result.body;
signature = result.signature;client = gs2('inventory')
api_result_handler = client.get_simple_item_with_signature_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
keyId="key-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;
simpleItemModel = result.simpleItemModel;
body = result.body;
signature = result.signature;acquireSimpleItemsByUserId
Acquire Simple Items by specifying a user ID
Adds items to the user’s simple inventory using a batch of acquire counts. Multiple items can be acquired in a single atomic operation — the acquireCounts array specifies the item name and quantity for each item to acquire. Unlike regular item sets, simple items have no capacity limits, stacking limits, or expiration.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| acquireCounts | List<AcquireCount> | ✓ | 1 ~ 100 items | List of acquisition quantities for Simple Items | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleItem> | List of Simple Items after addition |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.AcquireSimpleItemsByUserId(
&inventory.AcquireSimpleItemsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
UserId: pointy.String("user-0001"),
AcquireCounts: []inventory.AcquireCount{
inventory.AcquireCount{
ItemName: pointy.String("item-0001"),
Count: pointy.Int64(5),
},
},
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireSimpleItemsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->acquireSimpleItemsByUserId(
(new AcquireSimpleItemsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withUserId("user-0001")
->withAcquireCounts([
(new \Gs2\Inventory\Model\AcquireCount())
->withItemName("item-0001")
->withCount(5),
])
->withTimeOffsetToken(null)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.AcquireSimpleItemsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
AcquireSimpleItemsByUserIdResult result = client.acquireSimpleItemsByUserId(
new AcquireSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withAcquireCounts(Arrays.asList(
new io.gs2.inventory.model.AcquireCount()
.withItemName("item-0001")
.withCount(5L)
))
.withTimeOffsetToken(null)
);
List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.AcquireSimpleItemsByUserIdResult> asyncResult = null;
yield return client.AcquireSimpleItemsByUserId(
new Gs2.Gs2Inventory.Request.AcquireSimpleItemsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithUserId("user-0001")
.WithAcquireCounts(new Gs2.Gs2Inventory.Model.AcquireCount[] {
new Gs2.Gs2Inventory.Model.AcquireCount()
.WithItemName("item-0001")
.WithCount(5L),
})
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.acquireSimpleItemsByUserId(
new Gs2Inventory.AcquireSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withAcquireCounts([
new Gs2Inventory.model.AcquireCount()
.withItemName("item-0001")
.withCount(5),
])
.withTimeOffsetToken(null)
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.acquire_simple_items_by_user_id(
inventory.AcquireSimpleItemsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_user_id('user-0001')
.with_acquire_counts([
inventory.AcquireCount()
.with_item_name('item-0001')
.with_count(5),
])
.with_time_offset_token(None)
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.acquire_simple_items_by_user_id({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
acquireCounts={
{
itemName="item-0001",
count=5,
}
},
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.acquire_simple_items_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
acquireCounts={
{
itemName="item-0001",
count=5,
}
},
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;consumeSimpleItems
Consume Simple Items
Reduces the quantity of items in the requesting user’s simple inventory using a batch of consume counts. Multiple items can be consumed in a single atomic operation — if any item has insufficient quantity, the entire operation fails. Returns an Insufficient error if the user does not have enough of any specified item.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| consumeCounts | List<ConsumeCount> | ✓ | 1 ~ 100 items | List of consumption quantities of Simple Items |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleItem> | List of Simple Items per post-consumption |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ConsumeSimpleItems(
&inventory.ConsumeSimpleItemsRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ConsumeCounts: []inventory.ConsumeCount{
inventory.ConsumeCount{
ItemName: pointy.String("item-0001"),
Count: pointy.Int64(5),
},
inventory.ConsumeCount{
ItemName: pointy.String("item-0002"),
Count: pointy.Int64(3),
},
},
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeSimpleItemsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->consumeSimpleItems(
(new ConsumeSimpleItemsRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withConsumeCounts([
(new ConsumeCount())
->withItemName("item-0001")
->withCount(5),
(new ConsumeCount())
->withItemName("item-0002")
->withCount(3),
])
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeSimpleItemsRequest;
import io.gs2.inventory.result.ConsumeSimpleItemsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ConsumeSimpleItemsResult result = client.consumeSimpleItems(
new ConsumeSimpleItemsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withConsumeCounts(Arrays.asList(
new ConsumeCount()
.withItemName("item-0001")
.withCount(5L),
new ConsumeCount()
.withItemName("item-0002")
.withCount(3L)
))
);
List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ConsumeSimpleItemsResult> asyncResult = null;
yield return client.ConsumeSimpleItems(
new Gs2.Gs2Inventory.Request.ConsumeSimpleItemsRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithConsumeCounts(new Gs2.Gs2Inventory.Model.ConsumeCount[] {
new Gs2.Gs2Inventory.Model.ConsumeCount()
.WithItemName("item-0001")
.WithCount(5L),
new Gs2.Gs2Inventory.Model.ConsumeCount()
.WithItemName("item-0002")
.WithCount(3L),
}),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.consumeSimpleItems(
new Gs2Inventory.ConsumeSimpleItemsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withConsumeCounts([
new Gs2Inventory.model.ConsumeCount()
.withItemName("item-0001")
.withCount(5),
new Gs2Inventory.model.ConsumeCount()
.withItemName("item-0002")
.withCount(3),
])
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.consume_simple_items(
inventory.ConsumeSimpleItemsRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_consume_counts([
inventory.ConsumeCount()
.with_item_name('item-0001')
.with_count(5),
inventory.ConsumeCount()
.with_item_name('item-0002')
.with_count(3),
])
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.consume_simple_items({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
consumeCounts={
{
item_name="item-0001",
count=5,
},
{
item_name="item-0002",
count=3,
}
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.consume_simple_items_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
consumeCounts={
{
item_name="item-0001",
count=5,
},
{
item_name="item-0002",
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
items = result.items;consumeSimpleItemsByUserId
Consume Simple Items by specifying a user ID
Reduces the quantity of items in the specified user’s simple inventory using a batch of consume counts. Multiple items can be consumed in a single atomic operation — if any item has insufficient quantity, the entire operation fails.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| consumeCounts | List<ConsumeCount> | ✓ | 1 ~ 100 items | List of consumption quantities of Simple Items | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleItem> | List of Simple Items per post-consumption |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ConsumeSimpleItemsByUserId(
&inventory.ConsumeSimpleItemsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ConsumeCounts: []inventory.ConsumeCount{
inventory.ConsumeCount{
ItemName: pointy.String("item-0001"),
Count: pointy.Int64(5),
},
inventory.ConsumeCount{
ItemName: pointy.String("item-0002"),
Count: pointy.Int64(3),
},
},
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeSimpleItemsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->consumeSimpleItemsByUserId(
(new ConsumeSimpleItemsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withConsumeCounts([
(new ConsumeCount())
->withItemName("item-0001")
->withCount(5),
(new ConsumeCount())
->withItemName("item-0002")
->withCount(3),
])
->withTimeOffsetToken(null)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.ConsumeSimpleItemsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ConsumeSimpleItemsByUserIdResult result = client.consumeSimpleItemsByUserId(
new ConsumeSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withConsumeCounts(Arrays.asList(
new ConsumeCount()
.withItemName("item-0001")
.withCount(5L),
new ConsumeCount()
.withItemName("item-0002")
.withCount(3L)
))
.withTimeOffsetToken(null)
);
List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ConsumeSimpleItemsByUserIdResult> asyncResult = null;
yield return client.ConsumeSimpleItemsByUserId(
new Gs2.Gs2Inventory.Request.ConsumeSimpleItemsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithConsumeCounts(new Gs2.Gs2Inventory.Model.ConsumeCount[] {
new Gs2.Gs2Inventory.Model.ConsumeCount()
.WithItemName("item-0001")
.WithCount(5L),
new Gs2.Gs2Inventory.Model.ConsumeCount()
.WithItemName("item-0002")
.WithCount(3L),
})
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.consumeSimpleItemsByUserId(
new Gs2Inventory.ConsumeSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withConsumeCounts([
new Gs2Inventory.model.ConsumeCount()
.withItemName("item-0001")
.withCount(5),
new Gs2Inventory.model.ConsumeCount()
.withItemName("item-0002")
.withCount(3),
])
.withTimeOffsetToken(null)
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.consume_simple_items_by_user_id(
inventory.ConsumeSimpleItemsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_consume_counts([
inventory.ConsumeCount()
.with_item_name('item-0001')
.with_count(5),
inventory.ConsumeCount()
.with_item_name('item-0002')
.with_count(3),
])
.with_time_offset_token(None)
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.consume_simple_items_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
consumeCounts={
{
item_name="item-0001",
count=5,
},
{
item_name="item-0002",
count=3,
}
},
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.consume_simple_items_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
consumeCounts={
{
item_name="item-0001",
count=5,
},
{
item_name="item-0002",
count=3,
}
},
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;setSimpleItemsByUserId
Set the quantity of simple items by specifying a user ID
Sets the absolute quantities of multiple simple items in a single atomic operation. The counts array specifies the item name and target quantity for each item. This overwrites the current quantities entirely, unlike acquire/consume which are relative operations.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| counts | List<HeldCount> | ✓ | 1 ~ 100 items | List of quantity of Simple Items in possession | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleItem> | List of Simple Items after update |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.SetSimpleItemsByUserId(
&inventory.SetSimpleItemsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
Counts: []inventory.HeldCount{
inventory.HeldCount{
ItemName: pointy.String("item-0001"),
Count: pointy.Int64(5),
},
inventory.HeldCount{
ItemName: pointy.String("item-0002"),
Count: pointy.Int64(3),
},
},
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\SetSimpleItemsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->setSimpleItemsByUserId(
(new SetSimpleItemsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withCounts([
(new HeldCount())
->withItemName("item-0001")
->withCount(5),
(new HeldCount())
->withItemName("item-0002")
->withCount(3),
])
->withTimeOffsetToken(null)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.SetSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.SetSimpleItemsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
SetSimpleItemsByUserIdResult result = client.setSimpleItemsByUserId(
new SetSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withCounts(Arrays.asList(
new HeldCount()
.withItemName("item-0001")
.withCount(5L),
new HeldCount()
.withItemName("item-0002")
.withCount(3L)
))
.withTimeOffsetToken(null)
);
List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.SetSimpleItemsByUserIdResult> asyncResult = null;
yield return client.SetSimpleItemsByUserId(
new Gs2.Gs2Inventory.Request.SetSimpleItemsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithCounts(new Gs2.Gs2Inventory.Model.HeldCount[] {
new Gs2.Gs2Inventory.Model.HeldCount()
.WithItemName("item-0001")
.WithCount(5L),
new Gs2.Gs2Inventory.Model.HeldCount()
.WithItemName("item-0002")
.WithCount(3L),
})
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.setSimpleItemsByUserId(
new Gs2Inventory.SetSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withCounts([
new Gs2Inventory.model.HeldCount()
.withItemName("item-0001")
.withCount(5),
new Gs2Inventory.model.HeldCount()
.withItemName("item-0002")
.withCount(3),
])
.withTimeOffsetToken(null)
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.set_simple_items_by_user_id(
inventory.SetSimpleItemsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_counts([
inventory.HeldCount()
.with_item_name('item-0001')
.with_count(5),
inventory.HeldCount()
.with_item_name('item-0002')
.with_count(3),
])
.with_time_offset_token(None)
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.set_simple_items_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
counts={
{
item_name="item-0001",
count=5,
},
{
item_name="item-0002",
count=3,
}
},
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.set_simple_items_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
counts={
{
item_name="item-0001",
count=5,
},
{
item_name="item-0002",
count=3,
}
},
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;deleteSimpleItemsByUserId
Delete simple item possession quantities
Deletes all simple items in the specified simple inventory for the given user. This permanently removes all item data within the inventory.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific 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 |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteSimpleItemsByUserId(
&inventory.DeleteSimpleItemsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteSimpleItemsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteSimpleItemsByUserId(
(new DeleteSimpleItemsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteSimpleItemsByUserIdRequest;
import io.gs2.inventory.result.DeleteSimpleItemsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteSimpleItemsByUserIdResult result = client.deleteSimpleItemsByUserId(
new DeleteSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleItemsByUserIdResult> asyncResult = null;
yield return client.DeleteSimpleItemsByUserId(
new Gs2.Gs2Inventory.Request.DeleteSimpleItemsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteSimpleItemsByUserId(
new Gs2Inventory.DeleteSimpleItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_simple_items_by_user_id(
inventory.DeleteSimpleItemsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_simple_items_by_user_id({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('inventory')
api_result_handler = client.delete_simple_items_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="item",
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.resultverifySimpleItem
Verify the quantity of possessions in simple items
Verifies that the requesting user’s simple item count satisfies the specified condition. Supports 6 comparison operators: less, lessEqual, greater, greaterEqual, equal, notEqual. If the condition is not met, an error is returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| count | long | ✓ | 0 ~ 9223372036854775805 | Quantity in possession | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItem | Quantity of simple items |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifySimpleItem(
&inventory.VerifySimpleItemRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
InventoryName: pointy.String("inventory-0001"),
ItemName: pointy.String("item-0001"),
VerifyType: pointy.String("less"),
Count: pointy.Int64(10),
MultiplyValueSpecifyingQuantity: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifySimpleItemRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifySimpleItem(
(new VerifySimpleItemRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withInventoryName("inventory-0001")
->withItemName("item-0001")
->withVerifyType("less")
->withCount(10)
->withMultiplyValueSpecifyingQuantity(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifySimpleItemRequest;
import io.gs2.inventory.result.VerifySimpleItemResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifySimpleItemResult result = client.verifySimpleItem(
new VerifySimpleItemRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10L)
.withMultiplyValueSpecifyingQuantity(null)
);
SimpleItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifySimpleItemResult> asyncResult = null;
yield return client.VerifySimpleItem(
new Gs2.Gs2Inventory.Request.VerifySimpleItemRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithInventoryName("inventory-0001")
.WithItemName("item-0001")
.WithVerifyType("less")
.WithCount(10L)
.WithMultiplyValueSpecifyingQuantity(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifySimpleItem(
new Gs2Inventory.VerifySimpleItemRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_simple_item(
inventory.VerifySimpleItemRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_inventory_name('inventory-0001')
.with_item_name('item-0001')
.with_verify_type('less')
.with_count(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_simple_item({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.verify_simple_item_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;verifySimpleItemByUserId
Verify the quantity of possessions in simple items by specifying a user ID
Verifies that the specified user’s simple item count satisfies the given condition. Supports 6 comparison operators: less, lessEqual, greater, greaterEqual, equal, notEqual.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| userId | string | ✓ | ~ 128 chars | User ID | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| count | long | ✓ | 0 ~ 9223372036854775805 | Quantity in possession | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity | |||||||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItem | Quantity of simple items |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifySimpleItemByUserId(
&inventory.VerifySimpleItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
InventoryName: pointy.String("inventory-0001"),
ItemName: pointy.String("item-0001"),
VerifyType: pointy.String("less"),
Count: pointy.Int64(10),
MultiplyValueSpecifyingQuantity: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifySimpleItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifySimpleItemByUserId(
(new VerifySimpleItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withInventoryName("inventory-0001")
->withItemName("item-0001")
->withVerifyType("less")
->withCount(10)
->withMultiplyValueSpecifyingQuantity(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifySimpleItemByUserIdRequest;
import io.gs2.inventory.result.VerifySimpleItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifySimpleItemByUserIdResult result = client.verifySimpleItemByUserId(
new VerifySimpleItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10L)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
SimpleItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifySimpleItemByUserIdResult> asyncResult = null;
yield return client.VerifySimpleItemByUserId(
new Gs2.Gs2Inventory.Request.VerifySimpleItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithInventoryName("inventory-0001")
.WithItemName("item-0001")
.WithVerifyType("less")
.WithCount(10L)
.WithMultiplyValueSpecifyingQuantity(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifySimpleItemByUserId(
new Gs2Inventory.VerifySimpleItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_simple_item_by_user_id(
inventory.VerifySimpleItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_inventory_name('inventory-0001')
.with_item_name('item-0001')
.with_verify_type('less')
.with_count(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_simple_item_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.verify_simple_item_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeBigItems
Get a list of Big Items
Retrieves a paginated list of big items owned by the requesting user in the specified big inventory. Big items use string-based arbitrary-precision counts, suitable for values that exceed standard integer limits. Items that have never been acquired will not appear in the results.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<BigItem> | List of Quantity of Big Items |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeBigItems(
&inventory.DescribeBigItemsRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeBigItems(
(new DescribeBigItemsRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withAccessToken("accessToken-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemsRequest;
import io.gs2.inventory.result.DescribeBigItemsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeBigItemsResult result = client.describeBigItems(
new DescribeBigItemsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<BigItem> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemsResult> asyncResult = null;
yield return client.DescribeBigItems(
new Gs2.Gs2Inventory.Request.DescribeBigItemsRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeBigItems(
new Gs2Inventory.DescribeBigItemsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_big_items(
inventory.DescribeBigItemsRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_access_token('accessToken-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_big_items({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_big_items_async({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeBigItemsByUserId
Get a list of Big Items by specifying a user ID
Retrieves a paginated list of big items owned by the specified user in the specified big inventory. Big items use string-based arbitrary-precision counts, suitable for values that exceed standard integer limits. Items that have never been acquired will not appear in the results.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<BigItem> | List of Quantity of Big Items |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeBigItemsByUserId(
&inventory.DescribeBigItemsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeBigItemsByUserId(
(new DescribeBigItemsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemsByUserIdRequest;
import io.gs2.inventory.result.DescribeBigItemsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeBigItemsByUserIdResult result = client.describeBigItemsByUserId(
new DescribeBigItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<BigItem> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemsByUserIdResult> asyncResult = null;
yield return client.DescribeBigItemsByUserId(
new Gs2.Gs2Inventory.Request.DescribeBigItemsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeBigItemsByUserId(
new Gs2Inventory.DescribeBigItemsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_big_items_by_user_id(
inventory.DescribeBigItemsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_big_items_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_big_items_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;getBigItem
Get a Big Item
Retrieves a specific big item and its string-based arbitrary-precision count for the requesting user. The response includes both the big item data and its associated big item model definition. If the item has never been acquired, no data will be returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model Name The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to. |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item |
| itemModel | BigItemModel | Big Item Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetBigItem(
&inventory.GetBigItemRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemModel := result.ItemModeluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getBigItem(
(new GetBigItemRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
);
$item = $result->getItem();
$itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemRequest;
import io.gs2.inventory.result.GetBigItemResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetBigItemResult result = client.getBigItem(
new GetBigItemRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
);
BigItem item = result.getItem();
BigItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemResult> asyncResult = null;
yield return client.GetBigItem(
new Gs2.Gs2Inventory.Request.GetBigItemRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getBigItem(
new Gs2Inventory.GetBigItemRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
);
const item = result.getItem();
const itemModel = result.getItemModel();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_big_item(
inventory.GetBigItemRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
)
item = result.item
item_model = result.item_model
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_big_item({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
itemName="item-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
itemModel = result.itemModel;client = gs2('inventory')
api_result_handler = client.get_big_item_async({
namespaceName="namespace-0001",
inventoryName="item",
accessToken="accessToken-0001",
itemName="item-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;
itemModel = result.itemModel;getBigItemByUserId
Get a Big Item by specifying the user ID
Retrieves a specific big item and its string-based arbitrary-precision count for the specified user. The response includes both the big item data and its associated big item model definition. If the item has never been acquired, no data will be returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model Name The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item |
| itemModel | BigItemModel | Big Item Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetBigItemByUserId(
&inventory.GetBigItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
itemModel := result.ItemModeluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getBigItemByUserId(
(new GetBigItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$itemModel = $result->getItemModel();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemByUserIdRequest;
import io.gs2.inventory.result.GetBigItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetBigItemByUserIdResult result = client.getBigItemByUserId(
new GetBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withTimeOffsetToken(null)
);
BigItem item = result.getItem();
BigItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemByUserIdResult> asyncResult = null;
yield return client.GetBigItemByUserId(
new Gs2.Gs2Inventory.Request.GetBigItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var itemModel = result.ItemModel;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getBigItemByUserId(
new Gs2Inventory.GetBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const itemModel = result.getItemModel();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_big_item_by_user_id(
inventory.GetBigItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_time_offset_token(None)
)
item = result.item
item_model = result.item_model
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_big_item_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-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;
itemModel = result.itemModel;client = gs2('inventory')
api_result_handler = client.get_big_item_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-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;
itemModel = result.itemModel;acquireBigItemByUserId
Acquire Big Item by specifying a user ID
Adds the specified quantity to the user’s big item count using arbitrary-precision arithmetic. The acquireCount must be a valid integer string up to 1024 digits; an invalid format will result in an error. If the item does not yet exist, it will be automatically created. A GS2-Script can be configured to execute custom logic when big items are acquired via the namespace settings.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| acquireCount | string | ✓ | ~ 1024 chars | Acquisition quantity for a Big Item Integer value strings up to 1024 digits | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item after addition |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.AcquireBigItemByUserId(
&inventory.AcquireBigItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
AcquireCount: pointy.String("1234567890123456789012345678901234567890"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireBigItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->acquireBigItemByUserId(
(new AcquireBigItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withUserId("user-0001")
->withItemName("item-0001")
->withAcquireCount("1234567890123456789012345678901234567890")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.AcquireBigItemByUserIdRequest;
import io.gs2.inventory.result.AcquireBigItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
AcquireBigItemByUserIdResult result = client.acquireBigItemByUserId(
new AcquireBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withItemName("item-0001")
.withAcquireCount("1234567890123456789012345678901234567890")
.withTimeOffsetToken(null)
);
BigItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.AcquireBigItemByUserIdResult> asyncResult = null;
yield return client.AcquireBigItemByUserId(
new Gs2.Gs2Inventory.Request.AcquireBigItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithAcquireCount("1234567890123456789012345678901234567890")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.acquireBigItemByUserId(
new Gs2Inventory.AcquireBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withItemName("item-0001")
.withAcquireCount("1234567890123456789012345678901234567890")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.acquire_big_item_by_user_id(
inventory.AcquireBigItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_acquire_count('1234567890123456789012345678901234567890')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.acquire_big_item_by_user_id({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
itemName="item-0001",
acquireCount="1234567890123456789012345678901234567890",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.acquire_big_item_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
itemName="item-0001",
acquireCount="1234567890123456789012345678901234567890",
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;consumeBigItem
Consume Big Items
Subtracts the specified quantity from the requesting user’s big item count using arbitrary-precision arithmetic. The consumeCount must be a valid integer string up to 1024 digits. If the current count is insufficient, an Insufficient error is returned and no deduction is made. A GS2-Script can be configured to execute custom logic when big items are consumed via the namespace settings.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| consumeCount | string | ✓ | ~ 1024 chars | Consumption quantity of a Big Item Integer value strings up to 1024 digits |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item per post-consumption |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ConsumeBigItem(
&inventory.ConsumeBigItemRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
AccessToken: pointy.String("accessToken-0001"),
ItemName: pointy.String("item-0001"),
ConsumeCount: pointy.String("1234567890123456789012345678901234567890"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeBigItemRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->consumeBigItem(
(new ConsumeBigItemRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withAccessToken("accessToken-0001")
->withItemName("item-0001")
->withConsumeCount("1234567890123456789012345678901234567890")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeBigItemRequest;
import io.gs2.inventory.result.ConsumeBigItemResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ConsumeBigItemResult result = client.consumeBigItem(
new ConsumeBigItemRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withConsumeCount("1234567890123456789012345678901234567890")
);
BigItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ConsumeBigItemResult> asyncResult = null;
yield return client.ConsumeBigItem(
new Gs2.Gs2Inventory.Request.ConsumeBigItemRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithAccessToken("accessToken-0001")
.WithItemName("item-0001")
.WithConsumeCount("1234567890123456789012345678901234567890"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.consumeBigItem(
new Gs2Inventory.ConsumeBigItemRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withAccessToken("accessToken-0001")
.withItemName("item-0001")
.withConsumeCount("1234567890123456789012345678901234567890")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.consume_big_item(
inventory.ConsumeBigItemRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_access_token('accessToken-0001')
.with_item_name('item-0001')
.with_consume_count('1234567890123456789012345678901234567890')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.consume_big_item({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
consumeCount="1234567890123456789012345678901234567890",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.consume_big_item_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
accessToken="accessToken-0001",
itemName="item-0001",
consumeCount="1234567890123456789012345678901234567890",
})
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;consumeBigItemByUserId
Consume Big Items by specifying a user ID
Subtracts the specified quantity from the specified user’s big item count using arbitrary-precision arithmetic. The consumeCount must be a valid integer string up to 1024 digits. If the current count is insufficient, an Insufficient error is returned and no deduction is made. A GS2-Script can be configured to execute custom logic when big items are consumed via the namespace settings.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| consumeCount | string | ✓ | ~ 1024 chars | Consumption quantity of a Big Item Integer value strings up to 1024 digits | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item per post-consumption |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ConsumeBigItemByUserId(
&inventory.ConsumeBigItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
ConsumeCount: pointy.String("1234567890123456789012345678901234567890"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeBigItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->consumeBigItemByUserId(
(new ConsumeBigItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withConsumeCount("1234567890123456789012345678901234567890")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeBigItemByUserIdRequest;
import io.gs2.inventory.result.ConsumeBigItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ConsumeBigItemByUserIdResult result = client.consumeBigItemByUserId(
new ConsumeBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withConsumeCount("1234567890123456789012345678901234567890")
.withTimeOffsetToken(null)
);
BigItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ConsumeBigItemByUserIdResult> asyncResult = null;
yield return client.ConsumeBigItemByUserId(
new Gs2.Gs2Inventory.Request.ConsumeBigItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithConsumeCount("1234567890123456789012345678901234567890")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.consumeBigItemByUserId(
new Gs2Inventory.ConsumeBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withConsumeCount("1234567890123456789012345678901234567890")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.consume_big_item_by_user_id(
inventory.ConsumeBigItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_consume_count('1234567890123456789012345678901234567890')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.consume_big_item_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
consumeCount="1234567890123456789012345678901234567890",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.consume_big_item_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
consumeCount="1234567890123456789012345678901234567890",
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;setBigItemByUserId
Set the Big Item by specifying a user ID
Sets the big item count to the specified absolute value, replacing the current count entirely. The count must be a valid integer string up to 1024 digits. If the item does not yet exist, it will be automatically created. Unlike acquire/consume which perform relative operations, this sets the exact value directly.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| count | string | ✓ | ~ 1024 chars | Quantity of Big Item Integer value strings up to 1024 digits | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item after update |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.SetBigItemByUserId(
&inventory.SetBigItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("inventory-0001"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
Count: pointy.String("1234567890123456789012345678901234567890"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\SetBigItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->setBigItemByUserId(
(new SetBigItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("inventory-0001")
->withUserId("user-0001")
->withItemName("item-0001")
->withCount("1234567890123456789012345678901234567890")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.SetBigItemByUserIdRequest;
import io.gs2.inventory.result.SetBigItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
SetBigItemByUserIdResult result = client.setBigItemByUserId(
new SetBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withCount("1234567890123456789012345678901234567890")
.withTimeOffsetToken(null)
);
BigItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.SetBigItemByUserIdResult> asyncResult = null;
yield return client.SetBigItemByUserId(
new Gs2.Gs2Inventory.Request.SetBigItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("inventory-0001")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithCount("1234567890123456789012345678901234567890")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.setBigItemByUserId(
new Gs2Inventory.SetBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("inventory-0001")
.withUserId("user-0001")
.withItemName("item-0001")
.withCount("1234567890123456789012345678901234567890")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.set_big_item_by_user_id(
inventory.SetBigItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('inventory-0001')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_count('1234567890123456789012345678901234567890')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.set_big_item_by_user_id({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
count="1234567890123456789012345678901234567890",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.set_big_item_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="inventory-0001",
userId="user-0001",
itemName="item-0001",
count="1234567890123456789012345678901234567890",
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;deleteBigItemByUserId
Delete Big Item
Permanently deletes the specified big item data for the user. The item record is completely removed regardless of its current count. This operation cannot be undone.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item per post-consumption |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteBigItemByUserId(
&inventory.DeleteBigItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
UserId: pointy.String("user-0001"),
ItemName: pointy.String("item-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteBigItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteBigItemByUserId(
(new DeleteBigItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withUserId("user-0001")
->withItemName("item-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteBigItemByUserIdRequest;
import io.gs2.inventory.result.DeleteBigItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteBigItemByUserIdResult result = client.deleteBigItemByUserId(
new DeleteBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withItemName("item-0001")
.withTimeOffsetToken(null)
);
BigItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigItemByUserIdResult> asyncResult = null;
yield return client.DeleteBigItemByUserId(
new Gs2.Gs2Inventory.Request.DeleteBigItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithUserId("user-0001")
.WithItemName("item-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteBigItemByUserId(
new Gs2Inventory.DeleteBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withUserId("user-0001")
.withItemName("item-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_big_item_by_user_id(
inventory.DeleteBigItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_user_id('user-0001')
.with_item_name('item-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_big_item_by_user_id({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
itemName="item-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_big_item_by_user_id_async({
namespaceName="namespace-0001",
inventoryName="item",
userId="user-0001",
itemName="item-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;verifyBigItem
Verify possession quantity of big items
Verifies that the requesting user’s big item count satisfies the specified condition. Supports six comparison operators: less, lessEqual, greater, greaterEqual, equal, and notEqual. The comparison is performed using arbitrary-precision arithmetic on string-based counts. If the condition is not met, an error is returned; if met, the request succeeds.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| itemName | string | ✓ | ~ 128 chars | Big Item Model Name The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| count | string | ✓ | ~ 1024 chars | Quantity in possession Integer value strings up to 1024 digits | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item after update |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyBigItem(
&inventory.VerifyBigItemRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
InventoryName: pointy.String("inventory-0001"),
ItemName: pointy.String("item-0001"),
VerifyType: pointy.String("less"),
Count: 10,
MultiplyValueSpecifyingQuantity: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyBigItemRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyBigItem(
(new VerifyBigItemRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withInventoryName("inventory-0001")
->withItemName("item-0001")
->withVerifyType("less")
->withCount(10)
->withMultiplyValueSpecifyingQuantity(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyBigItemRequest;
import io.gs2.inventory.result.VerifyBigItemResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyBigItemResult result = client.verifyBigItem(
new VerifyBigItemRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
);
BigItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyBigItemResult> asyncResult = null;
yield return client.VerifyBigItem(
new Gs2.Gs2Inventory.Request.VerifyBigItemRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithInventoryName("inventory-0001")
.WithItemName("item-0001")
.WithVerifyType("less")
.WithCount(10)
.WithMultiplyValueSpecifyingQuantity(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyBigItem(
new Gs2Inventory.VerifyBigItemRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_big_item(
inventory.VerifyBigItemRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_inventory_name('inventory-0001')
.with_item_name('item-0001')
.with_verify_type('less')
.with_count(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_big_item({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.verify_big_item_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;verifyBigItemByUserId
Verify possession quantity of Big Items by specifying a user ID
Verifies that the specified user’s big item count satisfies the specified condition. Supports six comparison operators: less, lessEqual, greater, greaterEqual, equal, and notEqual. The comparison is performed using arbitrary-precision arithmetic on string-based counts. If the condition is not met, an error is returned; if met, the request succeeds.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| userId | string | ✓ | ~ 128 chars | User ID | ||||||||||||||||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| itemName | string | ✓ | ~ 128 chars | Big Item Model Name The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to. | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| count | string | ✓ | ~ 1024 chars | Quantity in possession Integer value strings up to 1024 digits | ||||||||||||||||
| multiplyValueSpecifyingQuantity | bool | true | Whether to multiply the value used for verification when specifying the quantity | |||||||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | BigItem | Big Item after update |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.VerifyBigItemByUserId(
&inventory.VerifyBigItemByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
InventoryName: pointy.String("inventory-0001"),
ItemName: pointy.String("item-0001"),
VerifyType: pointy.String("less"),
Count: 10,
MultiplyValueSpecifyingQuantity: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyBigItemByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->verifyBigItemByUserId(
(new VerifyBigItemByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withInventoryName("inventory-0001")
->withItemName("item-0001")
->withVerifyType("less")
->withCount(10)
->withMultiplyValueSpecifyingQuantity(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyBigItemByUserIdRequest;
import io.gs2.inventory.result.VerifyBigItemByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
VerifyBigItemByUserIdResult result = client.verifyBigItemByUserId(
new VerifyBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
BigItem item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.VerifyBigItemByUserIdResult> asyncResult = null;
yield return client.VerifyBigItemByUserId(
new Gs2.Gs2Inventory.Request.VerifyBigItemByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithInventoryName("inventory-0001")
.WithItemName("item-0001")
.WithVerifyType("less")
.WithCount(10)
.WithMultiplyValueSpecifyingQuantity(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.verifyBigItemByUserId(
new Gs2Inventory.VerifyBigItemByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withInventoryName("inventory-0001")
.withItemName("item-0001")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.verify_big_item_by_user_id(
inventory.VerifyBigItemByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_inventory_name('inventory-0001')
.with_item_name('item-0001')
.with_verify_type('less')
.with_count(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.verify_big_item_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.verify_big_item_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
inventoryName="inventory-0001",
itemName="item-0001",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeInventoryModels
Get a list of Inventory Models
Retrieves the list of currently active inventory models in the namespace. These are the models activated through the current master data update process, defining the capacity settings (initialCapacity, maxCapacity) and item protection rules (protectReferencedItem) for each inventory type. Each inventory model contains its associated item models, which define stacking limits and sort order for items within that inventory.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<InventoryModel> | List of Inventory Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeInventoryModels(
&inventory.DescribeInventoryModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoryModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeInventoryModels(
(new DescribeInventoryModelsRequest())
->withNamespaceName("namespace-0001")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoryModelsRequest;
import io.gs2.inventory.result.DescribeInventoryModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeInventoryModelsResult result = client.describeInventoryModels(
new DescribeInventoryModelsRequest()
.withNamespaceName("namespace-0001")
);
List<InventoryModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelsResult> asyncResult = null;
yield return client.DescribeInventoryModels(
new Gs2.Gs2Inventory.Request.DescribeInventoryModelsRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeInventoryModels(
new Gs2Inventory.DescribeInventoryModelsRequest()
.withNamespaceName("namespace-0001")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_inventory_models(
inventory.DescribeInventoryModelsRequest()
.with_namespace_name('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_inventory_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.describe_inventory_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;getInventoryModel
Get Inventory Model
Retrieves a specific active inventory model including its full configuration: initial and maximum capacity, item protection settings, and all associated item models. The item models define how items are stored within this inventory, including stacking limits, multi-stack allowance, and sort values.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | InventoryModel | Inventory Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetInventoryModel(
&inventory.GetInventoryModelRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getInventoryModel(
(new GetInventoryModelRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryModelRequest;
import io.gs2.inventory.result.GetInventoryModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetInventoryModelResult result = client.getInventoryModel(
new GetInventoryModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
InventoryModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelResult> asyncResult = null;
yield return client.GetInventoryModel(
new Gs2.Gs2Inventory.Request.GetInventoryModelRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getInventoryModel(
new Gs2Inventory.GetInventoryModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_inventory_model(
inventory.GetInventoryModelRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_inventory_model({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_inventory_model_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;describeItemModels
Get a list of Item Models
Retrieves the list of currently active item models belonging to the specified inventory model. Each item model defines the stacking limit (maximum count per stack), whether multiple stacks are allowed, and the sort value for display ordering. These are the models activated through the current master data update process.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemModel> | List of Item Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeItemModels(
&inventory.DescribeItemModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeItemModels(
(new DescribeItemModelsRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemModelsRequest;
import io.gs2.inventory.result.DescribeItemModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeItemModelsResult result = client.describeItemModels(
new DescribeItemModelsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
List<ItemModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemModelsResult> asyncResult = null;
yield return client.DescribeItemModels(
new Gs2.Gs2Inventory.Request.DescribeItemModelsRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeItemModels(
new Gs2Inventory.DescribeItemModelsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_item_models(
inventory.DescribeItemModelsRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_item_models({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.describe_item_models_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;getItemModel
Get Item Model
Retrieves a specific active item model, including its stacking limit, multi-stack allowance, sort value, and any other configuration.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | ItemModel |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetItemModel(
&inventory.GetItemModelRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getItemModel(
(new GetItemModelRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemModelRequest;
import io.gs2.inventory.result.GetItemModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetItemModelResult result = client.getItemModel(
new GetItemModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
ItemModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetItemModelResult> asyncResult = null;
yield return client.GetItemModel(
new Gs2.Gs2Inventory.Request.GetItemModelRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getItemModel(
new Gs2Inventory.GetItemModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_item_model(
inventory.GetItemModelRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_item_model({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_item_model_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;describeSimpleInventoryModels
Get a list of Simple Inventory Models
Retrieves the list of currently active simple inventory models in the namespace. Simple inventory models provide a streamlined item management system without capacity limits, expiration, or references — items are tracked as simple name-count pairs. Each model contains its associated simple item models.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleInventoryModel> | List of Simple Inventory Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeSimpleInventoryModels(
&inventory.DescribeSimpleInventoryModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleInventoryModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeSimpleInventoryModels(
(new DescribeSimpleInventoryModelsRequest())
->withNamespaceName("namespace-0001")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleInventoryModelsRequest;
import io.gs2.inventory.result.DescribeSimpleInventoryModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeSimpleInventoryModelsResult result = client.describeSimpleInventoryModels(
new DescribeSimpleInventoryModelsRequest()
.withNamespaceName("namespace-0001")
);
List<SimpleInventoryModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelsResult> asyncResult = null;
yield return client.DescribeSimpleInventoryModels(
new Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelsRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeSimpleInventoryModels(
new Gs2Inventory.DescribeSimpleInventoryModelsRequest()
.withNamespaceName("namespace-0001")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_simple_inventory_models(
inventory.DescribeSimpleInventoryModelsRequest()
.with_namespace_name('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_simple_inventory_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.describe_simple_inventory_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;getSimpleInventoryModel
Get Simple Inventory Model
Retrieves a specific active simple inventory model including its associated simple item models.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SimpleInventoryModel | Simple Inventory Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleInventoryModel(
&inventory.GetSimpleInventoryModelRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleInventoryModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleInventoryModel(
(new GetSimpleInventoryModelRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleInventoryModelRequest;
import io.gs2.inventory.result.GetSimpleInventoryModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleInventoryModelResult result = client.getSimpleInventoryModel(
new GetSimpleInventoryModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
SimpleInventoryModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleInventoryModelResult> asyncResult = null;
yield return client.GetSimpleInventoryModel(
new Gs2.Gs2Inventory.Request.GetSimpleInventoryModelRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleInventoryModel(
new Gs2Inventory.GetSimpleInventoryModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_inventory_model(
inventory.GetSimpleInventoryModelRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_inventory_model({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_simple_inventory_model_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;describeSimpleItemModels
Get a list of Simple Item Models
Retrieves the list of currently active simple item models belonging to the specified simple inventory model. Simple item models define item types that are tracked as simple name-count pairs without stacking limits, expiration, or references.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<SimpleItemModel> | List of Simple Item Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeSimpleItemModels(
&inventory.DescribeSimpleItemModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeSimpleItemModels(
(new DescribeSimpleItemModelsRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemModelsRequest;
import io.gs2.inventory.result.DescribeSimpleItemModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeSimpleItemModelsResult result = client.describeSimpleItemModels(
new DescribeSimpleItemModelsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
List<SimpleItemModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemModelsResult> asyncResult = null;
yield return client.DescribeSimpleItemModels(
new Gs2.Gs2Inventory.Request.DescribeSimpleItemModelsRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeSimpleItemModels(
new Gs2Inventory.DescribeSimpleItemModelsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_simple_item_models(
inventory.DescribeSimpleItemModelsRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_simple_item_models({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.describe_simple_item_models_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;getSimpleItemModel
Get Simple Item Model
Retrieves a specific active simple item model and its configuration.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItemModel |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleItemModel(
&inventory.GetSimpleItemModelRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleItemModel(
(new GetSimpleItemModelRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemModelRequest;
import io.gs2.inventory.result.GetSimpleItemModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleItemModelResult result = client.getSimpleItemModel(
new GetSimpleItemModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
SimpleItemModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemModelResult> asyncResult = null;
yield return client.GetSimpleItemModel(
new Gs2.Gs2Inventory.Request.GetSimpleItemModelRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleItemModel(
new Gs2Inventory.GetSimpleItemModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_item_model(
inventory.GetSimpleItemModelRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_item_model({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_simple_item_model_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;describeBigInventoryModels
Get a list of Big Inventory Models
Retrieves the list of currently active big inventory models in the namespace. Big inventory models support arbitrary-precision item counts using string-based numbers, suitable for games that need extremely large quantities beyond standard integer limits. Each model contains its associated big item models.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<BigInventoryModel> | List of Big Inventory Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeBigInventoryModels(
&inventory.DescribeBigInventoryModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigInventoryModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeBigInventoryModels(
(new DescribeBigInventoryModelsRequest())
->withNamespaceName("namespace-0001")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigInventoryModelsRequest;
import io.gs2.inventory.result.DescribeBigInventoryModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeBigInventoryModelsResult result = client.describeBigInventoryModels(
new DescribeBigInventoryModelsRequest()
.withNamespaceName("namespace-0001")
);
List<BigInventoryModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigInventoryModelsResult> asyncResult = null;
yield return client.DescribeBigInventoryModels(
new Gs2.Gs2Inventory.Request.DescribeBigInventoryModelsRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeBigInventoryModels(
new Gs2Inventory.DescribeBigInventoryModelsRequest()
.withNamespaceName("namespace-0001")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_big_inventory_models(
inventory.DescribeBigInventoryModelsRequest()
.with_namespace_name('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_big_inventory_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.describe_big_inventory_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;getBigInventoryModel
Get Big Inventory Model
Retrieves a specific active big inventory model including its associated big item models.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | BigInventoryModel | Big Inventory Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetBigInventoryModel(
&inventory.GetBigInventoryModelRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigInventoryModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getBigInventoryModel(
(new GetBigInventoryModelRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigInventoryModelRequest;
import io.gs2.inventory.result.GetBigInventoryModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetBigInventoryModelResult result = client.getBigInventoryModel(
new GetBigInventoryModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
BigInventoryModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetBigInventoryModelResult> asyncResult = null;
yield return client.GetBigInventoryModel(
new Gs2.Gs2Inventory.Request.GetBigInventoryModelRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getBigInventoryModel(
new Gs2Inventory.GetBigInventoryModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_big_inventory_model(
inventory.GetBigInventoryModelRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_big_inventory_model({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_big_inventory_model_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;describeBigItemModels
Get a list of Big Item Models
Retrieves the list of currently active big item models belonging to the specified big inventory model. Big item models define item types that use string-based arbitrary-precision counts.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<BigItemModel> | List of Big Item Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeBigItemModels(
&inventory.DescribeBigItemModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeBigItemModels(
(new DescribeBigItemModelsRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemModelsRequest;
import io.gs2.inventory.result.DescribeBigItemModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeBigItemModelsResult result = client.describeBigItemModels(
new DescribeBigItemModelsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
List<BigItemModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemModelsResult> asyncResult = null;
yield return client.DescribeBigItemModels(
new Gs2.Gs2Inventory.Request.DescribeBigItemModelsRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeBigItemModels(
new Gs2Inventory.DescribeBigItemModelsRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_big_item_models(
inventory.DescribeBigItemModelsRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_big_item_models({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('inventory')
api_result_handler = client.describe_big_item_models_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;getBigItemModel
Get Big Item Model
Retrieves a specific active big item model and its configuration.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | BigItemModel |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetBigItemModel(
&inventory.GetBigItemModelRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getBigItemModel(
(new GetBigItemModelRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemModelRequest;
import io.gs2.inventory.result.GetBigItemModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetBigItemModelResult result = client.getBigItemModel(
new GetBigItemModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
BigItemModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemModelResult> asyncResult = null;
yield return client.GetBigItemModel(
new Gs2.Gs2Inventory.Request.GetBigItemModelRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getBigItemModel(
new Gs2Inventory.GetBigItemModelRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_big_item_model(
inventory.GetBigItemModelRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_big_item_model({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_big_item_model_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;exportMaster
Export Item Model Master in a master data format that can be activated
Exports the current set of inventory model masters, item model masters, simple inventory/item model masters, and big inventory/item model masters from the namespace as a JSON document. The exported data can be used as input for the update master data API to activate changes.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | CurrentItemModelMaster | Item Model Master that can be activated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.ExportMaster(
&inventory.ExportMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ExportMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ExportMasterRequest;
import io.gs2.inventory.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace-0001")
);
CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Inventory.Request.ExportMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.exportMaster(
new Gs2Inventory.ExportMasterRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.export_master(
inventory.ExportMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.export_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
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;getCurrentItemModelMaster
Get currently active Item Model master data
Retrieves the master data that was last activated in the namespace. This includes all inventory models (standard, simple, and big) and their associated item models that are currently in use by the service.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | CurrentItemModelMaster | Currently active Item Model master data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetCurrentItemModelMaster(
&inventory.GetCurrentItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetCurrentItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getCurrentItemModelMaster(
(new GetCurrentItemModelMasterRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetCurrentItemModelMasterRequest;
import io.gs2.inventory.result.GetCurrentItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetCurrentItemModelMasterResult result = client.getCurrentItemModelMaster(
new GetCurrentItemModelMasterRequest()
.withNamespaceName("namespace-0001")
);
CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetCurrentItemModelMasterResult> asyncResult = null;
yield return client.GetCurrentItemModelMaster(
new Gs2.Gs2Inventory.Request.GetCurrentItemModelMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getCurrentItemModelMaster(
new Gs2Inventory.GetCurrentItemModelMasterRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_current_item_model_master(
inventory.GetCurrentItemModelMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_current_item_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_current_item_model_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;preUpdateCurrentItemModelMaster
Update currently active Item Model master data (3-phase version)
When uploading master data larger than 1MB, the update is performed in 3 phases.
- Execute this API to obtain a token and URL for uploading.
- Upload the master data to the obtained URL.
- Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| uploadToken | string | Token used to reflect results after upload |
| uploadUrl | string | URL used to upload |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.PreUpdateCurrentItemModelMaster(
&inventory.PreUpdateCurrentItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\PreUpdateCurrentItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->preUpdateCurrentItemModelMaster(
(new PreUpdateCurrentItemModelMasterRequest())
->withNamespaceName("namespace-0001")
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.PreUpdateCurrentItemModelMasterRequest;
import io.gs2.inventory.result.PreUpdateCurrentItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
PreUpdateCurrentItemModelMasterResult result = client.preUpdateCurrentItemModelMaster(
new PreUpdateCurrentItemModelMasterRequest()
.withNamespaceName("namespace-0001")
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.PreUpdateCurrentItemModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentItemModelMaster(
new Gs2.Gs2Inventory.Request.PreUpdateCurrentItemModelMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.preUpdateCurrentItemModelMaster(
new Gs2Inventory.PreUpdateCurrentItemModelMasterRequest()
.withNamespaceName("namespace-0001")
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.pre_update_current_item_model_master(
inventory.PreUpdateCurrentItemModelMasterRequest()
.with_namespace_name('namespace-0001')
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.pre_update_current_item_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('inventory')
api_result_handler = client.pre_update_current_item_model_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;updateCurrentItemModelMaster
Update currently active Item Model master data
Activates new master data to replace the currently active inventory and item model definitions. Supports two modes: ‘direct’ for inline data (suitable for data under 1MB), and ‘preUpload’ for data that was uploaded via the pre-update API. After activation, all inventory operations will use the new model definitions.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| mode | String Enum enum { “direct”, “preUpload” } | “direct” | Update mode
| |||||||||
| settings | string | {mode} == “direct” | ✓* | ~ 5242880 chars | Master Data * Required if mode is “direct” | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓* | ~ 1024 chars | Token obtained by pre-upload Used to apply the uploaded master data. * Required if mode is “preUpload” |
Result
| Type | Description | |
|---|---|---|
| item | CurrentItemModelMaster | Updated master data of the currently active Item Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateCurrentItemModelMaster(
&inventory.UpdateCurrentItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Mode: pointy.String("direct"),
Settings: pointy.String("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}"),
UploadToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateCurrentItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateCurrentItemModelMaster(
(new UpdateCurrentItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withMode("direct")
->withSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
->withUploadToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateCurrentItemModelMasterRequest;
import io.gs2.inventory.result.UpdateCurrentItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateCurrentItemModelMasterResult result = client.updateCurrentItemModelMaster(
new UpdateCurrentItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withMode("direct")
.withSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
.withUploadToken(null)
);
CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentItemModelMaster(
new Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMode("direct")
.WithSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
.WithUploadToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateCurrentItemModelMaster(
new Gs2Inventory.UpdateCurrentItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withMode("direct")
.withSettings("{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}")
.withUploadToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_current_item_model_master(
inventory.UpdateCurrentItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_mode('direct')
.with_settings('{"version": "2019-02-05", "inventoryModels": [{"name": "item", "metadata": "INVENTORY_ITEM", "initialCapacity": 100, "maxCapacity": 999, "itemModels": [{"name": "item-0001", "metadata": "ITEM_0001", "stackingLimit": 99, "allowMultipleStacks": false, "sortValue": 1}, {"name": "item-0002", "metadata": "ITEM_0002", "stackingLimit": 49, "allowMultipleStacks": true, "sortValue": 2}, {"name": "item-0003", "metadata": "ITEM_0003", "stackingLimit": 9, "allowMultipleStacks": false, "sortValue": 3}]}, {"name": "character", "metadata": "INVENTORY_CHARACTER", "initialCapacity": 50, "maxCapacity": 99, "itemModels": [{"name": "character-0001", "metadata": "CHARACTER_0001", "stackingLimit": 99, "allowMultipleStacks": false, "sortValue": 1}, {"name": "character-0002", "metadata": "CHARACTER_0002", "stackingLimit": 49, "allowMultipleStacks": true, "sortValue": 2}, {"name": "character-0003", "metadata": "CHARACTER_0003", "stackingLimit": 9, "allowMultipleStacks": false, "sortValue": 3}]}], "simpleInventoryModels": [{"name": "item", "metadata": "INVENTORY_ITEM", "simpleItemModels": [{"name": "item-0001", "metadata": "ITEM_0001"}, {"name": "item-0002", "metadata": "ITEM_0002"}, {"name": "item-0003", "metadata": "ITEM_0003"}]}], "bigInventoryModels": [{"name": "item", "metadata": "INVENTORY_ITEM", "bigItemModels": [{"name": "item-0001", "metadata": "ITEM_0001"}, {"name": "item-0002", "metadata": "ITEM_0002"}, {"name": "item-0003", "metadata": "ITEM_0003"}]}]}')
.with_upload_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_current_item_model_master({
namespaceName="namespace-0001",
mode="direct",
settings="{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}",
uploadToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_current_item_model_master_async({
namespaceName="namespace-0001",
mode="direct",
settings="{\"version\": \"2019-02-05\", \"inventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"initialCapacity\": 100, \"maxCapacity\": 999, \"itemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}, {\"name\": \"character\", \"metadata\": \"INVENTORY_CHARACTER\", \"initialCapacity\": 50, \"maxCapacity\": 99, \"itemModels\": [{\"name\": \"character-0001\", \"metadata\": \"CHARACTER_0001\", \"stackingLimit\": 99, \"allowMultipleStacks\": false, \"sortValue\": 1}, {\"name\": \"character-0002\", \"metadata\": \"CHARACTER_0002\", \"stackingLimit\": 49, \"allowMultipleStacks\": true, \"sortValue\": 2}, {\"name\": \"character-0003\", \"metadata\": \"CHARACTER_0003\", \"stackingLimit\": 9, \"allowMultipleStacks\": false, \"sortValue\": 3}]}], \"simpleInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"simpleItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}], \"bigInventoryModels\": [{\"name\": \"item\", \"metadata\": \"INVENTORY_ITEM\", \"bigItemModels\": [{\"name\": \"item-0001\", \"metadata\": \"ITEM_0001\"}, {\"name\": \"item-0002\", \"metadata\": \"ITEM_0002\"}, {\"name\": \"item-0003\", \"metadata\": \"ITEM_0003\"}]}]}",
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;updateCurrentItemModelMasterFromGitHub
Update currently active Item Model master data from GitHub
Fetches master data from a specified GitHub repository and activates it. The checkout setting specifies the repository, branch/tag, and file path to retrieve. Template variables in the master data are replaced with their configured values during activation. This enables version-controlled master data management through Git workflows.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
| Type | Description | |
|---|---|---|
| item | CurrentItemModelMaster | Updated master data of the currently active Item Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateCurrentItemModelMasterFromGitHub(
&inventory.UpdateCurrentItemModelMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace-0001"),
CheckoutSetting: &inventory.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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateCurrentItemModelMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateCurrentItemModelMasterFromGitHub(
(new UpdateCurrentItemModelMasterFromGitHubRequest())
->withNamespaceName("namespace-0001")
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId("apiKeyId-0001")
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateCurrentItemModelMasterFromGitHubRequest;
import io.gs2.inventory.result.UpdateCurrentItemModelMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateCurrentItemModelMasterFromGitHubResult result = client.updateCurrentItemModelMasterFromGitHub(
new UpdateCurrentItemModelMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentItemModelMasterFromGitHub(
new Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterFromGitHubRequest()
.WithNamespaceName("namespace-0001")
.WithCheckoutSetting(new Gs2.Gs2Inventory.Model.GitHubCheckoutSetting()
.WithApiKeyId("apiKeyId-0001")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateCurrentItemModelMasterFromGitHub(
new Gs2Inventory.UpdateCurrentItemModelMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(new Gs2Inventory.model.GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_current_item_model_master_from_git_hub(
inventory.UpdateCurrentItemModelMasterFromGitHubRequest()
.with_namespace_name('namespace-0001')
.with_checkout_setting(inventory.GitHubCheckoutSetting()
.with_api_key_id('apiKeyId-0001')
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_current_item_model_master_from_git_hub({
namespaceName="namespace-0001",
checkoutSetting={
api_key_id="apiKeyId-0001",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_current_item_model_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;describeInventoryModelMasters
Get a list of Inventory Model Masters
Retrieves a paginated list of editable inventory model masters in the namespace. These are the draft definitions that can be modified before activation. Each master defines the capacity settings (initialCapacity, maxCapacity) and item protection rules for an inventory type. Supports optional name prefix filtering for targeted searches.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| namePrefix | string | ~ 64 chars | Filter by Inventory 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<InventoryModelMaster> | List of Inventory Model Masters |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeInventoryModelMasters(
&inventory.DescribeInventoryModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoryModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeInventoryModelMasters(
(new DescribeInventoryModelMastersRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoryModelMastersRequest;
import io.gs2.inventory.result.DescribeInventoryModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeInventoryModelMastersResult result = client.describeInventoryModelMasters(
new DescribeInventoryModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<InventoryModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeInventoryModelMasters(
new Gs2.Gs2Inventory.Request.DescribeInventoryModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeInventoryModelMasters(
new Gs2Inventory.DescribeInventoryModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_inventory_model_masters(
inventory.DescribeInventoryModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_inventory_model_masters({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_inventory_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;createInventoryModelMaster
Create a new Inventory Model Master
Creates an editable inventory model master that defines a new inventory type. Key settings include initialCapacity (the starting number of item slots for new users), maxCapacity (the upper limit for capacity expansion), and protectReferencedItem (when enabled, prevents consumption of items that have active references). The created master must be activated through the current master data update process to become available to users.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| name | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| initialCapacity | int | ✓ | 0 ~ 2147483646 | Initial Capacity The number of inventory slots available to a user when the inventory is first created. Each slot can hold one item stack. Users can expand their capacity up to maxCapacity through gameplay actions. | ||
| maxCapacity | int | ✓ | 0 ~ 2147483646 | Maximum Capacity The upper limit of inventory slots that a user can expand to. Capacity cannot be increased beyond this value. When all slots are occupied and items cannot be stacked further, acquisition attempts will fail unless the overflow script handles the excess. | ||
| protectReferencedItem | bool | false | Protect Referenced Items When enabled, item sets that have references registered (via the referenceOf mechanism) cannot be consumed or deleted. This prevents items that are in use by other systems (e.g., equipped gear, items bound to formations) from being accidentally removed. |
Result
| Type | Description | |
|---|---|---|
| item | InventoryModelMaster | Created Inventory Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CreateInventoryModelMaster(
&inventory.CreateInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("item"),
Description: nil,
Metadata: nil,
InitialCapacity: pointy.Int32(50),
MaxCapacity: pointy.Int32(100),
ProtectReferencedItem: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->createInventoryModelMaster(
(new CreateInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withName("item")
->withDescription(null)
->withMetadata(null)
->withInitialCapacity(50)
->withMaxCapacity(100)
->withProtectReferencedItem(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateInventoryModelMasterRequest;
import io.gs2.inventory.result.CreateInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CreateInventoryModelMasterResult result = client.createInventoryModelMaster(
new CreateInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("item")
.withDescription(null)
.withMetadata(null)
.withInitialCapacity(50)
.withMaxCapacity(100)
.withProtectReferencedItem(null)
);
InventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CreateInventoryModelMasterResult> asyncResult = null;
yield return client.CreateInventoryModelMaster(
new Gs2.Gs2Inventory.Request.CreateInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("item")
.WithDescription(null)
.WithMetadata(null)
.WithInitialCapacity(50)
.WithMaxCapacity(100)
.WithProtectReferencedItem(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.createInventoryModelMaster(
new Gs2Inventory.CreateInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("item")
.withDescription(null)
.withMetadata(null)
.withInitialCapacity(50)
.withMaxCapacity(100)
.withProtectReferencedItem(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.create_inventory_model_master(
inventory.CreateInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('item')
.with_description(None)
.with_metadata(None)
.with_initial_capacity(50)
.with_max_capacity(100)
.with_protect_referenced_item(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.create_inventory_model_master({
namespaceName="namespace-0001",
name="item",
description=nil,
metadata=nil,
initialCapacity=50,
maxCapacity=100,
protectReferencedItem=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.create_inventory_model_master_async({
namespaceName="namespace-0001",
name="item",
description=nil,
metadata=nil,
initialCapacity=50,
maxCapacity=100,
protectReferencedItem=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;getInventoryModelMaster
Get Inventory Model Master
Retrieves the full configuration of a specific editable inventory model master, including its capacity settings, metadata, and item protection rules.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | InventoryModelMaster | Inventory Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetInventoryModelMaster(
&inventory.GetInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getInventoryModelMaster(
(new GetInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryModelMasterRequest;
import io.gs2.inventory.result.GetInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetInventoryModelMasterResult result = client.getInventoryModelMaster(
new GetInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
InventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelMasterResult> asyncResult = null;
yield return client.GetInventoryModelMaster(
new Gs2.Gs2Inventory.Request.GetInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getInventoryModelMaster(
new Gs2Inventory.GetInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_inventory_model_master(
inventory.GetInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;updateInventoryModelMaster
Update Inventory Model Master
Updates the properties of an existing inventory model master, including capacity settings (initialCapacity, maxCapacity), metadata, and protectReferencedItem. Changes do not take effect until the master data is re-activated through the current master data update process.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| initialCapacity | int | ✓ | 0 ~ 2147483646 | Initial Capacity The number of inventory slots available to a user when the inventory is first created. Each slot can hold one item stack. Users can expand their capacity up to maxCapacity through gameplay actions. | ||
| maxCapacity | int | ✓ | 0 ~ 2147483646 | Maximum Capacity The upper limit of inventory slots that a user can expand to. Capacity cannot be increased beyond this value. When all slots are occupied and items cannot be stacked further, acquisition attempts will fail unless the overflow script handles the excess. | ||
| protectReferencedItem | bool | false | Protect Referenced Items When enabled, item sets that have references registered (via the referenceOf mechanism) cannot be consumed or deleted. This prevents items that are in use by other systems (e.g., equipped gear, items bound to formations) from being accidentally removed. |
Result
| Type | Description | |
|---|---|---|
| item | InventoryModelMaster | Inventory Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateInventoryModelMaster(
&inventory.UpdateInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
Description: pointy.String("description1"),
Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
InitialCapacity: pointy.Int32(150),
MaxCapacity: pointy.Int32(250),
ProtectReferencedItem: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateInventoryModelMaster(
(new UpdateInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withDescription("description1")
->withMetadata("ITEM_INVENTORY_MASTER")
->withInitialCapacity(150)
->withMaxCapacity(250)
->withProtectReferencedItem(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateInventoryModelMasterRequest;
import io.gs2.inventory.result.UpdateInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateInventoryModelMasterResult result = client.updateInventoryModelMaster(
new UpdateInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withDescription("description1")
.withMetadata("ITEM_INVENTORY_MASTER")
.withInitialCapacity(150)
.withMaxCapacity(250)
.withProtectReferencedItem(null)
);
InventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateInventoryModelMaster(
new Gs2.Gs2Inventory.Request.UpdateInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithDescription("description1")
.WithMetadata("ITEM_INVENTORY_MASTER")
.WithInitialCapacity(150)
.WithMaxCapacity(250)
.WithProtectReferencedItem(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateInventoryModelMaster(
new Gs2Inventory.UpdateInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withDescription("description1")
.withMetadata("ITEM_INVENTORY_MASTER")
.withInitialCapacity(150)
.withMaxCapacity(250)
.withProtectReferencedItem(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_inventory_model_master(
inventory.UpdateInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_description('description1')
.with_metadata('ITEM_INVENTORY_MASTER')
.with_initial_capacity(150)
.with_max_capacity(250)
.with_protect_referenced_item(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
description="description1",
metadata="ITEM_INVENTORY_MASTER",
initialCapacity=150,
maxCapacity=250,
protectReferencedItem=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
description="description1",
metadata="ITEM_INVENTORY_MASTER",
initialCapacity=150,
maxCapacity=250,
protectReferencedItem=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;deleteInventoryModelMaster
Delete Inventory Model Master
Deletes the specified inventory model master. The deletion does not affect the currently active model until the master data is re-activated. Existing user inventories and items associated with this model are not automatically deleted.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | InventoryModelMaster | Inventory Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteInventoryModelMaster(
&inventory.DeleteInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteInventoryModelMaster(
(new DeleteInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteInventoryModelMasterRequest;
import io.gs2.inventory.result.DeleteInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteInventoryModelMasterResult result = client.deleteInventoryModelMaster(
new DeleteInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
InventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteInventoryModelMaster(
new Gs2.Gs2Inventory.Request.DeleteInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteInventoryModelMaster(
new Gs2Inventory.DeleteInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_inventory_model_master(
inventory.DeleteInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;describeItemModelMasters
Get a list of Item Model Masters
Retrieves a paginated list of editable item model masters belonging to the specified inventory model master. These are the draft definitions that can be modified before activation, defining stacking limits, multi-stack allowance, and sort values for items within the inventory.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<ItemModelMaster> | List of Item Model Master |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeItemModelMasters(
&inventory.DescribeItemModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeItemModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeItemModelMasters(
(new DescribeItemModelMastersRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeItemModelMastersRequest;
import io.gs2.inventory.result.DescribeItemModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeItemModelMastersResult result = client.describeItemModelMasters(
new DescribeItemModelMastersRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withPageToken(null)
.withLimit(null)
);
List<ItemModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemModelMastersResult> asyncResult = null;
yield return client.DescribeItemModelMasters(
new Gs2.Gs2Inventory.Request.DescribeItemModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeItemModelMasters(
new Gs2Inventory.DescribeItemModelMastersRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_item_model_masters(
inventory.DescribeItemModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_item_model_masters({
namespaceName="namespace-0001",
inventoryName="item",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_item_model_masters_async({
namespaceName="namespace-0001",
inventoryName="item",
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;createItemModelMaster
Create a new Item Model Master
Creates an editable item model master that defines a new item type within the specified inventory. Key settings include stackingLimit (maximum quantity per stack), allowMultipleStacks (whether the same item can occupy multiple inventory slots), and sortValue (display ordering priority). When allowMultipleStacks is enabled, acquiring items beyond the stacking limit creates additional ItemSet entries rather than failing. The created master must be activated through the current master data update process to become available.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that this item belongs to. Determines which inventory bag this item type can be stored in and associates it with the inventory’s capacity and protection settings. | ||
| name | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata 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. Details are explained in the Microservices Introduction / GS2-Enhance section. | |||
| stackingLimit | long | ✓ | 1 ~ 9223372036854775805 | Maximum Stackable Quantity The maximum number of this item that can be held in a single inventory slot (stack). When this limit is reached, the behavior depends on the allowMultipleStacks setting: either a new slot is allocated or further acquisition is blocked. | ||
| allowMultipleStacks | bool | ✓ | Allow Multiple Stacks When enabled, if the stacking limit is reached, a new inventory slot is automatically allocated to store additional quantities of this item (consuming additional capacity). When disabled, acquisition is blocked once the stacking limit is reached in the existing slot. | |||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display Order A numeric value used to sort items within the inventory for display purposes. Lower values are displayed first. This value is also copied to ItemSet records to enable consistent ordering of possessed items. |
Result
| Type | Description | |
|---|---|---|
| item | ItemModelMaster | Item Model Master created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CreateItemModelMaster(
&inventory.CreateItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
Name: pointy.String("item-master-0001"),
Description: nil,
Metadata: nil,
StackingLimit: pointy.Int64(99),
AllowMultipleStacks: pointy.Bool(false),
SortValue: pointy.Int32(10),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->createItemModelMaster(
(new CreateItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withName("item-master-0001")
->withDescription(null)
->withMetadata(null)
->withStackingLimit(99)
->withAllowMultipleStacks(False)
->withSortValue(10)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateItemModelMasterRequest;
import io.gs2.inventory.result.CreateItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CreateItemModelMasterResult result = client.createItemModelMaster(
new CreateItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withName("item-master-0001")
.withDescription(null)
.withMetadata(null)
.withStackingLimit(99L)
.withAllowMultipleStacks(false)
.withSortValue(10)
);
ItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CreateItemModelMasterResult> asyncResult = null;
yield return client.CreateItemModelMaster(
new Gs2.Gs2Inventory.Request.CreateItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithName("item-master-0001")
.WithDescription(null)
.WithMetadata(null)
.WithStackingLimit(99L)
.WithAllowMultipleStacks(false)
.WithSortValue(10),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.createItemModelMaster(
new Gs2Inventory.CreateItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withName("item-master-0001")
.withDescription(null)
.withMetadata(null)
.withStackingLimit(99)
.withAllowMultipleStacks(false)
.withSortValue(10)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.create_item_model_master(
inventory.CreateItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_name('item-master-0001')
.with_description(None)
.with_metadata(None)
.with_stacking_limit(99)
.with_allow_multiple_stacks(False)
.with_sort_value(10)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.create_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
name="item-master-0001",
description=nil,
metadata=nil,
stackingLimit=99,
allowMultipleStacks=false,
sortValue=10,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.create_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
name="item-master-0001",
description=nil,
metadata=nil,
stackingLimit=99,
allowMultipleStacks=false,
sortValue=10,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getItemModelMaster
Get Item Model Master
Retrieves the full configuration of a specific editable item model master, including its stacking limit, multi-stack allowance, sort value, and metadata.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | ItemModelMaster | Item Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetItemModelMaster(
&inventory.GetItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getItemModelMaster(
(new GetItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetItemModelMasterRequest;
import io.gs2.inventory.result.GetItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetItemModelMasterResult result = client.getItemModelMaster(
new GetItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
ItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetItemModelMasterResult> asyncResult = null;
yield return client.GetItemModelMaster(
new Gs2.Gs2Inventory.Request.GetItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getItemModelMaster(
new Gs2Inventory.GetItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_item_model_master(
inventory.GetItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;updateItemModelMaster
Update Item Model Master
Updates the properties of an existing item model master, including stacking limit, multi-stack allowance, sort value, and metadata. Changes do not take effect until the master data is re-activated through the current master data update process.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata 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. Details are explained in the Microservices Introduction / GS2-Enhance section. | |||
| stackingLimit | long | ✓ | 1 ~ 9223372036854775805 | Maximum Stackable Quantity The maximum number of this item that can be held in a single inventory slot (stack). When this limit is reached, the behavior depends on the allowMultipleStacks setting: either a new slot is allocated or further acquisition is blocked. | ||
| allowMultipleStacks | bool | ✓ | Allow Multiple Stacks When enabled, if the stacking limit is reached, a new inventory slot is automatically allocated to store additional quantities of this item (consuming additional capacity). When disabled, acquisition is blocked once the stacking limit is reached in the existing slot. | |||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display Order A numeric value used to sort items within the inventory for display purposes. Lower values are displayed first. This value is also copied to ItemSet records to enable consistent ordering of possessed items. |
Result
| Type | Description | |
|---|---|---|
| item | ItemModelMaster | Item Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateItemModelMaster(
&inventory.UpdateItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("ITEM_MASTER_0001"),
StackingLimit: pointy.Int64(49),
AllowMultipleStacks: pointy.Bool(true),
SortValue: pointy.Int32(30),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateItemModelMaster(
(new UpdateItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
->withDescription("description1")
->withMetadata("ITEM_MASTER_0001")
->withStackingLimit(49)
->withAllowMultipleStacks(True)
->withSortValue(30)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateItemModelMasterRequest;
import io.gs2.inventory.result.UpdateItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateItemModelMasterResult result = client.updateItemModelMaster(
new UpdateItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
.withDescription("description1")
.withMetadata("ITEM_MASTER_0001")
.withStackingLimit(49L)
.withAllowMultipleStacks(true)
.withSortValue(30)
);
ItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateItemModelMasterResult> asyncResult = null;
yield return client.UpdateItemModelMaster(
new Gs2.Gs2Inventory.Request.UpdateItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001")
.WithDescription("description1")
.WithMetadata("ITEM_MASTER_0001")
.WithStackingLimit(49L)
.WithAllowMultipleStacks(true)
.WithSortValue(30),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateItemModelMaster(
new Gs2Inventory.UpdateItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
.withDescription("description1")
.withMetadata("ITEM_MASTER_0001")
.withStackingLimit(49)
.withAllowMultipleStacks(true)
.withSortValue(30)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_item_model_master(
inventory.UpdateItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
.with_description('description1')
.with_metadata('ITEM_MASTER_0001')
.with_stacking_limit(49)
.with_allow_multiple_stacks(True)
.with_sort_value(30)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
description="description1",
metadata="ITEM_MASTER_0001",
stackingLimit=49,
allowMultipleStacks=true,
sortValue=30,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
description="description1",
metadata="ITEM_MASTER_0001",
stackingLimit=49,
allowMultipleStacks=true,
sortValue=30,
})
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;deleteItemModelMaster
Delete Item Model Master
Deletes the specified item model master. The deletion does not affect the currently active model until the master data is re-activated. Existing user items associated with this model are not automatically deleted.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | ItemModelMaster | Item Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteItemModelMaster(
&inventory.DeleteItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteItemModelMaster(
(new DeleteItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteItemModelMasterRequest;
import io.gs2.inventory.result.DeleteItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteItemModelMasterResult result = client.deleteItemModelMaster(
new DeleteItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
ItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteItemModelMasterResult> asyncResult = null;
yield return client.DeleteItemModelMaster(
new Gs2.Gs2Inventory.Request.DeleteItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteItemModelMaster(
new Gs2Inventory.DeleteItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_item_model_master(
inventory.DeleteItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;describeSimpleInventoryModelMasters
Get a list of Simple Inventory Model Masters
Retrieves a paginated list of editable simple inventory model masters in the namespace. These are the draft definitions that can be modified before activation through the master data update process.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| namePrefix | string | ~ 64 chars | Filter by Simple Inventory 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<SimpleInventoryModelMaster> | List of Simple Inventory Model Masters |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeSimpleInventoryModelMasters(
&inventory.DescribeSimpleInventoryModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleInventoryModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeSimpleInventoryModelMasters(
(new DescribeSimpleInventoryModelMastersRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleInventoryModelMastersRequest;
import io.gs2.inventory.result.DescribeSimpleInventoryModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeSimpleInventoryModelMastersResult result = client.describeSimpleInventoryModelMasters(
new DescribeSimpleInventoryModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<SimpleInventoryModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeSimpleInventoryModelMasters(
new Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeSimpleInventoryModelMasters(
new Gs2Inventory.DescribeSimpleInventoryModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_simple_inventory_model_masters(
inventory.DescribeSimpleInventoryModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_simple_inventory_model_masters({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_simple_inventory_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;createSimpleInventoryModelMaster
Create a new Simple Inventory Model Master
Creates an editable simple inventory model master. Unlike regular inventory models, simple inventory models do not have capacity limits, item expiration, or reference management. The created master must be activated through the current master data update process to become available.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| name | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | SimpleInventoryModelMaster | Created Simple Inventory Model Master created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CreateSimpleInventoryModelMaster(
&inventory.CreateSimpleInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("item"),
Description: nil,
Metadata: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateSimpleInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->createSimpleInventoryModelMaster(
(new CreateSimpleInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withName("item")
->withDescription(null)
->withMetadata(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.CreateSimpleInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CreateSimpleInventoryModelMasterResult result = client.createSimpleInventoryModelMaster(
new CreateSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("item")
.withDescription(null)
.withMetadata(null)
);
SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CreateSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.CreateSimpleInventoryModelMaster(
new Gs2.Gs2Inventory.Request.CreateSimpleInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("item")
.WithDescription(null)
.WithMetadata(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.createSimpleInventoryModelMaster(
new Gs2Inventory.CreateSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("item")
.withDescription(null)
.withMetadata(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.create_simple_inventory_model_master(
inventory.CreateSimpleInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('item')
.with_description(None)
.with_metadata(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.create_simple_inventory_model_master({
namespaceName="namespace-0001",
name="item",
description=nil,
metadata=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.create_simple_inventory_model_master_async({
namespaceName="namespace-0001",
name="item",
description=nil,
metadata=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;getSimpleInventoryModelMaster
Get Simple Inventory Model Master
Retrieves the full configuration of a specific editable simple inventory model master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SimpleInventoryModelMaster | Simple Inventory Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleInventoryModelMaster(
&inventory.GetSimpleInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleInventoryModelMaster(
(new GetSimpleInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.GetSimpleInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleInventoryModelMasterResult result = client.getSimpleInventoryModelMaster(
new GetSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.GetSimpleInventoryModelMaster(
new Gs2.Gs2Inventory.Request.GetSimpleInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleInventoryModelMaster(
new Gs2Inventory.GetSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_inventory_model_master(
inventory.GetSimpleInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_simple_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;updateSimpleInventoryModelMaster
Update Simple Inventory Model Master
Updates the properties of an existing simple inventory model master. Changes do not take effect until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | SimpleInventoryModelMaster | Simple Inventory Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateSimpleInventoryModelMaster(
&inventory.UpdateSimpleInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
Description: pointy.String("description1"),
Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateSimpleInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateSimpleInventoryModelMaster(
(new UpdateSimpleInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withDescription("description1")
->withMetadata("ITEM_INVENTORY_MASTER")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.UpdateSimpleInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateSimpleInventoryModelMasterResult result = client.updateSimpleInventoryModelMaster(
new UpdateSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withDescription("description1")
.withMetadata("ITEM_INVENTORY_MASTER")
);
SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateSimpleInventoryModelMaster(
new Gs2.Gs2Inventory.Request.UpdateSimpleInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithDescription("description1")
.WithMetadata("ITEM_INVENTORY_MASTER"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateSimpleInventoryModelMaster(
new Gs2Inventory.UpdateSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withDescription("description1")
.withMetadata("ITEM_INVENTORY_MASTER")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_simple_inventory_model_master(
inventory.UpdateSimpleInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_description('description1')
.with_metadata('ITEM_INVENTORY_MASTER')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_simple_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
description="description1",
metadata="ITEM_INVENTORY_MASTER",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_simple_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
description="description1",
metadata="ITEM_INVENTORY_MASTER",
})
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;deleteSimpleInventoryModelMaster
Delete Simple Inventory Model Master
Deletes the specified simple inventory model master. The deletion does not affect the currently active model until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SimpleInventoryModelMaster | Simple Inventory Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteSimpleInventoryModelMaster(
&inventory.DeleteSimpleInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteSimpleInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteSimpleInventoryModelMaster(
(new DeleteSimpleInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteSimpleInventoryModelMasterRequest;
import io.gs2.inventory.result.DeleteSimpleInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteSimpleInventoryModelMasterResult result = client.deleteSimpleInventoryModelMaster(
new DeleteSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteSimpleInventoryModelMaster(
new Gs2.Gs2Inventory.Request.DeleteSimpleInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteSimpleInventoryModelMaster(
new Gs2Inventory.DeleteSimpleInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_simple_inventory_model_master(
inventory.DeleteSimpleInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_simple_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_simple_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;describeSimpleItemModelMasters
Get a list of Simple Item Model Masters
Retrieves a paginated list of editable simple item model masters belonging to the specified simple inventory model master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| namePrefix | string | ~ 64 chars | Filter by Simple Item 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<SimpleItemModelMaster> | List of Simple Item Model Master |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeSimpleItemModelMasters(
&inventory.DescribeSimpleItemModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeSimpleItemModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeSimpleItemModelMasters(
(new DescribeSimpleItemModelMastersRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeSimpleItemModelMastersRequest;
import io.gs2.inventory.result.DescribeSimpleItemModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeSimpleItemModelMastersResult result = client.describeSimpleItemModelMasters(
new DescribeSimpleItemModelMastersRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<SimpleItemModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemModelMastersResult> asyncResult = null;
yield return client.DescribeSimpleItemModelMasters(
new Gs2.Gs2Inventory.Request.DescribeSimpleItemModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeSimpleItemModelMasters(
new Gs2Inventory.DescribeSimpleItemModelMastersRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_simple_item_model_masters(
inventory.DescribeSimpleItemModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_simple_item_model_masters({
namespaceName="namespace-0001",
inventoryName="item",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_simple_item_model_masters_async({
namespaceName="namespace-0001",
inventoryName="item",
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;createSimpleItemModelMaster
Create a new Simple Item Model Master
Creates an editable simple item model master that defines a new item type within the specified simple inventory. The created master must be activated through the current master data update process to become available.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| name | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItemModelMaster | Item Model Master created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CreateSimpleItemModelMaster(
&inventory.CreateSimpleItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
Name: pointy.String("item-master-0001"),
Description: nil,
Metadata: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateSimpleItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->createSimpleItemModelMaster(
(new CreateSimpleItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withName("item-master-0001")
->withDescription(null)
->withMetadata(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateSimpleItemModelMasterRequest;
import io.gs2.inventory.result.CreateSimpleItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CreateSimpleItemModelMasterResult result = client.createSimpleItemModelMaster(
new CreateSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withName("item-master-0001")
.withDescription(null)
.withMetadata(null)
);
SimpleItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CreateSimpleItemModelMasterResult> asyncResult = null;
yield return client.CreateSimpleItemModelMaster(
new Gs2.Gs2Inventory.Request.CreateSimpleItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithName("item-master-0001")
.WithDescription(null)
.WithMetadata(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.createSimpleItemModelMaster(
new Gs2Inventory.CreateSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withName("item-master-0001")
.withDescription(null)
.withMetadata(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.create_simple_item_model_master(
inventory.CreateSimpleItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_name('item-master-0001')
.with_description(None)
.with_metadata(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.create_simple_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
name="item-master-0001",
description=nil,
metadata=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.create_simple_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
name="item-master-0001",
description=nil,
metadata=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;getSimpleItemModelMaster
Get Simple Item Model Master
Retrieves the full configuration of a specific editable simple item model master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItemModelMaster | Simple Item Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetSimpleItemModelMaster(
&inventory.GetSimpleItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetSimpleItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getSimpleItemModelMaster(
(new GetSimpleItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetSimpleItemModelMasterRequest;
import io.gs2.inventory.result.GetSimpleItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetSimpleItemModelMasterResult result = client.getSimpleItemModelMaster(
new GetSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
SimpleItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemModelMasterResult> asyncResult = null;
yield return client.GetSimpleItemModelMaster(
new Gs2.Gs2Inventory.Request.GetSimpleItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getSimpleItemModelMaster(
new Gs2Inventory.GetSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_simple_item_model_master(
inventory.GetSimpleItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_simple_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_simple_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;updateSimpleItemModelMaster
Update Simple Item Model Master
Updates the properties of an existing simple item model master. Changes do not take effect until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItemModelMaster | Simple Item Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateSimpleItemModelMaster(
&inventory.UpdateSimpleItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("ITEM_MASTER_0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateSimpleItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateSimpleItemModelMaster(
(new UpdateSimpleItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
->withDescription("description1")
->withMetadata("ITEM_MASTER_0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateSimpleItemModelMasterRequest;
import io.gs2.inventory.result.UpdateSimpleItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateSimpleItemModelMasterResult result = client.updateSimpleItemModelMaster(
new UpdateSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
.withDescription("description1")
.withMetadata("ITEM_MASTER_0001")
);
SimpleItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateSimpleItemModelMasterResult> asyncResult = null;
yield return client.UpdateSimpleItemModelMaster(
new Gs2.Gs2Inventory.Request.UpdateSimpleItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001")
.WithDescription("description1")
.WithMetadata("ITEM_MASTER_0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateSimpleItemModelMaster(
new Gs2Inventory.UpdateSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
.withDescription("description1")
.withMetadata("ITEM_MASTER_0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_simple_item_model_master(
inventory.UpdateSimpleItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
.with_description('description1')
.with_metadata('ITEM_MASTER_0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_simple_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
description="description1",
metadata="ITEM_MASTER_0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_simple_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
description="description1",
metadata="ITEM_MASTER_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;deleteSimpleItemModelMaster
Delete Simple Item Model Master
Deletes the specified simple item model master. The deletion does not affect the currently active model until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SimpleItemModelMaster | Simple Item Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteSimpleItemModelMaster(
&inventory.DeleteSimpleItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteSimpleItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteSimpleItemModelMaster(
(new DeleteSimpleItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteSimpleItemModelMasterRequest;
import io.gs2.inventory.result.DeleteSimpleItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteSimpleItemModelMasterResult result = client.deleteSimpleItemModelMaster(
new DeleteSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
SimpleItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleItemModelMasterResult> asyncResult = null;
yield return client.DeleteSimpleItemModelMaster(
new Gs2.Gs2Inventory.Request.DeleteSimpleItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteSimpleItemModelMaster(
new Gs2Inventory.DeleteSimpleItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_simple_item_model_master(
inventory.DeleteSimpleItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_simple_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_simple_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;describeBigInventoryModelMasters
Get a list of Big Inventory Model Masters
Retrieves a paginated list of editable big inventory model masters in the namespace. These are the draft definitions for inventory types that use arbitrary-precision item counts.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| namePrefix | string | ~ 64 chars | Filter by Big Inventory 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<BigInventoryModelMaster> | List of Big Inventory Model Masters |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeBigInventoryModelMasters(
&inventory.DescribeBigInventoryModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigInventoryModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeBigInventoryModelMasters(
(new DescribeBigInventoryModelMastersRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigInventoryModelMastersRequest;
import io.gs2.inventory.result.DescribeBigInventoryModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeBigInventoryModelMastersResult result = client.describeBigInventoryModelMasters(
new DescribeBigInventoryModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<BigInventoryModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeBigInventoryModelMasters(
new Gs2.Gs2Inventory.Request.DescribeBigInventoryModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeBigInventoryModelMasters(
new Gs2Inventory.DescribeBigInventoryModelMastersRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_big_inventory_model_masters(
inventory.DescribeBigInventoryModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_big_inventory_model_masters({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_big_inventory_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;createBigInventoryModelMaster
Create a new Big Inventory Model Master
Creates an editable big inventory model master for arbitrary-precision item management. The created master must be activated through the current master data update process to become available.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| name | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | BigInventoryModelMaster | Created Big Inventory Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CreateBigInventoryModelMaster(
&inventory.CreateBigInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("item"),
Description: nil,
Metadata: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateBigInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->createBigInventoryModelMaster(
(new CreateBigInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withName("item")
->withDescription(null)
->withMetadata(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateBigInventoryModelMasterRequest;
import io.gs2.inventory.result.CreateBigInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CreateBigInventoryModelMasterResult result = client.createBigInventoryModelMaster(
new CreateBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("item")
.withDescription(null)
.withMetadata(null)
);
BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CreateBigInventoryModelMasterResult> asyncResult = null;
yield return client.CreateBigInventoryModelMaster(
new Gs2.Gs2Inventory.Request.CreateBigInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("item")
.WithDescription(null)
.WithMetadata(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.createBigInventoryModelMaster(
new Gs2Inventory.CreateBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("item")
.withDescription(null)
.withMetadata(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.create_big_inventory_model_master(
inventory.CreateBigInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('item')
.with_description(None)
.with_metadata(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.create_big_inventory_model_master({
namespaceName="namespace-0001",
name="item",
description=nil,
metadata=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.create_big_inventory_model_master_async({
namespaceName="namespace-0001",
name="item",
description=nil,
metadata=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;getBigInventoryModelMaster
Get Big Inventory Model Master
Retrieves the full configuration of a specific editable big inventory model master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | BigInventoryModelMaster | Big Inventory Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetBigInventoryModelMaster(
&inventory.GetBigInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getBigInventoryModelMaster(
(new GetBigInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigInventoryModelMasterRequest;
import io.gs2.inventory.result.GetBigInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetBigInventoryModelMasterResult result = client.getBigInventoryModelMaster(
new GetBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetBigInventoryModelMasterResult> asyncResult = null;
yield return client.GetBigInventoryModelMaster(
new Gs2.Gs2Inventory.Request.GetBigInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getBigInventoryModelMaster(
new Gs2Inventory.GetBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_big_inventory_model_master(
inventory.GetBigInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_big_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_big_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;updateBigInventoryModelMaster
Update Big Inventory Model Master
Updates the properties of an existing big inventory model master. Changes do not take effect until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | BigInventoryModelMaster | Big Inventory Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateBigInventoryModelMaster(
&inventory.UpdateBigInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
Description: pointy.String("description1"),
Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateBigInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateBigInventoryModelMaster(
(new UpdateBigInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withDescription("description1")
->withMetadata("ITEM_INVENTORY_MASTER")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateBigInventoryModelMasterRequest;
import io.gs2.inventory.result.UpdateBigInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateBigInventoryModelMasterResult result = client.updateBigInventoryModelMaster(
new UpdateBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withDescription("description1")
.withMetadata("ITEM_INVENTORY_MASTER")
);
BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateBigInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateBigInventoryModelMaster(
new Gs2.Gs2Inventory.Request.UpdateBigInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithDescription("description1")
.WithMetadata("ITEM_INVENTORY_MASTER"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateBigInventoryModelMaster(
new Gs2Inventory.UpdateBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withDescription("description1")
.withMetadata("ITEM_INVENTORY_MASTER")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_big_inventory_model_master(
inventory.UpdateBigInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_description('description1')
.with_metadata('ITEM_INVENTORY_MASTER')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_big_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
description="description1",
metadata="ITEM_INVENTORY_MASTER",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_big_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
description="description1",
metadata="ITEM_INVENTORY_MASTER",
})
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;deleteBigInventoryModelMaster
Delete Big Inventory Model Master
Deletes the specified big inventory model master. The deletion does not affect the currently active model until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | BigInventoryModelMaster | Big Inventory Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteBigInventoryModelMaster(
&inventory.DeleteBigInventoryModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteBigInventoryModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteBigInventoryModelMaster(
(new DeleteBigInventoryModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteBigInventoryModelMasterRequest;
import io.gs2.inventory.result.DeleteBigInventoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteBigInventoryModelMasterResult result = client.deleteBigInventoryModelMaster(
new DeleteBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteBigInventoryModelMaster(
new Gs2.Gs2Inventory.Request.DeleteBigInventoryModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteBigInventoryModelMaster(
new Gs2Inventory.DeleteBigInventoryModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_big_inventory_model_master(
inventory.DeleteBigInventoryModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_big_inventory_model_master({
namespaceName="namespace-0001",
inventoryName="item",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_big_inventory_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
})
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;describeBigItemModelMasters
Get a list of Big Item Model Masters
Retrieves a paginated list of editable big item model masters belonging to the specified big inventory model master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| namePrefix | string | ~ 64 chars | Filter by Big Item 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<BigItemModelMaster> | List of Big Item Model Master |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DescribeBigItemModelMasters(
&inventory.DescribeBigItemModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeBigItemModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->describeBigItemModelMasters(
(new DescribeBigItemModelMastersRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeBigItemModelMastersRequest;
import io.gs2.inventory.result.DescribeBigItemModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DescribeBigItemModelMastersResult result = client.describeBigItemModelMasters(
new DescribeBigItemModelMastersRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<BigItemModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemModelMastersResult> asyncResult = null;
yield return client.DescribeBigItemModelMasters(
new Gs2.Gs2Inventory.Request.DescribeBigItemModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.describeBigItemModelMasters(
new Gs2Inventory.DescribeBigItemModelMastersRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.describe_big_item_model_masters(
inventory.DescribeBigItemModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.describe_big_item_model_masters({
namespaceName="namespace-0001",
inventoryName="item",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('inventory')
api_result_handler = client.describe_big_item_model_masters_async({
namespaceName="namespace-0001",
inventoryName="item",
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;createBigItemModelMaster
Create a new Big Item Model Master
Creates an editable big item model master that defines a new item type with arbitrary-precision counts within the specified big inventory. The created master must be activated through the current master data update process to become available.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| name | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | BigItemModelMaster | Item Model Master created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.CreateBigItemModelMaster(
&inventory.CreateBigItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
Name: pointy.String("item-master-0001"),
Description: nil,
Metadata: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateBigItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->createBigItemModelMaster(
(new CreateBigItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withName("item-master-0001")
->withDescription(null)
->withMetadata(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateBigItemModelMasterRequest;
import io.gs2.inventory.result.CreateBigItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
CreateBigItemModelMasterResult result = client.createBigItemModelMaster(
new CreateBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withName("item-master-0001")
.withDescription(null)
.withMetadata(null)
);
BigItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.CreateBigItemModelMasterResult> asyncResult = null;
yield return client.CreateBigItemModelMaster(
new Gs2.Gs2Inventory.Request.CreateBigItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithName("item-master-0001")
.WithDescription(null)
.WithMetadata(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.createBigItemModelMaster(
new Gs2Inventory.CreateBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withName("item-master-0001")
.withDescription(null)
.withMetadata(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.create_big_item_model_master(
inventory.CreateBigItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_name('item-master-0001')
.with_description(None)
.with_metadata(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.create_big_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
name="item-master-0001",
description=nil,
metadata=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.create_big_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
name="item-master-0001",
description=nil,
metadata=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;getBigItemModelMaster
Get Big Item Model Master
Retrieves the full configuration of a specific editable big item model master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | BigItemModelMaster | Big Item Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.GetBigItemModelMaster(
&inventory.GetBigItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetBigItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->getBigItemModelMaster(
(new GetBigItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetBigItemModelMasterRequest;
import io.gs2.inventory.result.GetBigItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
GetBigItemModelMasterResult result = client.getBigItemModelMaster(
new GetBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
BigItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemModelMasterResult> asyncResult = null;
yield return client.GetBigItemModelMaster(
new Gs2.Gs2Inventory.Request.GetBigItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.getBigItemModelMaster(
new Gs2Inventory.GetBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.get_big_item_model_master(
inventory.GetBigItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.get_big_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.get_big_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;updateBigItemModelMaster
Update Big Item Model Master
Updates the properties of an existing big item model master. Changes do not take effect until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
Result
| Type | Description | |
|---|---|---|
| item | BigItemModelMaster | Big Item Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.UpdateBigItemModelMaster(
&inventory.UpdateBigItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("ITEM_MASTER_0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateBigItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->updateBigItemModelMaster(
(new UpdateBigItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
->withDescription("description1")
->withMetadata("ITEM_MASTER_0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateBigItemModelMasterRequest;
import io.gs2.inventory.result.UpdateBigItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
UpdateBigItemModelMasterResult result = client.updateBigItemModelMaster(
new UpdateBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
.withDescription("description1")
.withMetadata("ITEM_MASTER_0001")
);
BigItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.UpdateBigItemModelMasterResult> asyncResult = null;
yield return client.UpdateBigItemModelMaster(
new Gs2.Gs2Inventory.Request.UpdateBigItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001")
.WithDescription("description1")
.WithMetadata("ITEM_MASTER_0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.updateBigItemModelMaster(
new Gs2Inventory.UpdateBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
.withDescription("description1")
.withMetadata("ITEM_MASTER_0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.update_big_item_model_master(
inventory.UpdateBigItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
.with_description('description1')
.with_metadata('ITEM_MASTER_0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.update_big_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
description="description1",
metadata="ITEM_MASTER_0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.update_big_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
description="description1",
metadata="ITEM_MASTER_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;deleteBigItemModelMaster
Delete Big Item Model Master
Deletes the specified big item model master. The deletion does not affect the currently active model until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | BigItemModelMaster | Big Item Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
Session: &session,
}
result, err := client.DeleteBigItemModelMaster(
&inventory.DeleteBigItemModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
InventoryName: pointy.String("item"),
ItemName: pointy.String("item-master-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteBigItemModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2InventoryRestClient(
$session
);
try {
$result = $client->deleteBigItemModelMaster(
(new DeleteBigItemModelMasterRequest())
->withNamespaceName("namespace-0001")
->withInventoryName("item")
->withItemName("item-master-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteBigItemModelMasterRequest;
import io.gs2.inventory.result.DeleteBigItemModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(session);
try {
DeleteBigItemModelMasterResult result = client.deleteBigItemModelMaster(
new DeleteBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
BigItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2InventoryRestClient(session);
AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigItemModelMasterResult> asyncResult = null;
yield return client.DeleteBigItemModelMaster(
new Gs2.Gs2Inventory.Request.DeleteBigItemModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithInventoryName("item")
.WithItemName("item-master-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);
try {
const result = await client.deleteBigItemModelMaster(
new Gs2Inventory.DeleteBigItemModelMasterRequest()
.withNamespaceName("namespace-0001")
.withInventoryName("item")
.withItemName("item-master-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import inventory
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)
try:
result = client.delete_big_item_model_master(
inventory.DeleteBigItemModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_inventory_name('item')
.with_item_name('item-master-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('inventory')
api_result = client.delete_big_item_model_master({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('inventory')
api_result_handler = client.delete_big_item_model_master_async({
namespaceName="namespace-0001",
inventoryName="item",
itemName="item-master-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;