API Reference of GS2-Inventory SDK

Model

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
acquireScriptScriptSettingScript to be executed when an item is obtained
overflowScriptScriptSettingScript to be executed when the maximum acquisition limit is reached and the script cannot be obtained.
consumeScriptScriptSettingScript to run when consuming items
logSettingLogSettingLog output settings
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

InventoryModelMaster

Inventory Model Master

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.

The inventory capacity can be expanded. It can be set to reward stamp sheets, so any method of expansion is acceptable as long as the stamp sheets can be used to grant rewards.

TypeConditionRequireDefaultLimitationDescription
inventoryModelIdstring~ 1024 charsInventory Model Master GRN
namestring~ 128 charsInventory Model Name
metadatastring~ 128 charsmetadata
descriptionstring~ 1024 charsdescription of Namespace
initialCapacityint~ 2147483646Initial Capacity
maxCapacityint~ 2147483646Maximum Capacity
protectReferencedItemboolfalseItem Sets with registered references cannot be deleted
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

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.

The inventory capacity can be expanded. It can be set to reward stamp sheets, so any method of expansion is acceptable as long as the stamp sheets can be used to grant rewards.

TypeConditionRequireDefaultLimitationDescription
inventoryModelIdstring~ 1024 charsInventory model GRN
namestring~ 128 charsInventory Model Name
metadatastring~ 128 charsmetadata
initialCapacityint~ 2147483646Initial Capacity
maxCapacityint~ 2147483646Maximum Capacity
protectReferencedItembool?falseItem Sets with registered references cannot be deleted
itemModelsList<ItemModel>1 ~ 1000 itemsList of item models that can be stored in inventory

ItemModelMaster

Item Model Master

Items can be owned more than once for one capacity of inventory, such as potion x 99. Multiple items owned in a single capacity are stacked items. The maximum number of items that can be stacked can be specified for each item.

When the maximum stackable quantity is reached, you can set for each item whether you can reserve a new inventory capacity and own it, or whether it will no longer be available.

TypeConditionRequireDefaultLimitationDescription
itemModelIdstring~ 1024 charsItem Model Master GRN
inventoryNamestring~ 128 charsinventory model name
namestring~ 128 charsItem Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
stackingLimitlong1 ~ 9223372036854775805Maximum stackable quantity
allowMultipleStacksboolAllow items to be stored in multiple slots when the maximum stackable quantity is exceeded
sortValueint~ 2147483646Display order
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

ItemModel

Item Model

Multiple items can be owned for one capacity of inventory, such as potions x 99. Multiple items owned in one capacity are stacked items. The maximum number of items that can be stacked can be specified for each item.

When the maximum stackable quantity is reached, you can set for each item whether you can reserve a new inventory capacity and own it, or whether it will no longer be available.

TypeConditionRequireDefaultLimitationDescription
itemModelIdstring~ 1024 charsItem Model GRN
namestring~ 128 charsItem Model Name
metadatastring~ 128 charsmetadata
stackingLimitlong1 ~ 9223372036854775805Maximum stackable quantity
allowMultipleStacksboolAllow items to be stored in multiple slots when the maximum stackable quantity is exceeded?
sortValueint~ 2147483646Display order

SimpleInventoryModelMaster

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 an API that can increase or decrease the number of items in a single process.

TypeConditionRequireDefaultLimitationDescription
inventoryModelIdstring~ 1024 charsSimple Inventory Model Master GRN
namestring~ 128 charsSimple Inventory Model Name
metadatastring~ 128 charsmetadata
descriptionstring~ 1024 charsdescription of Namespace
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

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 an API that can increase or decrease the number of items in a single process.

TypeConditionRequireDefaultLimitationDescription
inventoryModelIdstring~ 1024 charsInventory model GRN
namestring~ 128 charsSimple Inventory Model Name
metadatastring~ 128 charsmetadata
simpleItemModelsList<SimpleItemModel>1 ~ 1000 itemsList of simple item models that can be stored in inventory

SimpleItemModelMaster

Simple ItemModel Master

In the normal ItemModel, it is possible to set the maximum number of items that can be stacked, and if the number exceeds a certain number, it can be implemented to divide the items into multiple stacks. However, SimpleItem does not have such a function and simply stores the number of items in the possession of the item.

TypeConditionRequireDefaultLimitationDescription
itemModelIdstring~ 1024 charsSimple Item Model Master GRN
namestring~ 128 charsSimple Item Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

SimpleItemModel

Simple ItemModel

In the normal ItemModel, it is possible to set the maximum number of items that can be stacked, and if the number exceeds a certain number, it can be implemented to divide the items into multiple stacks. However, SimpleItem does not have such a function and simply stores the number of items in the possession of the item.

TypeConditionRequireDefaultLimitationDescription
itemModelIdstring~ 1024 charsSimple Item Model GRN
namestring~ 128 charsSimple Item Model Name
metadatastring~ 128 charsmetadata

BigInventoryModelMaster

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 64bit integer values. 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.

TypeConditionRequireDefaultLimitationDescription
inventoryModelIdstring~ 1024 charsBig Inventory Model Master GRN
namestring~ 128 charsBig Inventory Model Name
metadatastring~ 128 charsmetadata
descriptionstring~ 1024 charsdescription of Namespace
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

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 64bit integer values. 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.

TypeConditionRequireDefaultLimitationDescription
inventoryModelIdstring~ 1024 charsInventory model GRN
namestring~ 128 charsBig Inventory Model Name
metadatastring~ 128 charsmetadata
bigItemModelsList<BigItemModel>1 ~ 1000 itemsList of big item models that can be stored in inventory

BigItemModelMaster

Big ItemModel Master

In the normal ItemModel, it is possible to set the maximum number of items that can be stacked, and if the number exceeds a certain number, it can be implemented to divide the items into multiple stacks. However, BigItem does not have such a function and simply stores the number of items in the possession of the item.

TypeConditionRequireDefaultLimitationDescription
itemModelIdstring~ 1024 charsBig Item Model Master GRN
namestring~ 128 charsBig Item Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

BigItemModel

Big ItemModel

In the normal ItemModel, it is possible to set the maximum number of items that can be stacked, and if the number exceeds a certain number, it can be implemented to divide the items into multiple stacks. However, BigItem does not have such a function and simply stores the number of items in the possession of the item.

TypeConditionRequireDefaultLimitationDescription
itemModelIdstring~ 1024 charsBig Item Model GRN
namestring~ 128 charsBig Item Model Name
metadatastring~ 128 charsmetadata

CurrentItemModelMaster

Currently available master data

GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.

We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.

Please refer to the documentation for the format of the JSON file.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
settingsstring~ 5242880 charsMaster data

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.

TypeConditionRequireDefaultLimitationDescription
inventoryIdstring~ 1024 charsInventory GRN
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
currentInventoryCapacityUsageint0~ 2147483646Capacity usage
currentInventoryMaxCapacityint1 ~ 2147483646Maximum capacity
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

ItemSet

Items are the property of the game player

TypeConditionRequireDefaultLimitationDescription
itemSetIdstring~ 1024 charsQuantity of items held per expiration date GRN
namestringUUID~ 36 charsName identifying the item set
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
countlong1 ~ 9223372036854775805Quantity in possession
referenceOfList<string>[]~ 24 itemsList of references for this possession
sortValueint~ 2147483646Display order
expiresAtlong0Effective date
createdAtlongDatetime of creation
updatedAtlongDatetime of last update

ReferenceOf

TypeConditionRequireDefaultLimitationDescription
referenceOfIdstring~ 1024 charsReference GRN
namestring~ 128 charsName identifying the item set

SimpleInventory

Simple Inventory

Inventory is like a bag that stores items owned by game players.

TypeConditionRequireDefaultLimitationDescription
inventoryIdstring~ 1024 charsSimple Inventory GRN
inventoryNamestring~ 128 charsSimple Inventory Model Name
userIdstring~ 128 charsUser Id
simpleItemsList<SimpleItem>~ 1000 itemsList of simple item
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

SimpleItem

Items are the property of the game player

TypeConditionRequireDefaultLimitationDescription
itemIdstring~ 1024 charsQuantity of items GRN
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsSimple Item Model Name
countlong1 ~ 9223372036854775805Quantity in possession
revisionlong0~ 9223372036854775805Revision

BigInventory

Big Inventory

Inventory is like a bag that stores items owned by game players.

TypeConditionRequireDefaultLimitationDescription
inventoryIdstring~ 1024 charsBigInventory GRN
inventoryNamestring~ 128 charsBig Inventory Model Name
userIdstring~ 128 charsUser Id
bigItemsList<BigItem>~ 1000 itemsList of big item
createdAtlongDatetime of creation
updatedAtlongDatetime of last update

BigItem

Items are the property of the game player

TypeConditionRequireDefaultLimitationDescription
itemIdstring~ 1024 charsQuantity of items GRN
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsBig Item Model Name
countstring~ 1024 charsQuantity in possession
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

GitHubCheckoutSetting

TypeConditionRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum [‘commit_hash’, ‘branch’, ’tag’]~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

ScriptSetting

TypeConditionRequireDefaultLimitationDescription
triggerScriptIdstring~ 1024 charsScript GRN
doneTriggerTargetTypeenum [’none’, ‘gs2_script’, ‘aws’]“none”~ 128 charsNotification of Completion
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsScript GRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsNamespace GRN

LogSetting

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

AcquireCount

TypeConditionRequireDefaultLimitationDescription
itemNamestring~ 128 charsSimple Item Model Name
countlong1 ~ 9223372036854775805Quantity to be obtained

ConsumeCount

TypeConditionRequireDefaultLimitationDescription
itemNamestring~ 128 charsSimple Item Model Name
countlong1 ~ 9223372036854775805Quantity to be consumed

Methods

describeNamespaces

Get list of namespaces

Request

TypeConditionRequireDefaultLimitationDescription
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 {
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

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

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

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

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

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

createNamespace

Create a new namespace

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
acquireScriptScriptSettingScript to be executed when an item is obtained
overflowScriptScriptSettingScript to be executed when the maximum acquisition limit is reached and the script cannot be obtained.
consumeScriptScriptSettingScript to run when consuming items
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace 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("namespace1"),
        Description: nil,
        AcquireScript: nil,
        OverflowScript: nil,
        ConsumeScript: nil,
        LogSetting: &inventory.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withAcquireScript(null)
            ->withOverflowScript(null)
            ->withConsumeScript(null)
            ->withLogSetting((new \Gs2\Inventory\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $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("namespace1")
            .withDescription(null)
            .withAcquireScript(null)
            .withOverflowScript(null)
            .withConsumeScript(null)
            .withLogSetting(new io.gs2.inventory.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateNamespaceRequest;
using Gs2.Gs2Inventory.Result.CreateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Inventory.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithAcquireScript(null)
        .WithOverflowScript(null)
        .WithConsumeScript(null)
        .WithLogSetting(new Gs2.Gs2Inventory.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    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("namespace1")
            .withDescription(null)
            .withAcquireScript(null)
            .withOverflowScript(null)
            .withConsumeScript(null)
            .withLogSetting(new Gs2Inventory.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    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(self.hash1)
            .with_description(None)
            .with_acquire_script(None)
            .with_overflow_script(None)
            .with_consume_script(None)
            .with_log_setting(
                inventory.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    acquireScript=nil,
    overflowScript=nil,
    consumeScript=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

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

result = api_result.result
item = result.item;

getNamespaceStatus

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
statusstring

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

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Inventory.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Inventory.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.get_namespace_status({
    namespaceName='namespace1',
})

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

result = api_result.result
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceNamespace

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

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetNamespaceRequest;
using Gs2.Gs2Inventory.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Inventory.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.get_namespace({
    namespaceName='namespace1',
})

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

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
acquireScriptScriptSettingScript to be executed when an item is obtained
overflowScriptScriptSettingScript to be executed when the maximum acquisition limit is reached and the script cannot be obtained.
consumeScriptScriptSettingScript to run when consuming items
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceUpdated 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.UpdateNamespace(
    &inventory.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        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"),
        },
        LogSetting: &inventory.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->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"))
            ->withLogSetting((new \Gs2\Inventory\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $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("namespace1")
            .withDescription("description1")
            .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"))
            .withLogSetting(new io.gs2.inventory.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateNamespaceRequest;
using Gs2.Gs2Inventory.Result.UpdateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Inventory.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .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"))
        .WithLogSetting(new Gs2.Gs2Inventory.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    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("namespace1")
            .withDescription("description1")
            .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"))
            .withLogSetting(new Gs2Inventory.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    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(self.hash1)
            .with_description('description1')
            .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_log_setting(
                inventory.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    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',
    },
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

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

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceDeleted 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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteNamespaceRequest;
using Gs2.Gs2Inventory.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Inventory.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.delete_namespace({
    namespaceName='namespace1',
})

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

Get dump data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

Result

TypeDescription

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.DumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Inventory.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.dump_user_data_by_user_id({
    userId='user-0001',
})

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

result = api_result.result

checkDumpUserDataByUserId

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

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

Result

TypeDescription
urlstringURL 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"),
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
    $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")
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CheckDumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Inventory.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
    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')
    )
    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',
})

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

Get clean data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

Result

TypeDescription

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Inventory.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.clean_user_data_by_user_id({
    userId='user-0001',
})

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

result = api_result.result

checkCleanUserDataByUserId

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

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

Result

TypeDescription

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CheckCleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Inventory.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.check_clean_user_data_by_user_id({
    userId='user-0001',
})

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

result = api_result.result

prepareImportUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

Result

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

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-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.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")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.PrepareImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Inventory.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-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.prepareImportUserDataByUserId(
        new Gs2Inventory.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-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.prepare_import_user_data_by_user_id(
        inventory.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
    )
    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',
})

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

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

importUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload

Result

TypeDescription

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.ImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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"),
    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")
    );
} 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')
    )
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',
})

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

result = api_result.result

checkImportUserDataByUserId

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

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload

Result

TypeDescription
urlstringURL 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"),
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
    );
    $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")
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CheckImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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"),
    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")
    );
    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')
    )
    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',
})

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

