GS2-ConsumableItem¶
Create Client
consumable_item_client = client('consumable-item')
目次
- Method
- acquisition_inventory
- acquisition_my_inventory
- consume_inventory
- consume_my_inventory
- create_item
- create_item_pool
- delete_inventory
- delete_item
- delete_item_pool
- describe_inventory
- describe_item
- describe_item_pool
- describe_my_inventory
- describe_service_class
- get_inventory
- get_item
- get_item_pool
- get_item_pool_status
- get_my_inventory
- update_item
- update_item_pool
- Model
Method¶
acquisition_inventory¶
response = consumable_item_client:acquisition_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
インベントリにアイテムを加えます
アイテムに所持数の上限が設定されている状態で、複数個付与することによって 所持数の上限を超えてしまうケースでは一切付与せずエラー応答を返します。
例えば、所持数上限 10 のアイテムで、8個所持しているユーザに 3個 付与しようとすると 1個も付与せずにエラーを返します。
Request¶
{
itemPoolName=string,
itemName=string,
userId=string,
count=number,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- userId
- [string] ユーザID
- count
- [number] 入手数量
acquisition_my_inventory¶
response = consumable_item_client:acquisition_my_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
インベントリにアイテムを加えます
アイテムに所持数の上限が設定されている状態で、複数個付与することによって 所持数の上限を超えてしまうケースでは一切付与せずエラー応答を返します。
例えば、所持数上限 10 のアイテムで、8個所持しているユーザに 3個 付与しようとすると 1個も付与せずにエラーを返します。
Request¶
{
itemPoolName=string,
itemName=string,
count=number,
accessToken=string
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- count
- [number] 入手数量
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
consume_inventory¶
response = consumable_item_client:consume_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
インベントリのアイテムを消費します
Request¶
{
itemPoolName=string,
itemName=string,
userId=string,
count=number,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- userId
- [string] ユーザID
- count
- [number] 消費数量
consume_my_inventory¶
response = consumable_item_client:consume_my_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
インベントリのアイテムを消費します
Request¶
{
itemPoolName=string,
itemName=string,
count=number,
accessToken=string
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- count
- [number] 消費数量
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
create_item¶
response = consumable_item_client:create_item(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムを新規作成します
Request¶
{
itemPoolName=string,
max=number,
name=string,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- max
- [number] 最大所持数。
- name
- [string] 消費型アイテム名
create_item_pool¶
response = consumable_item_client:create_item_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムプールを新規作成します
Request¶
{
serviceClass=string,
name=string,
description=string,
}
- serviceClass
- [string] サービスクラス
- name
- [string] 仮想通貨名
- description
- [string] 説明文(1024文字以内)
delete_inventory¶
response = consumable_item_client:delete_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
インベントリからアイテムを削除します
Request¶
{
itemPoolName=string,
itemName=string,
userId=string,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- userId
- [string] ユーザID
Response¶
None
delete_item¶
response = consumable_item_client:delete_item(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムを削除します
既にアイテムを所持しているユーザがいる場合、そのアイテムはインベントリから削除されることはありません。 消費型アイテムを削除することで新しくアイテムを付与することはできなくなりますが、消費することは出来ます。
これを防ぎたい場合はすべてのユーザのインベントリを走査して該当アイテムを削除する必要があります。
Request¶
{
itemPoolName=string,
itemName=string,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
Response¶
None
delete_item_pool¶
response = consumable_item_client:delete_item_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムプールを削除します
Response¶
None
describe_inventory¶
response = consumable_item_client:describe_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ユーザが所持しているインベントリの一覧を取得します
Request¶
{
itemPoolName=string,
userId=string,
pageToken=string,
limit=number,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- userId
- [string] ユーザID
- pageToken
- [string] データの取得を開始する位置を指定するトークン
- limit
- [number] データの取得件数
describe_item¶
response = consumable_item_client:describe_item(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムの一覧を取得します
Request¶
{
itemPoolName=string,
pageToken=string,
limit=number,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- pageToken
- [string] データの取得を開始する位置を指定するトークン
- limit
- [number] データの取得件数
describe_item_pool¶
response = consumable_item_client:describe_item_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムプールの一覧を取得します
Request¶
{
pageToken=string,
limit=number,
}
- pageToken
- [string] データの取得を開始する位置を指定するトークン
- limit
- [number] データの取得件数
describe_my_inventory¶
response = consumable_item_client:describe_my_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ユーザが所持しているインベントリの一覧を取得します
Request¶
{
itemPoolName=string,
pageToken=string,
limit=number,
accessToken=string
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- pageToken
- [string] データの取得を開始する位置を指定するトークン
- limit
- [number] データの取得件数
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
describe_service_class¶
response = consumable_item_client:describe_service_class(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
サービスクラスの一覧を取得します
Request¶
{
}
get_inventory¶
response = consumable_item_client:get_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
インベントリの内容を取得します
Request¶
{
itemPoolName=string,
itemName=string,
userId=string,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- userId
- [string] ユーザID
get_item¶
response = consumable_item_client:get_item(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムを取得します
Request¶
{
itemPoolName=string,
itemName=string,
}
- itemPoolName
- [string] 仮想通貨の名前
- itemName
- [string] 商品の名前
get_item_pool¶
response = consumable_item_client:get_item_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムプールを取得します
get_item_pool_status¶
response = consumable_item_client:get_item_pool_status(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムプールの状態を取得します
get_my_inventory¶
response = consumable_item_client:get_my_inventory(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
インベントリの内容を取得します
Request¶
{
itemPoolName=string,
itemName=string,
accessToken=string
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
update_item¶
response = consumable_item_client:update_item(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムを更新します
Request¶
{
itemPoolName=string,
itemName=string,
max=number,
}
- itemPoolName
- [string] 消費型アイテムプールの名前
- itemName
- [string] 消費型アイテムの名前
- max
- [number] 最大所持数。
update_item_pool¶
response = consumable_item_client:update_item_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
消費型アイテムプールを更新します
Request¶
{
itemPoolName=string,
serviceClass=string,
description=string,
}
- itemPoolName
- [string] 更新する消費型アイテムプールの名前
- serviceClass
- [string] サービスクラス
- description
- [string] 説明文(1024文字以内)
Model¶
Item¶
- itemId
- [string] 消費型アイテムID
- createAt
- [number] 作成日時(エポック秒)
- name
- [string] 消費型アイテム名
- max
- [number] 所持数の上限
- itemPoolId
- [string] 消費型アイテムプールID
- updateAt
- [number] 最終更新日時(エポック秒)