docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EconomyInventoryApi

    Represents a collection of functions to interact with the API endpoints

    Inheritance
    object
    EconomyInventoryApi
    Implements
    IEconomyInventoryApi
    IApiAccessor
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Services.Apis.Economy
    Assembly: solution.dll
    Syntax
    public class EconomyInventoryApi : IEconomyInventoryApi, IApiAccessor

    Constructors

    EconomyInventoryApi(IApiClient)

    Initializes a new instance of the EconomyInventoryApi class using a Configuration object and client instance.

    Declaration
    public EconomyInventoryApi(IApiClient apiClient)
    Parameters
    Type Name Description
    IApiClient apiClient

    The client interface for synchronous API access.

    EconomyInventoryApi(IApiClient, IApiConfiguration)

    Initializes a new instance of the EconomyInventoryApi class using a Configuration object and client instance.

    Declaration
    public EconomyInventoryApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
    Parameters
    Type Name Description
    IApiClient apiClient

    The client interface for synchronous API access.

    IApiConfiguration apiConfiguration

    The configuration object.

    Properties

    Client

    The client for accessing this underlying API asynchronously.

    Declaration
    public IApiClient Client { get; }
    Property Value
    Type Description
    IApiClient

    Configuration

    Gets the configuration object

    Declaration
    public IApiConfiguration Configuration { get; }
    Property Value
    Type Description
    IApiConfiguration

    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.

    AddInventoryRequest addInventoryRequest
    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)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<InventoryResponse>

    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 playersInventoryItemId of the item to be updated.

    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)

    InventoryDeleteRequest inventoryDeleteRequest

    (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation

    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 playersInventoryItemId after which to retrieve the next page of balances. (optional)

    int? limit

    Number of items to be returned. Defaults to 20. (optional)

    List<string> playersInventoryItemIds

    List of playersInventoryItemIds in array notation, for example, playersInventoryItemIds[]=ID1&playersInventoryItemIds[]=ID2. (optional)

    List<string> inventoryItemIds

    List of inventory item IDs in array notation, for example, inventoryItemIds[]=ID1&inventoryItemIds[]=ID2. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<PlayerInventoryResponse>

    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 playersInventoryItemId of the item to be updated.

    InventoryRequestUpdate inventoryRequestUpdate
    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)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<InventoryResponse>

    The operation

    Implements

    IEconomyInventoryApi
    IApiAccessor
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)