result = api_result.result
url = result.url;

describeInventoryModelMasters

Get list of inventory model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<InventoryModelMaster>List of Inventory Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeInventoryModelMasters(
        (new DescribeInventoryModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<InventoryModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeInventoryModelMastersRequest;
using Gs2.Gs2Inventory.Result.DescribeInventoryModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeInventoryModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeInventoryModelMastersRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    pageToken=nil,
    limit=nil,
})

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

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

createInventoryModelMaster

Create a new inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsInventory Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
initialCapacityint~ 2147483646Initial Capacity
maxCapacityint~ 2147483646Maximum Capacity
protectReferencedItemboolfalseItem Sets with registered references cannot be deleted

Result

TypeDescription
itemInventoryModelMasterInventory 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.CreateInventoryModelMaster(
    &inventory.CreateInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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.Item
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\CreateInventoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createInventoryModelMaster(
        (new CreateInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.CreateInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateInventoryModelMasterResult> asyncResult = null;
yield return client.CreateInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.CreateInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    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['message'])
end

result = api_result.result
item = result.item;

getInventoryModelMaster

Get inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name

Result

TypeDescription
itemInventoryModelMasterInventory 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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getInventoryModelMaster(
        (new GetInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    InventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelMasterResult> asyncResult = null;
yield return client.GetInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.GetInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

updateInventoryModelMaster

Update inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
initialCapacityint~ 2147483646Initial Capacity
maxCapacityint~ 2147483646Maximum Capacity
protectReferencedItemboolfalseItem Sets with registered references cannot be deleted

Result

TypeDescription
itemInventoryModelMasterUpdated 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.UpdateInventoryModelMaster(
    &inventory.UpdateInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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.Item
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\UpdateInventoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateInventoryModelMaster(
        (new UpdateInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    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['message'])
end

result = api_result.result
item = result.item;

deleteInventoryModelMaster

Delete inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name

Result

TypeDescription
itemInventoryModelMasterDeleted 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.DeleteInventoryModelMaster(
    &inventory.DeleteInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteInventoryModelMaster(
        (new DeleteInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    InventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.DeleteInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

describeInventoryModels

Get list of inventory models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemsList<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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeInventoryModels(
        (new DescribeInventoryModelsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    List<InventoryModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeInventoryModelsRequest;
using Gs2.Gs2Inventory.Result.DescribeInventoryModelsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelsResult> asyncResult = null;
yield return client.DescribeInventoryModels(
    new Gs2.Gs2Inventory.Request.DescribeInventoryModelsRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.describe_inventory_models({
    namespaceName='namespace1',
})

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

result = api_result.result
items = result.items;

getInventoryModel

Get Inventory Model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name

Result

TypeDescription
itemInventoryModelInventory 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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getInventoryModel(
        (new GetInventoryModelRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    InventoryModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetInventoryModelRequest;
using Gs2.Gs2Inventory.Result.GetInventoryModelResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelResult> asyncResult = null;
yield return client.GetInventoryModel(
    new Gs2.Gs2Inventory.Request.GetInventoryModelRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.get_inventory_model({
    namespaceName='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

describeItemModelMasters

Get list of item model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<ItemModelMaster>List of Item Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("item"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeItemModelMasters(
        (new DescribeItemModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ItemModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeItemModelMastersRequest;
using Gs2.Gs2Inventory.Result.DescribeItemModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemModelMastersResult> asyncResult = null;
yield return client.DescribeItemModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeItemModelMastersRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    pageToken=nil,
    limit=nil,
})

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

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

createItemModelMaster

Create a new item model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsinventory model name
namestring~ 128 charsItem Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
stackingLimitlong1 ~ 9223372036854775805Maximum stackable quantity
allowMultipleStacksboolAllow items to be stored in multiple slots when the maximum stackable quantity is exceeded
sortValueint~ 2147483646Display order

Result

TypeDescription
itemItemModelMasterItem 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("namespace1"),
        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.Item
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\CreateItemModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createItemModelMaster(
        (new CreateItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.CreateItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateItemModelMasterResult> asyncResult = null;
yield return client.CreateItemModelMaster(
    new Gs2.Gs2Inventory.Request.CreateItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    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['message'])
end

result = api_result.result
item = result.item;

getItemModelMaster

Get item model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
itemNamestring~ 128 charsItem Model Name

Result

TypeDescription
itemItemModelMasterItem 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("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getItemModelMaster(
        (new GetItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    ItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemModelMasterResult> asyncResult = null;
yield return client.GetItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

updateItemModelMaster

Update Item Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
itemNamestring~ 128 charsItem Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
stackingLimitlong1 ~ 9223372036854775805Maximum stackable quantity
allowMultipleStacksboolAllow items to be stored in multiple slots when the maximum stackable quantity is exceeded
sortValueint~ 2147483646Display order

Result

TypeDescription
itemItemModelMasterUpdated 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.UpdateItemModelMaster(
    &inventory.UpdateItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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.Item
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\UpdateItemModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateItemModelMaster(
        (new UpdateItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateItemModelMasterResult> asyncResult = null;
yield return client.UpdateItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    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['message'])
end

result = api_result.result
item = result.item;

deleteItemModelMaster

Delete Item Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
itemNamestring~ 128 charsItem Model Name

Result

TypeDescription
itemItemModelMasterDeleted 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.DeleteItemModelMaster(
    &inventory.DeleteItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteItemModelMaster(
        (new DeleteItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    ItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.DeleteItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteItemModelMasterResult> asyncResult = null;
yield return client.DeleteItemModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

describeItemModels

Get list of item models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name

Result

TypeDescription
itemsList<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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeItemModels(
        (new DescribeItemModelsRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    List<ItemModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeItemModelsRequest;
using Gs2.Gs2Inventory.Result.DescribeItemModelsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemModelsResult> asyncResult = null;
yield return client.DescribeItemModels(
    new Gs2.Gs2Inventory.Request.DescribeItemModelsRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .with_inventory_name('item')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.describe_item_models({
    namespaceName='namespace1',
    inventoryName='item',
})

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

result = api_result.result
items = result.items;

getItemModel

Get item model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
itemNamestring~ 128 charsItem Model Name

Result

TypeDescription
itemItemModel

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("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getItemModel(
        (new GetItemModelRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    ItemModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetItemModelRequest;
using Gs2.Gs2Inventory.Result.GetItemModelResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemModelResult> asyncResult = null;
yield return client.GetItemModel(
    new Gs2.Gs2Inventory.Request.GetItemModelRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

describeSimpleInventoryModelMasters

Get list of inventory model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<SimpleInventoryModelMaster>List of Simple Inventory Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSimpleInventoryModelMasters(
        (new DescribeSimpleInventoryModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SimpleInventoryModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelMastersRequest;
using Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeSimpleInventoryModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelMastersRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    pageToken=nil,
    limit=nil,
})

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

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

createSimpleInventoryModelMaster

Create a new inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsSimple Inventory Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemSimpleInventoryModelMasterInventory 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("namespace1"),
        Name: pointy.String("item"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSimpleInventoryModelMaster(
        (new CreateSimpleInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
    );
    SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateSimpleInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.CreateSimpleInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.CreateSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.CreateSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    name='item',
    description=nil,
    metadata=nil,
})

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

result = api_result.result
item = result.item;

getSimpleInventoryModelMaster

Get inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name

Result

TypeDescription
itemSimpleInventoryModelMasterSimple 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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleInventoryModelMaster(
        (new GetSimpleInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetSimpleInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.GetSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.GetSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

updateSimpleInventoryModelMaster

Update inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemSimpleInventoryModelMasterUpdated 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.UpdateSimpleInventoryModelMaster(
    &inventory.UpdateSimpleInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSimpleInventoryModelMaster(
        (new UpdateSimpleInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
    );
    SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateSimpleInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateSimpleInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    description='description1',
    metadata='ITEM_INVENTORY_MASTER',
})

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

result = api_result.result
item = result.item;

deleteSimpleInventoryModelMaster

Delete inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name

Result

TypeDescription
itemSimpleInventoryModelMasterDeleted 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.DeleteSimpleInventoryModelMaster(
    &inventory.DeleteSimpleInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSimpleInventoryModelMaster(
        (new DeleteSimpleInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    SimpleInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteSimpleInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.DeleteSimpleInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteSimpleInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteSimpleInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

describeSimpleInventoryModels

Get list of inventory models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemsList<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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSimpleInventoryModels(
        (new DescribeSimpleInventoryModelsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    List<SimpleInventoryModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelsRequest;
using Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleInventoryModelsResult> asyncResult = null;
yield return client.DescribeSimpleInventoryModels(
    new Gs2.Gs2Inventory.Request.DescribeSimpleInventoryModelsRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.describe_simple_inventory_models({
    namespaceName='namespace1',
})

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

result = api_result.result
items = result.items;

getSimpleInventoryModel

Get Simple Inventory Model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name

Result

TypeDescription
itemSimpleInventoryModelSimple 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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleInventoryModel(
        (new GetSimpleInventoryModelRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    SimpleInventoryModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleInventoryModelRequest;
using Gs2.Gs2Inventory.Result.GetSimpleInventoryModelResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleInventoryModelResult> asyncResult = null;
yield return client.GetSimpleInventoryModel(
    new Gs2.Gs2Inventory.Request.GetSimpleInventoryModelRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

describeSimpleItemModelMasters

Get list of item model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<SimpleItemModelMaster>List of Simple Item Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("item"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSimpleItemModelMasters(
        (new DescribeSimpleItemModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->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.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("namespace1")
            .withInventoryName("item")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SimpleItemModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeSimpleItemModelMastersRequest;
using Gs2.Gs2Inventory.Result.DescribeSimpleItemModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemModelMastersResult> asyncResult = null;
yield return client.DescribeSimpleItemModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemModelMastersRequest()
        .WithNamespaceName("namespace1")
        .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.describeSimpleItemModelMasters(
        new Gs2Inventory.DescribeSimpleItemModelMastersRequest()
            .withNamespaceName("namespace1")
            .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_simple_item_model_masters(
        inventory.DescribeSimpleItemModelMastersRequest()
            .with_namespace_name(self.hash1)
            .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_simple_item_model_masters({
    namespaceName='namespace1',
    inventoryName='item',
    pageToken=nil,
    limit=nil,
})

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

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

createSimpleItemModelMaster

Create a new item model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
namestring~ 128 charsSimple Item Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemSimpleItemModelMasterItem 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("namespace1"),
        InventoryName: pointy.String("item"),
        Name: pointy.String("item-master-0001"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSimpleItemModelMaster(
        (new CreateSimpleItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    SimpleItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateSimpleItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.CreateSimpleItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateSimpleItemModelMasterResult> asyncResult = null;
yield return client.CreateSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.CreateSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    name='item-master-0001',
    description=nil,
    metadata=nil,
})

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

result = api_result.result
item = result.item;

getSimpleItemModelMaster

Get item model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
itemNamestring~ 128 charsSimple Item Model Name

Result

TypeDescription
itemSimpleItemModelMasterSimple 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("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleItemModelMaster(
        (new GetSimpleItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    SimpleItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetSimpleItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemModelMasterResult> asyncResult = null;
yield return client.GetSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

updateSimpleItemModelMaster

Update Simple Item Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
itemNamestring~ 128 charsSimple Item Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemSimpleItemModelMasterUpdated 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.UpdateSimpleItemModelMaster(
    &inventory.UpdateSimpleItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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.Item
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\UpdateSimpleItemModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSimpleItemModelMaster(
        (new UpdateSimpleItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateSimpleItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateSimpleItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateSimpleItemModelMasterResult> asyncResult = null;
yield return client.UpdateSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    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['message'])
end

result = api_result.result
item = result.item;

deleteSimpleItemModelMaster

Delete Simple Item Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
itemNamestring~ 128 charsSimple Item Model Name

Result

TypeDescription
itemSimpleItemModelMasterDeleted 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.DeleteSimpleItemModelMaster(
    &inventory.DeleteSimpleItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSimpleItemModelMaster(
        (new DeleteSimpleItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    SimpleItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteSimpleItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.DeleteSimpleItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleItemModelMasterResult> asyncResult = null;
yield return client.DeleteSimpleItemModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteSimpleItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

describeSimpleItemModels

Get list of item models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name

Result

TypeDescription
itemsList<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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSimpleItemModels(
        (new DescribeSimpleItemModelsRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    List<SimpleItemModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeSimpleItemModelsRequest;
using Gs2.Gs2Inventory.Result.DescribeSimpleItemModelsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemModelsResult> asyncResult = null;
yield return client.DescribeSimpleItemModels(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemModelsRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
items = result.items;

getSimpleItemModel

Get item model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
itemNamestring~ 128 charsSimple Item Model Name

Result

TypeDescription
itemSimpleItemModel

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("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleItemModel(
        (new GetSimpleItemModelRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    SimpleItemModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleItemModelRequest;
using Gs2.Gs2Inventory.Result.GetSimpleItemModelResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemModelResult> asyncResult = null;
yield return client.GetSimpleItemModel(
    new Gs2.Gs2Inventory.Request.GetSimpleItemModelRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

describeBigInventoryModelMasters

Get list of inventory model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<BigInventoryModelMaster>List of Big Inventory Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeBigInventoryModelMasters(
        (new DescribeBigInventoryModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<BigInventoryModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeBigInventoryModelMastersRequest;
using Gs2.Gs2Inventory.Result.DescribeBigInventoryModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeBigInventoryModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeBigInventoryModelMastersRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    pageToken=nil,
    limit=nil,
})

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

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

createBigInventoryModelMaster

Create a new inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsBig Inventory Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemBigInventoryModelMasterInventory 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.CreateBigInventoryModelMaster(
    &inventory.CreateBigInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("item"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createBigInventoryModelMaster(
        (new CreateBigInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
    );
    BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateBigInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.CreateBigInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateBigInventoryModelMasterResult> asyncResult = null;
yield return client.CreateBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.CreateBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    name='item',
    description=nil,
    metadata=nil,
})

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

result = api_result.result
item = result.item;

getBigInventoryModelMaster

Get inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name

Result

TypeDescription
itemBigInventoryModelMasterBig 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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBigInventoryModelMaster(
        (new GetBigInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetBigInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetBigInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigInventoryModelMasterResult> asyncResult = null;
yield return client.GetBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.GetBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

updateBigInventoryModelMaster

Update inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemBigInventoryModelMasterUpdated 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.UpdateBigInventoryModelMaster(
    &inventory.UpdateBigInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateBigInventoryModelMaster(
        (new UpdateBigInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
    );
    BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateBigInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateBigInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateBigInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    description='description1',
    metadata='ITEM_INVENTORY_MASTER',
})

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

result = api_result.result
item = result.item;

deleteBigInventoryModelMaster

Delete inventory model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name

Result

TypeDescription
itemBigInventoryModelMasterDeleted 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.DeleteBigInventoryModelMaster(
    &inventory.DeleteBigInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteBigInventoryModelMaster(
        (new DeleteBigInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    BigInventoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteBigInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.DeleteBigInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteBigInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteBigInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

describeBigInventoryModels

Get list of inventory models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemsList<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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeBigInventoryModels(
        (new DescribeBigInventoryModelsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    List<BigInventoryModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeBigInventoryModelsRequest;
using Gs2.Gs2Inventory.Result.DescribeBigInventoryModelsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigInventoryModelsResult> asyncResult = null;
yield return client.DescribeBigInventoryModels(
    new Gs2.Gs2Inventory.Request.DescribeBigInventoryModelsRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.describe_big_inventory_models({
    namespaceName='namespace1',
})

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

result = api_result.result
items = result.items;

getBigInventoryModel

Get Big Inventory Model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name

Result

TypeDescription
itemBigInventoryModelBig 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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBigInventoryModel(
        (new GetBigInventoryModelRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    BigInventoryModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetBigInventoryModelRequest;
using Gs2.Gs2Inventory.Result.GetBigInventoryModelResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigInventoryModelResult> asyncResult = null;
yield return client.GetBigInventoryModel(
    new Gs2.Gs2Inventory.Request.GetBigInventoryModelRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
item = result.item;

describeBigItemModelMasters

Get list of item model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<BigItemModelMaster>List of Big Item Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("item"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeBigItemModelMasters(
        (new DescribeBigItemModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->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.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("namespace1")
            .withInventoryName("item")
            .withPageToken(null)
            .withLimit(null)
    );
    List<BigItemModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeBigItemModelMastersRequest;
using Gs2.Gs2Inventory.Result.DescribeBigItemModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemModelMastersResult> asyncResult = null;
yield return client.DescribeBigItemModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeBigItemModelMastersRequest()
        .WithNamespaceName("namespace1")
        .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.describeBigItemModelMasters(
        new Gs2Inventory.DescribeBigItemModelMastersRequest()
            .withNamespaceName("namespace1")
            .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_big_item_model_masters(
        inventory.DescribeBigItemModelMastersRequest()
            .with_namespace_name(self.hash1)
            .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_big_item_model_masters({
    namespaceName='namespace1',
    inventoryName='item',
    pageToken=nil,
    limit=nil,
})

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

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

createBigItemModelMaster

Create a new item model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
namestring~ 128 charsBig Item Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemBigItemModelMasterItem 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("namespace1"),
        InventoryName: pointy.String("item"),
        Name: pointy.String("item-master-0001"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createBigItemModelMaster(
        (new CreateBigItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withName("item-master-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    BigItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateBigItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.CreateBigItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateBigItemModelMasterResult> asyncResult = null;
yield return client.CreateBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.CreateBigItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    name='item-master-0001',
    description=nil,
    metadata=nil,
})

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

result = api_result.result
item = result.item;

getBigItemModelMaster

Get item model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
itemNamestring~ 128 charsBig Item Model Name

Result

TypeDescription
itemBigItemModelMasterBig 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("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBigItemModelMaster(
        (new GetBigItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    BigItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetBigItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetBigItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemModelMasterResult> asyncResult = null;
yield return client.GetBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetBigItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

updateBigItemModelMaster

Update Big Item Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
itemNamestring~ 128 charsBig Item Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata

Result

TypeDescription
itemBigItemModelMasterUpdated 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.UpdateBigItemModelMaster(
    &inventory.UpdateBigItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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.Item
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\UpdateBigItemModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateBigItemModelMaster(
        (new UpdateBigItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateBigItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateBigItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateBigItemModelMasterResult> asyncResult = null;
yield return client.UpdateBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateBigItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    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['message'])
end

result = api_result.result
item = result.item;

deleteBigItemModelMaster

Delete Big Item Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
itemNamestring~ 128 charsBig Item Model Name

Result

TypeDescription
itemBigItemModelMasterDeleted 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.DeleteBigItemModelMaster(
    &inventory.DeleteBigItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteBigItemModelMaster(
        (new DeleteBigItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    BigItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteBigItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.DeleteBigItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigItemModelMasterResult> asyncResult = null;
yield return client.DeleteBigItemModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteBigItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

describeBigItemModels

Get list of item models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name

Result

TypeDescription
itemsList<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("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeBigItemModels(
        (new DescribeBigItemModelsRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
    );
    List<BigItemModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeBigItemModelsRequest;
using Gs2.Gs2Inventory.Result.DescribeBigItemModelsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemModelsResult> asyncResult = null;
yield return client.DescribeBigItemModels(
    new Gs2.Gs2Inventory.Request.DescribeBigItemModelsRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
})

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

result = api_result.result
items = result.items;

getBigItemModel

Get item model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
itemNamestring~ 128 charsBig Item Model Name

Result

TypeDescription
itemBigItemModel

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("namespace1"),
        InventoryName: pointy.String("item"),
        ItemName: pointy.String("item-master-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBigItemModel(
        (new GetBigItemModelRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withInventoryName("item")
            .withItemName("item-master-0001")
    );
    BigItemModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetBigItemModelRequest;
using Gs2.Gs2Inventory.Result.GetBigItemModelResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemModelResult> asyncResult = null;
yield return client.GetBigItemModel(
    new Gs2.Gs2Inventory.Request.GetBigItemModelRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    inventoryName='item',
    itemName='item-master-0001',
})

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

result = api_result.result
item = result.item;

exportMaster

Export master data for the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemCurrentItemModelMasterCurrently available possession 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.ExportMaster(
    &inventory.ExportMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ExportMasterRequest;
using Gs2.Gs2Inventory.Result.ExportMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Inventory.Request.ExportMasterRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.export_master({
    namespaceName='namespace1',
})

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

result = api_result.result
item = result.item;

getCurrentItemModelMaster

Retrieve the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemCurrentItemModelMasterCurrently available possession 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.GetCurrentItemModelMaster(
    &inventory.GetCurrentItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentItemModelMaster(
        (new GetCurrentItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetCurrentItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetCurrentItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetCurrentItemModelMasterResult> asyncResult = null;
yield return client.GetCurrentItemModelMaster(
    new Gs2.Gs2Inventory.Request.GetCurrentItemModelMasterRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.get_current_item_model_master({
    namespaceName='namespace1',
})

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

result = api_result.result
item = result.item;

updateCurrentItemModelMaster

Update the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
settingsstring~ 5242880 charsMaster data

Result

TypeDescription
itemCurrentItemModelMasterUpdated and currently available possession 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.UpdateCurrentItemModelMaster(
    &inventory.UpdateCurrentItemModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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\"}]}]}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentItemModelMaster(
        (new UpdateCurrentItemModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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\"}]}]}")
    );
    $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("namespace1")
            .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\"}]}]}")
    );
    CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentItemModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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\"}]}]}"),
    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("namespace1")
            .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\"}]}]}")
    );
    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(self.hash1)
            .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"}]}]}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.update_current_item_model_master({
    namespaceName='namespace1',
    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"}]}]}',
})

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

result = api_result.result
item = result.item;

updateCurrentItemModelMasterFromGitHub

Update the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
checkoutSettingGitHubCheckoutSettingSetup to check out master data from GitHub

Result

TypeDescription
itemCurrentItemModelMasterUpdated and currently available possession 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.UpdateCurrentItemModelMasterFromGitHub(
    &inventory.UpdateCurrentItemModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: {'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentItemModelMasterFromGitHub(
        (new UpdateCurrentItemModelMasterFromGitHubRequest())
            ->withNamespaceName(self::namespace1)
            ->withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': '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("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentItemModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterFromGitHubRequest;
using Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterFromGitHubResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateCurrentItemModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentItemModelMasterFromGitHub(
    new Gs2.Gs2Inventory.Request.UpdateCurrentItemModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': '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("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': '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(self.hash1)
            .with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': '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='namespace1',
    checkoutSetting={'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
})

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

result = api_result.result
item = result.item;

describeInventories

Get list of inventories

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Inventory>List of Inventories
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeInventories(
        (new DescribeInventoriesRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Inventory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeInventoriesRequest;
using Gs2.Gs2Inventory.Result.DescribeInventoriesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoriesResult> asyncResult = null;
yield return client.DescribeInventories(
    new Gs2.Gs2Inventory.Request.DescribeInventoriesRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_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("namespace1")
            .withAccessToken("$access_token_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(self.hash1)
            .with_access_token(self.access_token_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='namespace1',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

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

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

describeInventoriesByUserId

Get list of inventories by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Inventory>List of Inventories
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeInventoriesByUserId(
        (new DescribeInventoriesByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-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.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("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Inventory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeInventoriesByUserIdRequest;
using Gs2.Gs2Inventory.Result.DescribeInventoriesByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoriesByUserIdResult> asyncResult = null;
yield return client.DescribeInventoriesByUserId(
    new Gs2.Gs2Inventory.Request.DescribeInventoriesByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-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.describeInventoriesByUserId(
        new Gs2Inventory.DescribeInventoriesByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-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_by_user_id(
        inventory.DescribeInventoriesByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
})

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

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

getInventory

Get Inventory

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getInventory(
        (new GetInventoryRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
    );
    Inventory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetInventoryRequest;
using Gs2.Gs2Inventory.Result.GetInventoryResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryResult> asyncResult = null;
yield return client.GetInventory(
    new Gs2.Gs2Inventory.Request.GetInventoryRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.get_inventory({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_0001',
})

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

result = api_result.result
item = result.item;

getInventoryByUserId

Get inventory by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id

Result

TypeDescription
itemInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getInventoryByUserId(
        (new GetInventoryByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
    );
    Inventory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetInventoryByUserIdRequest;
using Gs2.Gs2Inventory.Result.GetInventoryByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryByUserIdResult> asyncResult = null;
yield return client.GetInventoryByUserId(
    new Gs2.Gs2Inventory.Request.GetInventoryByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.getInventoryByUserId(
        new Gs2Inventory.GetInventoryByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.GetInventoryByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.get_inventory_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
})

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

result = api_result.result
item = result.item;

addCapacityByUserId

Add capacity size

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
addCapacityValueint1 ~ 2147483646Capacity size to be added

Result

TypeDescription
itemInventoryInventory 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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        AddCapacityValue: pointy.Int32(1),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addCapacityByUserId(
        (new AddCapacityByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withAddCapacityValue(1)
    );
    $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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withAddCapacityValue(1)
    );
    Inventory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AddCapacityByUserIdRequest;
using Gs2.Gs2Inventory.Result.AddCapacityByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AddCapacityByUserIdResult> asyncResult = null;
yield return client.AddCapacityByUserId(
    new Gs2.Gs2Inventory.Request.AddCapacityByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithAddCapacityValue(1),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withAddCapacityValue(1)
    );
    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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_add_capacity_value(1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.add_capacity_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    addCapacityValue=1,
})

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

result = api_result.result
item = result.item;

setCapacityByUserId

Set capacity size

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
newCapacityValueint1 ~ 2147483646New maximum capacity for inventory

Result

TypeDescription
itemInventoryInventory after update
oldInventoryInventory 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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        NewCapacityValue: pointy.Int32(10),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setCapacityByUserId(
        (new SetCapacityByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withNewCapacityValue(10)
    );
    $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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withNewCapacityValue(10)
    );
    Inventory item = result.getItem();
    Inventory old = result.getOld();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.SetCapacityByUserIdRequest;
using Gs2.Gs2Inventory.Result.SetCapacityByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.SetCapacityByUserIdResult> asyncResult = null;
yield return client.SetCapacityByUserId(
    new Gs2.Gs2Inventory.Request.SetCapacityByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithNewCapacityValue(10),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withNewCapacityValue(10)
    );
    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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_new_capacity_value(10)
    )
    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='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    newCapacityValue=10,
})

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

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

deleteInventoryByUserId

Delete inventory

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id

Result

TypeDescription
itemInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteInventoryByUserId(
        (new DeleteInventoryByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
    );
    Inventory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteInventoryByUserIdRequest;
using Gs2.Gs2Inventory.Result.DeleteInventoryByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteInventoryByUserIdResult> asyncResult = null;
yield return client.DeleteInventoryByUserId(
    new Gs2.Gs2Inventory.Request.DeleteInventoryByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.deleteInventoryByUserId(
        new Gs2Inventory.DeleteInventoryByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_inventory_by_user_id(
        inventory.DeleteInventoryByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.delete_inventory_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
})

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

result = api_result.result
item = result.item;

verifyInventoryCurrentMaxCapacity

Verify current max inventory capacity

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
inventoryNamestring~ 128 charsInventory Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
currentInventoryMaxCapacityint1 ~ 2147483646Maximum capacity

Result

TypeDescription

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("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        InventoryName: pointy.String("inventory-0001"),
        VerifyType: pointy.String("less"),
        CurrentInventoryMaxCapacity: pointy.Int32(10),
    }
)
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\VerifyInventoryCurrentMaxCapacityRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyInventoryCurrentMaxCapacity(
        (new VerifyInventoryCurrentMaxCapacityRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withInventoryName("inventory-0001")
            ->withVerifyType("less")
            ->withCurrentInventoryMaxCapacity(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityRequest;
using Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityResult> asyncResult = null;
yield return client.VerifyInventoryCurrentMaxCapacity(
    new Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithInventoryName("inventory-0001")
        .WithVerifyType("less")
        .WithCurrentInventoryMaxCapacity(10),
    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.verifyInventoryCurrentMaxCapacity(
        new Gs2Inventory.VerifyInventoryCurrentMaxCapacityRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
    );
} 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(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_inventory_name('inventory-0001')
            .with_verify_type('less')
            .with_current_inventory_max_capacity(10)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_inventory_current_max_capacity({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    inventoryName='inventory-0001',
    verifyType='less',
    currentInventoryMaxCapacity=10,
})

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

result = api_result.result

verifyInventoryCurrentMaxCapacityByUserId

Verify current max inventory capacity by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
inventoryNamestring~ 128 charsInventory Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
currentInventoryMaxCapacityint1 ~ 2147483646Maximum capacity

Result

TypeDescription

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("namespace1"),
        UserId: pointy.String("user-0001"),
        InventoryName: pointy.String("inventory-0001"),
        VerifyType: pointy.String("less"),
        CurrentInventoryMaxCapacity: pointy.Int32(10),
    }
)
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\VerifyInventoryCurrentMaxCapacityByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyInventoryCurrentMaxCapacityByUserId(
        (new VerifyInventoryCurrentMaxCapacityByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withVerifyType("less")
            ->withCurrentInventoryMaxCapacity(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityByUserIdRequest;
using Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityByUserIdResult> asyncResult = null;
yield return client.VerifyInventoryCurrentMaxCapacityByUserId(
    new Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithVerifyType("less")
        .WithCurrentInventoryMaxCapacity(10),
    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.verifyInventoryCurrentMaxCapacityByUserId(
        new Gs2Inventory.VerifyInventoryCurrentMaxCapacityByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withVerifyType("less")
            .withCurrentInventoryMaxCapacity(10)
    );
} 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(self.hash1)
            .with_user_id('user-0001')
            .with_inventory_name('inventory-0001')
            .with_verify_type('less')
            .with_current_inventory_max_capacity(10)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_inventory_current_max_capacity_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    inventoryName='inventory-0001',
    verifyType='less',
    currentInventoryMaxCapacity=10,
})

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

result = api_result.result

verifyInventoryCurrentMaxCapacityByStampTask

Use stamp task to verify item current max inventory capacity

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
newContextStackstringRequest of context in which stamp task execution results are recorded

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.VerifyInventoryCurrentMaxCapacityByStampTask(
    &inventory.VerifyInventoryCurrentMaxCapacityByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyInventoryCurrentMaxCapacityByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyInventoryCurrentMaxCapacityByStampTask(
        (new VerifyInventoryCurrentMaxCapacityByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyInventoryCurrentMaxCapacityByStampTaskRequest;
import io.gs2.inventory.result.VerifyInventoryCurrentMaxCapacityByStampTaskResult;

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

try {
    VerifyInventoryCurrentMaxCapacityByStampTaskResult result = client.verifyInventoryCurrentMaxCapacityByStampTask(
        new VerifyInventoryCurrentMaxCapacityByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityByStampTaskRequest;
using Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyInventoryCurrentMaxCapacityByStampTaskResult> asyncResult = null;
yield return client.VerifyInventoryCurrentMaxCapacityByStampTask(
    new Gs2.Gs2Inventory.Request.VerifyInventoryCurrentMaxCapacityByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifyInventoryCurrentMaxCapacityByStampTask(
        new Gs2Inventory.VerifyInventoryCurrentMaxCapacityByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.VerifyInventoryCurrentMaxCapacityByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_inventory_current_max_capacity_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
newContextStack = result.newContextStack;

addCapacityByStampSheet

Use stamp sheets to add capacity size

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemInventoryInventory 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.AddCapacityByStampSheet(
    &inventory.AddCapacityByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AddCapacityByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addCapacityByStampSheet(
        (new AddCapacityByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.AddCapacityByStampSheetRequest;
import io.gs2.inventory.result.AddCapacityByStampSheetResult;

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

try {
    AddCapacityByStampSheetResult result = client.addCapacityByStampSheet(
        new AddCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    Inventory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AddCapacityByStampSheetRequest;
using Gs2.Gs2Inventory.Result.AddCapacityByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AddCapacityByStampSheetResult> asyncResult = null;
yield return client.AddCapacityByStampSheet(
    new Gs2.Gs2Inventory.Request.AddCapacityByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    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.addCapacityByStampSheet(
        new Gs2Inventory.AddCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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_stamp_sheet(
        inventory.AddCapacityByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.add_capacity_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;

setCapacityByStampSheet

Use stamp sheet to set capacity size

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemInventoryInventory 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.SetCapacityByStampSheet(
    &inventory.SetCapacityByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\SetCapacityByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setCapacityByStampSheet(
        (new SetCapacityByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.SetCapacityByStampSheetRequest;
import io.gs2.inventory.result.SetCapacityByStampSheetResult;

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

try {
    SetCapacityByStampSheetResult result = client.setCapacityByStampSheet(
        new SetCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    Inventory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.SetCapacityByStampSheetRequest;
using Gs2.Gs2Inventory.Result.SetCapacityByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.SetCapacityByStampSheetResult> asyncResult = null;
yield return client.SetCapacityByStampSheet(
    new Gs2.Gs2Inventory.Request.SetCapacityByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    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.setCapacityByStampSheet(
        new Gs2Inventory.SetCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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_capacity_by_stamp_sheet(
        inventory.SetCapacityByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.set_capacity_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;

describeItemSets

Obtain list of item possession quantities by expiration date

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per expiration date
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeItemSets(
        (new DescribeItemSetsRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ItemSet> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeItemSetsRequest;
using Gs2.Gs2Inventory.Result.DescribeItemSetsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemSetsResult> asyncResult = null;
yield return client.DescribeItemSets(
    new Gs2.Gs2Inventory.Request.DescribeItemSetsRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('item')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='item',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

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

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

describeItemSetsByUserId

Obtain list of item possession quantities by expiration date, specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per expiration date
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeItemSetsByUserId(
        (new DescribeItemSetsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ItemSet> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeItemSetsByUserIdRequest;
using Gs2.Gs2Inventory.Result.DescribeItemSetsByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeItemSetsByUserIdResult> asyncResult = null;
yield return client.DescribeItemSetsByUserId(
    new Gs2.Gs2Inventory.Request.DescribeItemSetsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.describeItemSetsByUserId(
        new Gs2Inventory.DescribeItemSetsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.DescribeItemSetsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
})

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

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

getItemSet

Get the quantity of items held by expiration date

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestring~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryinventory

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("namespace1"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("$access_token_0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("$itemSet1.name"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
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\GetItemSetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getItemSet(
        (new GetItemSetRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withAccessToken(self::$accessToken0001)
            ->withItemName("item-0001")
            ->withItemSetName(self::$itemSet1.name)
    );
    $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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName("$itemSet1.name")
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetItemSetRequest;
using Gs2.Gs2Inventory.Result.GetItemSetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemSetResult> asyncResult = null;
yield return client.GetItemSet(
    new Gs2.Gs2Inventory.Request.GetItemSetRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithAccessToken("$access_token_0001")
        .WithItemName("item-0001")
        .WithItemSetName("$itemSet1.name"),
    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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName("$itemSet1.name")
    );
    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(self.hash1)
            .with_inventory_name('item')
            .with_access_token(self.access_token_0001)
            .with_item_name('item-0001')
            .with_item_set_name(self.item_set1.name)
    )
    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='namespace1',
    inventoryName='item',
    accessToken='$access_token_0001',
    itemName='item-0001',
    itemSetName='$itemSet1.name',
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

getItemSetByUserId

Obtain the quantity of items held by expiration date by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestring~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryinventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
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\GetItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getItemSetByUserId(
        (new GetItemSetByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetItemSetByUserIdRequest;
using Gs2.Gs2Inventory.Result.GetItemSetByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemSetByUserIdResult> asyncResult = null;
yield return client.GetItemSetByUserId(
    new Gs2.Gs2Inventory.Request.GetItemSetByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .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.getItemSetByUserId(
        new Gs2Inventory.GetItemSetByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .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.get_item_set_by_user_id(
        inventory.GetItemSetByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .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.get_item_set_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
    itemSetName=nil,
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

getItemWithSignature

Get the quantity of items in your possession by expiration date along with your signature

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestring~ 36 charsName identifying the item set
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory
bodystringItem Set Information for Signature Subject
signaturestringSignature

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: nil,
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
body := result.Body
signature := result.Signature
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\GetItemWithSignatureRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getItemWithSignature(
        (new GetItemWithSignatureRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withItemName("item-0001")
            ->withItemSetName(null)
            ->withKeyId(self::$key1.keyId)
    );
    $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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("$key1.keyId")
    );
    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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetItemWithSignatureRequest;
using Gs2.Gs2Inventory.Result.GetItemWithSignatureResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemWithSignatureResult> asyncResult = null;
yield return client.GetItemWithSignature(
    new Gs2.Gs2Inventory.Request.GetItemWithSignatureRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_0001")
        .WithItemName("item-0001")
        .WithItemSetName(null)
        .WithKeyId("$key1.keyId"),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("$key1.keyId")
    );
    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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_0001)
            .with_item_name('item-0001')
            .with_item_set_name(None)
            .with_key_id(self.key1.key_id)
    )
    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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_0001',
    itemName='item-0001',
    itemSetName=nil,
    keyId='$key1.keyId',
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;

getItemWithSignatureByUserId

Obtain the quantity of items held by expiration date by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestring~ 36 charsName identifying the item set
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory
bodystringItem Set Information for Signature Subject
signaturestringSignature

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: nil,
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
body := result.Body
signature := result.Signature
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\GetItemWithSignatureByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getItemWithSignatureByUserId(
        (new GetItemWithSignatureByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName(null)
            ->withKeyId(self::$key1.keyId)
    );
    $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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("$key1.keyId")
    );
    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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetItemWithSignatureByUserIdRequest;
using Gs2.Gs2Inventory.Result.GetItemWithSignatureByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetItemWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetItemWithSignatureByUserId(
    new Gs2.Gs2Inventory.Request.GetItemWithSignatureByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName(null)
        .WithKeyId("$key1.keyId"),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName(null)
            .withKeyId("$key1.keyId")
    );
    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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name(None)
            .with_key_id(self.key1.key_id)
    )
    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='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
    itemSetName=nil,
    keyId='$key1.keyId',
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
body = result.body;
signature = result.signature;

acquireItemSetByUserId

Add items to inventory

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
itemNamestring~ 128 charsItem Model Name
userIdstring~ 128 charsUser Id
acquireCountlong1 ~ 9223372036854775805Quantity to be obtained
expiresAtlong0Effective date
createNewItemSetboolfalseEven if there is room in an existing ItemSet, you can create a new ItemSet
itemSetNamestring~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<ItemSet>List of item possession quantities by expiration date after addition
itemModelItemModelItem Model
inventoryInventoryInventory
overflowCountlongQuantity 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("namespace1"),
        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("$itemSet1.name"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
overflowCount := result.OverflowCount
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\AcquireItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->acquireItemSetByUserId(
        (new AcquireItemSetByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withItemName("item-0001")
            ->withUserId("user-0001")
            ->withAcquireCount(5)
            ->withExpiresAt(0)
            ->withCreateNewItemSet(null)
            ->withItemSetName(self::$itemSet1.name)
    );
    $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("namespace1")
            .withInventoryName("item")
            .withItemName("item-0001")
            .withUserId("user-0001")
            .withAcquireCount(5L)
            .withExpiresAt(0L)
            .withCreateNewItemSet(null)
            .withItemSetName("$itemSet1.name")
    );
    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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AcquireItemSetByUserIdRequest;
using Gs2.Gs2Inventory.Result.AcquireItemSetByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireItemSetByUserIdResult> asyncResult = null;
yield return client.AcquireItemSetByUserId(
    new Gs2.Gs2Inventory.Request.AcquireItemSetByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithItemName("item-0001")
        .WithUserId("user-0001")
        .WithAcquireCount(5L)
        .WithExpiresAt(0L)
        .WithCreateNewItemSet(null)
        .WithItemSetName("$itemSet1.name"),
    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("namespace1")
            .withInventoryName("item")
            .withItemName("item-0001")
            .withUserId("user-0001")
            .withAcquireCount(5)
            .withExpiresAt(0)
            .withCreateNewItemSet(null)
            .withItemSetName("$itemSet1.name")
    );
    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(self.hash1)
            .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(self.item_set1.name)
    )
    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='namespace1',
    inventoryName='item',
    itemName='item-0001',
    userId='user-0001',
    acquireCount=5,
    expiresAt=0,
    createNewItemSet=nil,
    itemSetName='$itemSet1.name',
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;

consumeItemSet

Consume inventory items

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
consumeCountlong1 ~ 9223372036854775805Amount to consume
itemSetNamestring~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<ItemSet>List of item possession quantities per post-consumption expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_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.Inventory
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\ConsumeItemSetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeItemSet(
        (new ConsumeItemSetRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeItemSetRequest;
using Gs2.Gs2Inventory.Result.ConsumeItemSetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeItemSetResult> asyncResult = null;
yield return client.ConsumeItemSet(
    new Gs2.Gs2Inventory.Request.ConsumeItemSetRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_0001',
    itemName='item-0001',
    consumeCount=1,
    itemSetName=nil,
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

consumeItemSetByUserId

Consume inventory items by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
consumeCountlong1 ~ 9223372036854775805Amount to consume
itemSetNamestring~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<ItemSet>List of item possession quantities per post-consumption expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-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.Inventory
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\ConsumeItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeItemSetByUserId(
        (new ConsumeItemSetByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeItemSetByUserIdRequest;
using Gs2.Gs2Inventory.Result.ConsumeItemSetByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeItemSetByUserIdResult> asyncResult = null;
yield return client.ConsumeItemSetByUserId(
    new Gs2.Gs2Inventory.Request.ConsumeItemSetByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.consumeItemSetByUserId(
        new Gs2Inventory.ConsumeItemSetByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.ConsumeItemSetByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
    consumeCount=1,
    itemSetName=nil,
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

deleteItemSetByUserId

Delete item possession quantities per expiration date

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestring~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<ItemSet>List of item possession quantities by expiration date deleted
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ItemSetName: pointy.String("$itemSet1.name"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
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\DeleteItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteItemSetByUserId(
        (new DeleteItemSetByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withItemSetName(self::$itemSet1.name)
    );
    $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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("$itemSet1.name")
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteItemSetByUserIdRequest;
using Gs2.Gs2Inventory.Result.DeleteItemSetByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteItemSetByUserIdResult> asyncResult = null;
yield return client.DeleteItemSetByUserId(
    new Gs2.Gs2Inventory.Request.DeleteItemSetByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithItemSetName("$itemSet1.name"),
    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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("$itemSet1.name")
    );
    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(self.hash1)
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_item_set_name(self.item_set1.name)
    )
    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='namespace1',
    inventoryName='item',
    userId='user-0001',
    itemName='item-0001',
    itemSetName='$itemSet1.name',
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;

verifyItemSet

Verify possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
inventoryNamestring~ 128 charsInventory Model Name
itemNamestring~ 128 charsItem Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
itemSetNamestring~ 36 charsName identifying the item set
countlong1 ~ 9223372036854775805Quantity in possession

Result

TypeDescription

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("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        ItemSetName: nil,
        Count: pointy.Int64(10),
    }
)
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\VerifyItemSetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyItemSet(
        (new VerifyItemSetRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withItemSetName(null)
            ->withCount(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10L)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyItemSetRequest;
using Gs2.Gs2Inventory.Result.VerifyItemSetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyItemSetResult> asyncResult = null;
yield return client.VerifyItemSet(
    new Gs2.Gs2Inventory.Request.VerifyItemSetRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithItemSetName(null)
        .WithCount(10L),
    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.verifyItemSet(
        new Gs2Inventory.VerifyItemSetRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10)
    );
} 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(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_item_set_name(None)
            .with_count(10)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_item_set({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    inventoryName='inventory-0001',
    itemName='item-0001',
    verifyType='less',
    itemSetName=nil,
    count=10,
})

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

result = api_result.result

verifyItemSetByUserId

Verify possession quantity by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
inventoryNamestring~ 128 charsInventory Model Name
itemNamestring~ 128 charsItem Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
itemSetNamestring~ 36 charsName identifying the item set
countlong1 ~ 9223372036854775805Quantity in possession

Result

TypeDescription

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("namespace1"),
        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),
    }
)
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\VerifyItemSetByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyItemSetByUserId(
        (new VerifyItemSetByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withItemSetName(null)
            ->withCount(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10L)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyItemSetByUserIdRequest;
using Gs2.Gs2Inventory.Result.VerifyItemSetByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyItemSetByUserIdResult> asyncResult = null;
yield return client.VerifyItemSetByUserId(
    new Gs2.Gs2Inventory.Request.VerifyItemSetByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithItemSetName(null)
        .WithCount(10L),
    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.verifyItemSetByUserId(
        new Gs2Inventory.VerifyItemSetByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withItemSetName(null)
            .withCount(10)
    );
} 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(self.hash1)
            .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)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_item_set_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    inventoryName='inventory-0001',
    itemName='item-0001',
    verifyType='less',
    itemSetName=nil,
    count=10,
})

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

result = api_result.result

acquireItemSetByStampSheet

Add items to inventory using stamp sheets

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per expiration date after addition
itemModelItemModelItem Model
inventoryInventoryInventory
overflowCountlongQuantity 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.AcquireItemSetByStampSheet(
    &inventory.AcquireItemSetByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
overflowCount := result.OverflowCount
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\AcquireItemSetByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->acquireItemSetByStampSheet(
        (new AcquireItemSetByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.AcquireItemSetByStampSheetRequest;
import io.gs2.inventory.result.AcquireItemSetByStampSheetResult;

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

try {
    AcquireItemSetByStampSheetResult result = client.acquireItemSetByStampSheet(
        new AcquireItemSetByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AcquireItemSetByStampSheetRequest;
using Gs2.Gs2Inventory.Result.AcquireItemSetByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireItemSetByStampSheetResult> asyncResult = null;
yield return client.AcquireItemSetByStampSheet(
    new Gs2.Gs2Inventory.Request.AcquireItemSetByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    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.acquireItemSetByStampSheet(
        new Gs2Inventory.AcquireItemSetByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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_stamp_sheet(
        inventory.AcquireItemSetByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
overflowCount = result.overflowCount;

consumeItemSetByStampTask

Consume inventory items using stamp sheets

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemsList<ItemSet>List of Quantity of items held per post-consumption expiration date
itemModelItemModelItem Model
inventoryInventoryInventory
newContextStackstringRequest of context in which stamp task execution results are recorded

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.ConsumeItemSetByStampTask(
    &inventory.ConsumeItemSetByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
itemModel := result.ItemModel
inventory := result.Inventory
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeItemSetByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeItemSetByStampTask(
        (new ConsumeItemSetByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $items = $result->getItems();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeItemSetByStampTaskRequest;
import io.gs2.inventory.result.ConsumeItemSetByStampTaskResult;

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

try {
    ConsumeItemSetByStampTaskResult result = client.consumeItemSetByStampTask(
        new ConsumeItemSetByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    List<ItemSet> items = result.getItems();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeItemSetByStampTaskRequest;
using Gs2.Gs2Inventory.Result.ConsumeItemSetByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeItemSetByStampTaskResult> asyncResult = null;
yield return client.ConsumeItemSetByStampTask(
    new Gs2.Gs2Inventory.Request.ConsumeItemSetByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    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 newContextStack = result.NewContextStack;
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.consumeItemSetByStampTask(
        new Gs2Inventory.ConsumeItemSetByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const items = result.getItems();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.ConsumeItemSetByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    items = result.items
    item_model = result.item_model
    inventory = result.inventory
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.consume_item_set_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
items = result.items;
itemModel = result.itemModel;
inventory = result.inventory;
newContextStack = result.newContextStack;

verifyItemSetByStampTask

Use stamp task to verify item possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
newContextStackstringRequest of context in which stamp task execution results are recorded

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.VerifyItemSetByStampTask(
    &inventory.VerifyItemSetByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyItemSetByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyItemSetByStampTask(
        (new VerifyItemSetByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyItemSetByStampTaskRequest;
import io.gs2.inventory.result.VerifyItemSetByStampTaskResult;

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

try {
    VerifyItemSetByStampTaskResult result = client.verifyItemSetByStampTask(
        new VerifyItemSetByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyItemSetByStampTaskRequest;
using Gs2.Gs2Inventory.Result.VerifyItemSetByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyItemSetByStampTaskResult> asyncResult = null;
yield return client.VerifyItemSetByStampTask(
    new Gs2.Gs2Inventory.Request.VerifyItemSetByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifyItemSetByStampTask(
        new Gs2Inventory.VerifyItemSetByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.VerifyItemSetByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_item_set_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
newContextStack = result.newContextStack;

describeReferenceOf

Get list of references

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_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.Inventory
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\DescribeReferenceOfRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeReferenceOf(
        (new DescribeReferenceOfRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeReferenceOfRequest;
using Gs2.Gs2Inventory.Result.DescribeReferenceOfResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeReferenceOfResult> asyncResult = null;
yield return client.DescribeReferenceOf(
    new Gs2.Gs2Inventory.Request.DescribeReferenceOfRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_0001',
    itemName='item-0001',
    itemSetName='item-set-0001',
})

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

result = api_result.result
items = result.items;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

describeReferenceOfByUserId

Obtain list of references by specifying a user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set

Result

TypeDescription
itemsList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-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.Inventory
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\DescribeReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeReferenceOfByUserId(
        (new DescribeReferenceOfByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeReferenceOfByUserIdRequest;
using Gs2.Gs2Inventory.Result.DescribeReferenceOfByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeReferenceOfByUserIdResult> asyncResult = null;
yield return client.DescribeReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.DescribeReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.describeReferenceOfByUserId(
        new Gs2Inventory.DescribeReferenceOfByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.DescribeReferenceOfByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
    itemSetName='item-set-0001',
})

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

result = api_result.result
items = result.items;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

getReferenceOf

Obtain a Reference

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_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.Inventory
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\GetReferenceOfRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getReferenceOf(
        (new GetReferenceOfRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetReferenceOfRequest;
using Gs2.Gs2Inventory.Result.GetReferenceOfResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetReferenceOfResult> asyncResult = null;
yield return client.GetReferenceOf(
    new Gs2.Gs2Inventory.Request.GetReferenceOfRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_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['message'])
end

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

getReferenceOfByUserId

Obtain a reference by specifying a user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-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.Inventory
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\GetReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getReferenceOfByUserId(
        (new GetReferenceOfByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetReferenceOfByUserIdRequest;
using Gs2.Gs2Inventory.Result.GetReferenceOfByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetReferenceOfByUserIdResult> asyncResult = null;
yield return client.GetReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.GetReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.getReferenceOfByUserId(
        new Gs2Inventory.GetReferenceOfByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.GetReferenceOfByUserIdRequest()
            .with_namespace_name(self.hash1)
            .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'])
    )
    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='namespace1',
    inventoryName='inventory-0001',
    userId='user-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['message'])
end

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

verifyReferenceOf

Verification of references

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession
verifyTypeenum [’not_entry’, ‘already_entry’, ’empty’, ’not_empty’]~ 128 charsType of verification

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_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.Inventory
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\VerifyReferenceOfRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyReferenceOf(
        (new VerifyReferenceOfRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withVerifyType("not_entry")
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyReferenceOfRequest;
using Gs2.Gs2Inventory.Result.VerifyReferenceOfResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyReferenceOfResult> asyncResult = null;
yield return client.VerifyReferenceOf(
    new Gs2.Gs2Inventory.Request.VerifyReferenceOfRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_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['message'])
end

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

verifyReferenceOfByUserId

Verification regarding the reference source by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession
verifyTypeenum [’not_entry’, ‘already_entry’, ’empty’, ’not_empty’]~ 128 charsType of verification

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        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"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory
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\VerifyReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyReferenceOfByUserId(
        (new VerifyReferenceOfByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
            .withVerifyType("not_entry")
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyReferenceOfByUserIdRequest;
using Gs2.Gs2Inventory.Result.VerifyReferenceOfByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyReferenceOfByUserIdResult> asyncResult = null;
yield return client.VerifyReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.VerifyReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.verifyReferenceOfByUserId(
        new Gs2Inventory.VerifyReferenceOfByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.VerifyReferenceOfByUserIdRequest()
            .with_namespace_name(self.hash1)
            .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')
    )
    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='namespace1',
    inventoryName='inventory-0001',
    userId='user-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['message'])
end

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

addReferenceOf

Add a reference

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held by expiration date after addition of reference source
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_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.Inventory
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\AddReferenceOfRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addReferenceOf(
        (new AddReferenceOfRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AddReferenceOfRequest;
using Gs2.Gs2Inventory.Result.AddReferenceOfResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AddReferenceOfResult> asyncResult = null;
yield return client.AddReferenceOf(
    new Gs2.Gs2Inventory.Request.AddReferenceOfRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_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['message'])
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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held by expiration date after addition of reference source
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-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.Inventory
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\AddReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addReferenceOfByUserId(
        (new AddReferenceOfByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf(['resource-0001'])
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AddReferenceOfByUserIdRequest;
using Gs2.Gs2Inventory.Result.AddReferenceOfByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AddReferenceOfByUserIdResult> asyncResult = null;
yield return client.AddReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.AddReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.addReferenceOfByUserId(
        new Gs2Inventory.AddReferenceOfByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.AddReferenceOfByUserIdRequest()
            .with_namespace_name(self.hash1)
            .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'])
    )
    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='namespace1',
    inventoryName='inventory-0001',
    userId='user-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['message'])
end

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

deleteReferenceOf

Delete References

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date after deleting the reference source
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_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.Inventory
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\DeleteReferenceOfRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteReferenceOf(
        (new DeleteReferenceOfRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteReferenceOfRequest;
using Gs2.Gs2Inventory.Result.DeleteReferenceOfResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteReferenceOfResult> asyncResult = null;
yield return client.DeleteReferenceOf(
    new Gs2.Gs2Inventory.Request.DeleteReferenceOfRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_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['message'])
end

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

deleteReferenceOfByUserId

Delete references by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsInventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsItem Model Name
itemSetNamestringUUID~ 36 charsName identifying the item set
referenceOfstring~ 1024 charsReferences for this possession

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held per expiration date after deleting the reference source
itemModelItemModelItem Model
inventoryInventoryInventory

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("namespace1"),
        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"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory
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\DeleteReferenceOfByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteReferenceOfByUserId(
        (new DeleteReferenceOfByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withItemSetName("item-set-0001")
            .withReferenceOf("resource-0001")
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteReferenceOfByUserIdRequest;
using Gs2.Gs2Inventory.Result.DeleteReferenceOfByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteReferenceOfByUserIdResult> asyncResult = null;
yield return client.DeleteReferenceOfByUserId(
    new Gs2.Gs2Inventory.Request.DeleteReferenceOfByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.deleteReferenceOfByUserId(
        new Gs2Inventory.DeleteReferenceOfByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.DeleteReferenceOfByUserIdRequest()
            .with_namespace_name(self.hash1)
            .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')
    )
    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='namespace1',
    inventoryName='inventory-0001',
    userId='user-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['message'])
end

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

addReferenceOfItemSetByStampSheet

Add a reference to an item using a stamp sheet

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemList<string>List of References for this possession
itemSetItemSetQuantity of items held by expiration date after addition of reference source
itemModelItemModelItem Model
inventoryInventoryInventory

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.AddReferenceOfItemSetByStampSheet(
    &inventory.AddReferenceOfItemSetByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory
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\AddReferenceOfItemSetByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addReferenceOfItemSetByStampSheet(
        (new AddReferenceOfItemSetByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.AddReferenceOfItemSetByStampSheetRequest;
import io.gs2.inventory.result.AddReferenceOfItemSetByStampSheetResult;

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

try {
    AddReferenceOfItemSetByStampSheetResult result = client.addReferenceOfItemSetByStampSheet(
        new AddReferenceOfItemSetByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AddReferenceOfItemSetByStampSheetRequest;
using Gs2.Gs2Inventory.Result.AddReferenceOfItemSetByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AddReferenceOfItemSetByStampSheetResult> asyncResult = null;
yield return client.AddReferenceOfItemSetByStampSheet(
    new Gs2.Gs2Inventory.Request.AddReferenceOfItemSetByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    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.addReferenceOfItemSetByStampSheet(
        new Gs2Inventory.AddReferenceOfItemSetByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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_item_set_by_stamp_sheet(
        inventory.AddReferenceOfItemSetByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_item_set_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

deleteReferenceOfItemSetByStampSheet

Delete item references using stamp sheet

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemList<string>List of references for this possession
itemSetItemSetQuantity of items held per expiration date after deleting the reference source
itemModelItemModelItem Model
inventoryInventoryInventory

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.DeleteReferenceOfItemSetByStampSheet(
    &inventory.DeleteReferenceOfItemSetByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory
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\DeleteReferenceOfItemSetByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteReferenceOfItemSetByStampSheet(
        (new DeleteReferenceOfItemSetByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.DeleteReferenceOfItemSetByStampSheetRequest;
import io.gs2.inventory.result.DeleteReferenceOfItemSetByStampSheetResult;

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

try {
    DeleteReferenceOfItemSetByStampSheetResult result = client.deleteReferenceOfItemSetByStampSheet(
        new DeleteReferenceOfItemSetByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    List<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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteReferenceOfItemSetByStampSheetRequest;
using Gs2.Gs2Inventory.Result.DeleteReferenceOfItemSetByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteReferenceOfItemSetByStampSheetResult> asyncResult = null;
yield return client.DeleteReferenceOfItemSetByStampSheet(
    new Gs2.Gs2Inventory.Request.DeleteReferenceOfItemSetByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    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.deleteReferenceOfItemSetByStampSheet(
        new Gs2Inventory.DeleteReferenceOfItemSetByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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_item_set_by_stamp_sheet(
        inventory.DeleteReferenceOfItemSetByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_item_set_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;

verifyReferenceOfByStampTask

Verify inventory items using stamp sheets

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemList<string>List of references for this possession
itemSetItemSetQuantity of items held per expiration date
itemModelItemModelItem Model
inventoryInventoryInventory
newContextStackstringRequest of context in which stamp task execution results are recorded

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.VerifyReferenceOfByStampTask(
    &inventory.VerifyReferenceOfByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemSet := result.ItemSet
itemModel := result.ItemModel
inventory := result.Inventory
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyReferenceOfByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyReferenceOfByStampTask(
        (new VerifyReferenceOfByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $itemSet = $result->getItemSet();
    $itemModel = $result->getItemModel();
    $inventory = $result->getInventory();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyReferenceOfByStampTaskRequest;
import io.gs2.inventory.result.VerifyReferenceOfByStampTaskResult;

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

try {
    VerifyReferenceOfByStampTaskResult result = client.verifyReferenceOfByStampTask(
        new VerifyReferenceOfByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    List<String> item = result.getItem();
    ItemSet itemSet = result.getItemSet();
    ItemModel itemModel = result.getItemModel();
    Inventory inventory = result.getInventory();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyReferenceOfByStampTaskRequest;
using Gs2.Gs2Inventory.Result.VerifyReferenceOfByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyReferenceOfByStampTaskResult> asyncResult = null;
yield return client.VerifyReferenceOfByStampTask(
    new Gs2.Gs2Inventory.Request.VerifyReferenceOfByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    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;
var newContextStack = result.NewContextStack;
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.verifyReferenceOfByStampTask(
        new Gs2Inventory.VerifyReferenceOfByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const itemSet = result.getItemSet();
    const itemModel = result.getItemModel();
    const inventory = result.getInventory();
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.VerifyReferenceOfByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    item_set = result.item_set
    item_model = result.item_model
    inventory = result.inventory
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_reference_of_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
itemSet = result.itemSet;
itemModel = result.itemModel;
inventory = result.inventory;
newContextStack = result.newContextStack;

describeSimpleItems

Obtain list of item possession quantities by expiration date

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<SimpleItem>List of Quantity of items
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSimpleItems(
        (new DescribeSimpleItemsRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SimpleItem> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeSimpleItemsRequest;
using Gs2.Gs2Inventory.Result.DescribeSimpleItemsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemsResult> asyncResult = null;
yield return client.DescribeSimpleItems(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemsRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('item')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='item',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

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

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

describeSimpleItemsByUserId

Obtain list of item possession quantities by expiration date, specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
userIdstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<SimpleItem>List of Quantity of items
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSimpleItemsByUserId(
        (new DescribeSimpleItemsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SimpleItem> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeSimpleItemsByUserIdRequest;
using Gs2.Gs2Inventory.Result.DescribeSimpleItemsByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeSimpleItemsByUserIdResult> asyncResult = null;
yield return client.DescribeSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.DescribeSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.describeSimpleItemsByUserId(
        new Gs2Inventory.DescribeSimpleItemsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.DescribeSimpleItemsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
})

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

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

getSimpleItem

Get the quantity of items held by expiration date

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsSimple Item Model Name

Result

TypeDescription
itemSimpleItemQuantity of items
itemModelSimpleItemModelSimple 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("namespace1"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("$access_token_0001"),
        ItemName: pointy.String("item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel
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\GetSimpleItemRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleItem(
        (new GetSimpleItemRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
    );
    SimpleItem item = result.getItem();
    SimpleItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleItemRequest;
using Gs2.Gs2Inventory.Result.GetSimpleItemResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemResult> asyncResult = null;
yield return client.GetSimpleItem(
    new Gs2.Gs2Inventory.Request.GetSimpleItemRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('item')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='item',
    accessToken='$access_token_0001',
    itemName='item-0001',
})

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

result = api_result.result
item = result.item;
itemModel = result.itemModel;

getSimpleItemByUserId

Obtain the quantity of items held by expiration date by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsSimple Item Model Name

Result

TypeDescription
itemSimpleItemQuantity of items
itemModelSimpleItemModelSimple 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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel
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\GetSimpleItemByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleItemByUserId(
        (new GetSimpleItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
    );
    SimpleItem item = result.getItem();
    SimpleItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleItemByUserIdRequest;
using Gs2.Gs2Inventory.Result.GetSimpleItemByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemByUserIdResult> asyncResult = null;
yield return client.GetSimpleItemByUserId(
    new Gs2.Gs2Inventory.Request.GetSimpleItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.getSimpleItemByUserId(
        new Gs2Inventory.GetSimpleItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.GetSimpleItemByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
})

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

result = api_result.result
item = result.item;
itemModel = result.itemModel;

getSimpleItemWithSignature

Get the quantity of items in your possession by expiration date along with your signature

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsSimple Item Model Name
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemSimpleItemQuantity of items
simpleItemModelSimpleItemModelSimple Item Model
bodystringItem Set Information for Signature Subject
signaturestringSignature

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        ItemName: pointy.String("item-0001"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
simpleItemModel := result.SimpleItemModel
body := result.Body
signature := result.Signature
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\GetSimpleItemWithSignatureRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleItemWithSignature(
        (new GetSimpleItemWithSignatureRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withItemName("item-0001")
            ->withKeyId(self::$key1.keyId)
    );
    $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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withKeyId("$key1.keyId")
    );
    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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureRequest;
using Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureResult> asyncResult = null;
yield return client.GetSimpleItemWithSignature(
    new Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_0001")
        .WithItemName("item-0001")
        .WithKeyId("$key1.keyId"),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withKeyId("$key1.keyId")
    );
    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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_0001)
            .with_item_name('item-0001')
            .with_key_id(self.key1.key_id)
    )
    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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_0001',
    itemName='item-0001',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
simpleItemModel = result.simpleItemModel;
body = result.body;
signature = result.signature;

getSimpleItemWithSignatureByUserId

Obtain the quantity of items held by expiration date by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsSimple Item Model Name
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemSimpleItemQuantity of items
simpleItemModelSimpleItemModelSimple Item Model
bodystringItem Set Information for Signature Subject
signaturestringSignature

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
simpleItemModel := result.SimpleItemModel
body := result.Body
signature := result.Signature
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\GetSimpleItemWithSignatureByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSimpleItemWithSignatureByUserId(
        (new GetSimpleItemWithSignatureByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withKeyId(self::$key1.keyId)
    );
    $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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withKeyId("$key1.keyId")
    );
    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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureByUserIdRequest;
using Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetSimpleItemWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetSimpleItemWithSignatureByUserId(
    new Gs2.Gs2Inventory.Request.GetSimpleItemWithSignatureByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithKeyId("$key1.keyId"),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withKeyId("$key1.keyId")
    );
    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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_key_id(self.key1.key_id)
    )
    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='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
simpleItemModel = result.simpleItemModel;
body = result.body;
signature = result.signature;

acquireSimpleItemsByUserId

Add items to inventory

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
userIdstring~ 128 charsUser Id
acquireCountsList<AcquireCount>1 ~ 100 itemsList of quantity of items to be obtained

Result

TypeDescription
itemsList<SimpleItem>List of item possession quantities by expiration date 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("namespace1"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        AcquireCounts: []inventory.AcquireCount{
            inventory.AcquireCount{
                ItemName: pointy.String("item-0001"),
                Count: pointy.Int64(5),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->acquireSimpleItemsByUserId(
        (new AcquireSimpleItemsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withAcquireCounts([    (new \Gs2\Inventory\Model\AcquireCount())
                ->withItemName("item-0001")
                ->withCount(5),
            ])
    );
    $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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withAcquireCounts(Arrays.asList(
                new io.gs2.inventory.model.AcquireCount()
                    .withItemName("item-0001")
                    .withCount(5L)
            ))
    );
    List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AcquireSimpleItemsByUserIdRequest;
using Gs2.Gs2Inventory.Result.AcquireSimpleItemsByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireSimpleItemsByUserIdResult> asyncResult = null;
yield return client.AcquireSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.AcquireSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithAcquireCounts(new Gs2.Gs2Inventory.Model.AcquireCount[] {
            new Gs2.Gs2Inventory.Model.AcquireCount()
                .WithItemName("item-0001")
                .WithCount(5L)
        }),
    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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withAcquireCounts([
                new Gs2Inventory.model.AcquireCount()
                    .withItemName("item-0001")
                    .withCount(5)
            ])
    );
    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(self.hash1)
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_acquire_counts([    inventory.AcquireCount()
                .with_item_name('item-0001')
                .with_count(5),
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.acquire_simple_items_by_user_id({
    namespaceName='namespace1',
    inventoryName='item',
    userId='user-0001',
    acquireCounts={
        {
            itemName='item-0001',
            count=5,
        }
    },
})

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

result = api_result.result
items = result.items;

consumeSimpleItems

Consume inventory items

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
accessTokenstring~ 128 charsUser Id
consumeCountsList<ConsumeCount>1 ~ 100 itemsList of quantity of items to be consumed

Result

TypeDescription
itemsList<SimpleItem>List of item possession quantities per post-consumption expiration date

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        ConsumeCounts: []inventory.ConsumeCount{
            {'itemName': 'item-0001', 'count': 5},
        {'itemName': 'item-0002', 'count': 3},
        },
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeSimpleItems(
        (new ConsumeSimpleItemsRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withConsumeCounts([    {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withConsumeCounts(Arrays.asList(
                {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 3}
            ))
    );
    List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeSimpleItemsRequest;
using Gs2.Gs2Inventory.Result.ConsumeSimpleItemsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeSimpleItemsResult> asyncResult = null;
yield return client.ConsumeSimpleItems(
    new Gs2.Gs2Inventory.Request.ConsumeSimpleItemsRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_0001")
        .WithConsumeCounts(new Gs2.Gs2Inventory.Model.ConsumeCount[] {
            {'itemName': 'item-0001', 'count': 5},
        {'itemName': 'item-0002', 'count': 3}
        }),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withConsumeCounts([
                {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_0001)
            .with_consume_counts([    {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 3},
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.consume_simple_items({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_0001',
    consumeCounts={
        {'itemName': 'item-0001', 'count': 5},
    {'itemName': 'item-0002', 'count': 3}
    },
})

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

result = api_result.result
items = result.items;

consumeSimpleItemsByUserId

Consume inventory items by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
userIdstring~ 128 charsUser Id
consumeCountsList<ConsumeCount>1 ~ 100 itemsList of quantity of items to be consumed

Result

TypeDescription
itemsList<SimpleItem>List of item possession quantities per post-consumption expiration date

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ConsumeCounts: []inventory.ConsumeCount{
            {'itemName': 'item-0001', 'count': 5},
        {'itemName': 'item-0002', 'count': 3},
        },
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeSimpleItemsByUserId(
        (new ConsumeSimpleItemsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-0001")
            ->withConsumeCounts([    {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withConsumeCounts(Arrays.asList(
                {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 3}
            ))
    );
    List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeSimpleItemsByUserIdRequest;
using Gs2.Gs2Inventory.Result.ConsumeSimpleItemsByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeSimpleItemsByUserIdResult> asyncResult = null;
yield return client.ConsumeSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.ConsumeSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-0001")
        .WithConsumeCounts(new Gs2.Gs2Inventory.Model.ConsumeCount[] {
            {'itemName': 'item-0001', 'count': 5},
        {'itemName': 'item-0002', 'count': 3}
        }),
    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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withConsumeCounts([
                {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 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_by_user_id(
        inventory.ConsumeSimpleItemsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-0001')
            .with_consume_counts([    {'itemName': 'item-0001', 'count': 5},
            {'itemName': 'item-0002', 'count': 3},
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.consume_simple_items_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    consumeCounts={
        {'itemName': 'item-0001', 'count': 5},
    {'itemName': 'item-0002', 'count': 3}
    },
})

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

result = api_result.result
items = result.items;

deleteSimpleItemsByUserId

Delete item possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsSimple Inventory Model Name
userIdstring~ 128 charsUser Id

Result

TypeDescription

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("namespace1"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSimpleItemsByUserId(
        (new DeleteSimpleItemsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withUserId("user-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteSimpleItemsByUserIdRequest;
using Gs2.Gs2Inventory.Result.DeleteSimpleItemsByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteSimpleItemsByUserIdResult> asyncResult = null;
yield return client.DeleteSimpleItemsByUserId(
    new Gs2.Gs2Inventory.Request.DeleteSimpleItemsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithUserId("user-0001"),
    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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
    );
} 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(self.hash1)
            .with_inventory_name('item')
            .with_user_id('user-0001')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.delete_simple_items_by_user_id({
    namespaceName='namespace1',
    inventoryName='item',
    userId='user-0001',
})

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

result = api_result.result

verifySimpleItem

Verify possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
inventoryNamestring~ 128 charsSimple Inventory Model Name
itemNamestring~ 128 charsSimple Item Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
countlong1 ~ 9223372036854775805Quantity in possession

Result

TypeDescription

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("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: pointy.Int64(10),
    }
)
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\VerifySimpleItemRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifySimpleItem(
        (new VerifySimpleItemRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10L)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifySimpleItemRequest;
using Gs2.Gs2Inventory.Result.VerifySimpleItemResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifySimpleItemResult> asyncResult = null;
yield return client.VerifySimpleItem(
    new Gs2.Gs2Inventory.Request.VerifySimpleItemRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10L),
    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.verifySimpleItem(
        new Gs2Inventory.VerifySimpleItemRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
    );
} 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(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_simple_item({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    inventoryName='inventory-0001',
    itemName='item-0001',
    verifyType='less',
    count=10,
})

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

result = api_result.result

verifySimpleItemByUserId

Verify possession quantity by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
inventoryNamestring~ 128 charsSimple Inventory Model Name
itemNamestring~ 128 charsSimple Item Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
countlong1 ~ 9223372036854775805Quantity in possession

Result

TypeDescription

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("namespace1"),
        UserId: pointy.String("user-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: pointy.Int64(10),
    }
)
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\VerifySimpleItemByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifySimpleItemByUserId(
        (new VerifySimpleItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10L)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifySimpleItemByUserIdRequest;
using Gs2.Gs2Inventory.Result.VerifySimpleItemByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifySimpleItemByUserIdResult> asyncResult = null;
yield return client.VerifySimpleItemByUserId(
    new Gs2.Gs2Inventory.Request.VerifySimpleItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10L),
    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.verifySimpleItemByUserId(
        new Gs2Inventory.VerifySimpleItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
    );
} 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(self.hash1)
            .with_user_id('user-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_simple_item_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    inventoryName='inventory-0001',
    itemName='item-0001',
    verifyType='less',
    count=10,
})

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

result = api_result.result

acquireSimpleItemsByStampSheet

Add items to inventory using stamp sheets

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemsList<SimpleItem>List of Quantity of 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.AcquireSimpleItemsByStampSheet(
    &inventory.AcquireSimpleItemsByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireSimpleItemsByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->acquireSimpleItemsByStampSheet(
        (new AcquireSimpleItemsByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.AcquireSimpleItemsByStampSheetRequest;
import io.gs2.inventory.result.AcquireSimpleItemsByStampSheetResult;

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

try {
    AcquireSimpleItemsByStampSheetResult result = client.acquireSimpleItemsByStampSheet(
        new AcquireSimpleItemsByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    List<SimpleItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AcquireSimpleItemsByStampSheetRequest;
using Gs2.Gs2Inventory.Result.AcquireSimpleItemsByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireSimpleItemsByStampSheetResult> asyncResult = null;
yield return client.AcquireSimpleItemsByStampSheet(
    new Gs2.Gs2Inventory.Request.AcquireSimpleItemsByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    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.acquireSimpleItemsByStampSheet(
        new Gs2Inventory.AcquireSimpleItemsByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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_stamp_sheet(
        inventory.AcquireSimpleItemsByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.acquire_simple_items_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
items = result.items;

consumeSimpleItemsByStampTask

Consume inventory items using stamp sheets

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemsList<SimpleItem>List of Quantity of items held per post-consumption expiration date
newContextStackstringRequest of context in which stamp task execution results are recorded

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.ConsumeSimpleItemsByStampTask(
    &inventory.ConsumeSimpleItemsByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeSimpleItemsByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeSimpleItemsByStampTask(
        (new ConsumeSimpleItemsByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $items = $result->getItems();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeSimpleItemsByStampTaskRequest;
import io.gs2.inventory.result.ConsumeSimpleItemsByStampTaskResult;

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

try {
    ConsumeSimpleItemsByStampTaskResult result = client.consumeSimpleItemsByStampTask(
        new ConsumeSimpleItemsByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    List<SimpleItem> items = result.getItems();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeSimpleItemsByStampTaskRequest;
using Gs2.Gs2Inventory.Result.ConsumeSimpleItemsByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeSimpleItemsByStampTaskResult> asyncResult = null;
yield return client.ConsumeSimpleItemsByStampTask(
    new Gs2.Gs2Inventory.Request.ConsumeSimpleItemsByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as 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.consumeSimpleItemsByStampTask(
        new Gs2Inventory.ConsumeSimpleItemsByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const items = result.getItems();
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.ConsumeSimpleItemsByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    items = result.items
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.consume_simple_items_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
items = result.items;
newContextStack = result.newContextStack;

verifySimpleItemByStampTask

Use stamp task to verify item possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
newContextStackstringRequest of context in which stamp task execution results are recorded

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.VerifySimpleItemByStampTask(
    &inventory.VerifySimpleItemByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifySimpleItemByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifySimpleItemByStampTask(
        (new VerifySimpleItemByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifySimpleItemByStampTaskRequest;
import io.gs2.inventory.result.VerifySimpleItemByStampTaskResult;

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

try {
    VerifySimpleItemByStampTaskResult result = client.verifySimpleItemByStampTask(
        new VerifySimpleItemByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifySimpleItemByStampTaskRequest;
using Gs2.Gs2Inventory.Result.VerifySimpleItemByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifySimpleItemByStampTaskResult> asyncResult = null;
yield return client.VerifySimpleItemByStampTask(
    new Gs2.Gs2Inventory.Request.VerifySimpleItemByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifySimpleItemByStampTask(
        new Gs2Inventory.VerifySimpleItemByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.VerifySimpleItemByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_simple_item_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
newContextStack = result.newContextStack;

describeBigItems

Obtain list of item possession quantities by expiration date

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<BigItem>List of Quantity of items
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeBigItems(
        (new DescribeBigItemsRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<BigItem> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeBigItemsRequest;
using Gs2.Gs2Inventory.Result.DescribeBigItemsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemsResult> asyncResult = null;
yield return client.DescribeBigItems(
    new Gs2.Gs2Inventory.Request.DescribeBigItemsRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('item')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='item',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

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

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

describeBigItemsByUserId

Obtain list of item possession quantities by expiration date, specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
userIdstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<BigItem>List of Quantity of items
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeBigItemsByUserId(
        (new DescribeBigItemsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<BigItem> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeBigItemsByUserIdRequest;
using Gs2.Gs2Inventory.Result.DescribeBigItemsByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeBigItemsByUserIdResult> asyncResult = null;
yield return client.DescribeBigItemsByUserId(
    new Gs2.Gs2Inventory.Request.DescribeBigItemsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.describeBigItemsByUserId(
        new Gs2Inventory.DescribeBigItemsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.DescribeBigItemsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
})

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

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

getBigItem

Get the quantity of items held by expiration date

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsBig Item Model Name

Result

TypeDescription
itemBigItemQuantity of items
itemModelBigItemModelBig 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("namespace1"),
        InventoryName: pointy.String("item"),
        AccessToken: pointy.String("$access_token_0001"),
        ItemName: pointy.String("item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel
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\GetBigItemRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBigItem(
        (new GetBigItemRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
    );
    BigItem item = result.getItem();
    BigItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetBigItemRequest;
using Gs2.Gs2Inventory.Result.GetBigItemResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemResult> asyncResult = null;
yield return client.GetBigItem(
    new Gs2.Gs2Inventory.Request.GetBigItemRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("item")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('item')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='item',
    accessToken='$access_token_0001',
    itemName='item-0001',
})

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

result = api_result.result
item = result.item;
itemModel = result.itemModel;

getBigItemByUserId

Obtain the quantity of items held by expiration date by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsBig Item Model Name

Result

TypeDescription
itemBigItemQuantity of items
itemModelBigItemModelBig 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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
itemModel := result.ItemModel
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\GetBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBigItemByUserId(
        (new GetBigItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
    );
    BigItem item = result.getItem();
    BigItemModel itemModel = result.getItemModel();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetBigItemByUserIdRequest;
using Gs2.Gs2Inventory.Result.GetBigItemByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetBigItemByUserIdResult> asyncResult = null;
yield return client.GetBigItemByUserId(
    new Gs2.Gs2Inventory.Request.GetBigItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.getBigItemByUserId(
        new Gs2Inventory.GetBigItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.GetBigItemByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
})

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

result = api_result.result
item = result.item;
itemModel = result.itemModel;

acquireBigItemByUserId

Add items to inventory

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsBig Item Model Name
acquireCountstring~ 1024 charsQuantity of items to be obtained

Result

TypeDescription
itemBigItemQuantity of 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.AcquireBigItemByUserId(
    &inventory.AcquireBigItemByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        AcquireCount: pointy.String("1234567890123456789012345678901234567890"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->acquireBigItemByUserId(
        (new AcquireBigItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withItemName("item-0001")
            ->withAcquireCount("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.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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withAcquireCount("1234567890123456789012345678901234567890")
    );
    BigItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AcquireBigItemByUserIdRequest;
using Gs2.Gs2Inventory.Result.AcquireBigItemByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireBigItemByUserIdResult> asyncResult = null;
yield return client.AcquireBigItemByUserId(
    new Gs2.Gs2Inventory.Request.AcquireBigItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithItemName("item-0001")
        .WithAcquireCount("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.acquireBigItemByUserId(
        new Gs2Inventory.AcquireBigItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withAcquireCount("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.acquire_big_item_by_user_id(
        inventory.AcquireBigItemByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
            .with_acquire_count('1234567890123456789012345678901234567890')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.acquire_big_item_by_user_id({
    namespaceName='namespace1',
    inventoryName='item',
    userId='user-0001',
    itemName='item-0001',
    acquireCount='1234567890123456789012345678901234567890',
})

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

result = api_result.result
item = result.item;

consumeBigItem

Consume inventory items

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
accessTokenstring~ 128 charsUser Id
itemNamestring~ 128 charsBig Item Model Name
consumeCountstring~ 1024 charsQuantity of items to be consumed

Result

TypeDescription
itemBigItemQuantity of items held per post-consumption expiration date

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        ItemName: pointy.String("item-0001"),
        ConsumeCount: pointy.String("1234567890123456789012345678901234567890"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeBigItem(
        (new ConsumeBigItemRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_0001")
            .withItemName("item-0001")
            .withConsumeCount("1234567890123456789012345678901234567890")
    );
    BigItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeBigItemRequest;
using Gs2.Gs2Inventory.Result.ConsumeBigItemResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeBigItemResult> asyncResult = null;
yield return client.ConsumeBigItem(
    new Gs2.Gs2Inventory.Request.ConsumeBigItemRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithAccessToken("$access_token_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("namespace1")
            .withInventoryName("inventory-0001")
            .withAccessToken("$access_token_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(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_access_token(self.access_token_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='namespace1',
    inventoryName='inventory-0001',
    accessToken='$access_token_0001',
    itemName='item-0001',
    consumeCount='1234567890123456789012345678901234567890',
})

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

result = api_result.result
item = result.item;

consumeBigItemByUserId

Consume inventory items by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsBig Item Model Name
consumeCountstring~ 1024 charsQuantity of items to be consumed

Result

TypeDescription
itemBigItemQuantity of items held per post-consumption expiration date

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("namespace1"),
        InventoryName: pointy.String("inventory-0001"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
        ConsumeCount: pointy.String("1234567890123456789012345678901234567890"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeBigItemByUserId(
        (new ConsumeBigItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("inventory-0001")
            ->withUserId("user-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.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("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-0001")
            .withItemName("item-0001")
            .withConsumeCount("1234567890123456789012345678901234567890")
    );
    BigItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeBigItemByUserIdRequest;
using Gs2.Gs2Inventory.Result.ConsumeBigItemByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeBigItemByUserIdResult> asyncResult = null;
yield return client.ConsumeBigItemByUserId(
    new Gs2.Gs2Inventory.Request.ConsumeBigItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("inventory-0001")
        .WithUserId("user-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.consumeBigItemByUserId(
        new Gs2Inventory.ConsumeBigItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("inventory-0001")
            .withUserId("user-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_by_user_id(
        inventory.ConsumeBigItemByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('inventory-0001')
            .with_user_id('user-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_by_user_id({
    namespaceName='namespace1',
    inventoryName='inventory-0001',
    userId='user-0001',
    itemName='item-0001',
    consumeCount='1234567890123456789012345678901234567890',
})

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

result = api_result.result
item = result.item;

deleteBigItemByUserId

Delete item possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
inventoryNamestring~ 128 charsBig Inventory Model Name
userIdstring~ 128 charsUser Id
itemNamestring~ 128 charsBig Item Model Name

Result

TypeDescription
itemBigItemQuantity of items held per post-consumption expiration date

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("namespace1"),
        InventoryName: pointy.String("item"),
        UserId: pointy.String("user-0001"),
        ItemName: pointy.String("item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteBigItemByUserId(
        (new DeleteBigItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withUserId("user-0001")
            ->withItemName("item-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.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("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-0001")
    );
    BigItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteBigItemByUserIdRequest;
using Gs2.Gs2Inventory.Result.DeleteBigItemByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteBigItemByUserIdResult> asyncResult = null;
yield return client.DeleteBigItemByUserId(
    new Gs2.Gs2Inventory.Request.DeleteBigItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithUserId("user-0001")
        .WithItemName("item-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.deleteBigItemByUserId(
        new Gs2Inventory.DeleteBigItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
            .withUserId("user-0001")
            .withItemName("item-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_by_user_id(
        inventory.DeleteBigItemByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('item')
            .with_user_id('user-0001')
            .with_item_name('item-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.delete_big_item_by_user_id({
    namespaceName='namespace1',
    inventoryName='item',
    userId='user-0001',
    itemName='item-0001',
})

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

result = api_result.result
item = result.item;

verifyBigItem

Verify possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
inventoryNamestring~ 128 charsBig Inventory Model Name
itemNamestring~ 128 charsBig Item Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
countstring~ 1024 charsQuantity in possession

Result

TypeDescription

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("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: 10,
    }
)
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\VerifyBigItemRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyBigItem(
        (new VerifyBigItemRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyBigItemRequest;
using Gs2.Gs2Inventory.Result.VerifyBigItemResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyBigItemResult> asyncResult = null;
yield return client.VerifyBigItem(
    new Gs2.Gs2Inventory.Request.VerifyBigItemRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10),
    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.verifyBigItem(
        new Gs2Inventory.VerifyBigItemRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
    );
} 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(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_big_item({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    inventoryName='inventory-0001',
    itemName='item-0001',
    verifyType='less',
    count=10,
})

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

result = api_result.result

verifyBigItemByUserId

Verify possession quantity by user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
inventoryNamestring~ 128 charsBig Inventory Model Name
itemNamestring~ 128 charsBig Item Model Name
verifyTypeenum [’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’]~ 128 charsType of verification
countstring~ 1024 charsQuantity in possession

Result

TypeDescription

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("namespace1"),
        UserId: pointy.String("user-0001"),
        InventoryName: pointy.String("inventory-0001"),
        ItemName: pointy.String("item-0001"),
        VerifyType: pointy.String("less"),
        Count: 10,
    }
)
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\VerifyBigItemByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyBigItemByUserId(
        (new VerifyBigItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withInventoryName("inventory-0001")
            ->withItemName("item-0001")
            ->withVerifyType("less")
            ->withCount(10)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.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("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyBigItemByUserIdRequest;
using Gs2.Gs2Inventory.Result.VerifyBigItemByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyBigItemByUserIdResult> asyncResult = null;
yield return client.VerifyBigItemByUserId(
    new Gs2.Gs2Inventory.Request.VerifyBigItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithInventoryName("inventory-0001")
        .WithItemName("item-0001")
        .WithVerifyType("less")
        .WithCount(10),
    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.verifyBigItemByUserId(
        new Gs2Inventory.VerifyBigItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withInventoryName("inventory-0001")
            .withItemName("item-0001")
            .withVerifyType("less")
            .withCount(10)
    );
} 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(self.hash1)
            .with_user_id('user-0001')
            .with_inventory_name('inventory-0001')
            .with_item_name('item-0001')
            .with_verify_type('less')
            .with_count(10)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_big_item_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    inventoryName='inventory-0001',
    itemName='item-0001',
    verifyType='less',
    count=10,
})

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

result = api_result.result

acquireBigItemByStampSheet

Add items to inventory using stamp sheets

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemBigItemQuantity of 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.AcquireBigItemByStampSheet(
    &inventory.AcquireBigItemByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\AcquireBigItemByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->acquireBigItemByStampSheet(
        (new AcquireBigItemByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.AcquireBigItemByStampSheetRequest;
import io.gs2.inventory.result.AcquireBigItemByStampSheetResult;

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

try {
    AcquireBigItemByStampSheetResult result = client.acquireBigItemByStampSheet(
        new AcquireBigItemByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    BigItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.AcquireBigItemByStampSheetRequest;
using Gs2.Gs2Inventory.Result.AcquireBigItemByStampSheetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.AcquireBigItemByStampSheetResult> asyncResult = null;
yield return client.AcquireBigItemByStampSheet(
    new Gs2.Gs2Inventory.Request.AcquireBigItemByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    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.acquireBigItemByStampSheet(
        new Gs2Inventory.AcquireBigItemByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    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_stamp_sheet(
        inventory.AcquireBigItemByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.acquire_big_item_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;

consumeBigItemByStampTask

Consume inventory items using stamp sheets

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemBigItemQuantity of items held per post-consumption expiration date
newContextStackstringRequest of context in which stamp task execution results are recorded

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.ConsumeBigItemByStampTask(
    &inventory.ConsumeBigItemByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\ConsumeBigItemByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeBigItemByStampTask(
        (new ConsumeBigItemByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ConsumeBigItemByStampTaskRequest;
import io.gs2.inventory.result.ConsumeBigItemByStampTaskResult;

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

try {
    ConsumeBigItemByStampTaskResult result = client.consumeBigItemByStampTask(
        new ConsumeBigItemByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    BigItem item = result.getItem();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ConsumeBigItemByStampTaskRequest;
using Gs2.Gs2Inventory.Result.ConsumeBigItemByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ConsumeBigItemByStampTaskResult> asyncResult = null;
yield return client.ConsumeBigItemByStampTask(
    new Gs2.Gs2Inventory.Request.ConsumeBigItemByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
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.consumeBigItemByStampTask(
        new Gs2Inventory.ConsumeBigItemByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.ConsumeBigItemByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.consume_big_item_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
newContextStack = result.newContextStack;

verifyBigItemByStampTask

Use stamp task to verify item possession quantity

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
newContextStackstringRequest of context in which stamp task execution results are recorded

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.VerifyBigItemByStampTask(
    &inventory.VerifyBigItemByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\VerifyBigItemByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyBigItemByStampTask(
        (new VerifyBigItemByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.VerifyBigItemByStampTaskRequest;
import io.gs2.inventory.result.VerifyBigItemByStampTaskResult;

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

try {
    VerifyBigItemByStampTaskResult result = client.verifyBigItemByStampTask(
        new VerifyBigItemByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.VerifyBigItemByStampTaskRequest;
using Gs2.Gs2Inventory.Result.VerifyBigItemByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.VerifyBigItemByStampTaskResult> asyncResult = null;
yield return client.VerifyBigItemByStampTask(
    new Gs2.Gs2Inventory.Request.VerifyBigItemByStampTaskRequest()
        .WithStampTask("$stampTask")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifyBigItemByStampTask(
        new Gs2Inventory.VerifyBigItemByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        inventory.VerifyBigItemByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.verify_big_item_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

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

result = api_result.result
newContextStack = result.newContextStack;