Class EconomyInventoryApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.Economy
Assembly: Unity.Services.Apis.dll
Syntax
public class EconomyInventoryApi : IEconomyInventoryApi, IApiAccessor
Constructors
EconomyInventoryApi(IApiClient)
Initializes a new instance of the Economy
Declaration
public EconomyInventoryApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
EconomyInventoryApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Economy
Declaration
public EconomyInventoryApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
IApi |
apiConfiguration | The configuration object. |
Properties
Client
The client for accessing this underlying API asynchronously.
Declaration
public IApiClient Client { get; }
Property Value
Type | Description |
---|---|
IApi |
Configuration
Gets the configuration object
Declaration
public IApiConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
IApi |
An instance of the Configuration |
Methods
AddInventoryItem(string, string, AddInventoryRequest, string, string, string, CancellationToken)
Add inventory item Add an item to a player's inventory.
Declaration
public ApiOperation<InventoryResponse> AddInventoryItem(string projectId, string playerId, AddInventoryRequest addInventoryRequest, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
Add |
addInventoryRequest | The add inventory item request. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
DeleteInventoryItem(string, string, string, string, string, string, string, InventoryDeleteRequest, CancellationToken)
Delete player's inventory item Delete a player's inventory item.
Declaration
public ApiOperation DeleteInventoryItem(string projectId, string playerId, string playersInventoryItemId, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, string writeLock = null, InventoryDeleteRequest inventoryDeleteRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
string | playersInventoryItemId | The |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
string | writeLock | The writelock for a database entry. (optional) |
Inventory |
inventoryDeleteRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
GetPlayerInventory(string, string, string, string, string, string, int?, List<string>, List<string>, CancellationToken)
List player inventory Get a list of inventory for a player. Results ordered by ascending playersInventoryItemId
. playersIventoryItemIds
and inventoryItemIds
filters are optional, if not given all items will be returned. If both are given an item must match both to be returned.
Declaration
public ApiOperation<PlayerInventoryResponse> GetPlayerInventory(string projectId, string playerId, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, string after = null, int? limit = null, List<string> playersInventoryItemIds = null, List<string> inventoryItemIds = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
string | after | The |
int? | limit | Number of items to be returned. Defaults to 20. (optional) |
List<string> | playersInventoryItemIds | List of |
List<string> | inventoryItemIds | List of inventory item IDs in array notation, for example, |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
UpdateInventoryItem(string, string, string, InventoryRequestUpdate, string, string, string, CancellationToken)
Update player's inventory item Update a player's inventory item.
Declaration
public ApiOperation<InventoryResponse> UpdateInventoryItem(string projectId, string playerId, string playersInventoryItemId, InventoryRequestUpdate inventoryRequestUpdate, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
string | playersInventoryItemId | The |
Inventory |
inventoryRequestUpdate | The update inventory item request. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |