docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EconomyCurrenciesApi

    Represents a collection of functions to interact with the API endpoints

    Inheritance
    object
    EconomyCurrenciesApi
    Implements
    IEconomyCurrenciesApi
    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 EconomyCurrenciesApi : IEconomyCurrenciesApi, IApiAccessor

    Constructors

    EconomyCurrenciesApi(IApiClient)

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

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

    The client interface for synchronous API access.

    EconomyCurrenciesApi(IApiClient, IApiConfiguration)

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

    Declaration
    public EconomyCurrenciesApi(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

    DecrementPlayerCurrencyBalance(string, string, string, CurrencyModifyBalanceRequest, string, string, string, CancellationToken)

    Decrement currency balance Decrements a player's currency balance by a given value.

    Declaration
    public ApiOperation<CurrencyBalanceResponse> DecrementPlayerCurrencyBalance(string projectId, string playerId, string currencyId, CurrencyModifyBalanceRequest currencyModifyBalanceRequest, 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 currencyId

    Resource ID of the currency.

    CurrencyModifyBalanceRequest currencyModifyBalanceRequest
    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<CurrencyBalanceResponse>

    The operation

    GetBasePath()

    Gets the base path of the API client.

    Declaration
    public string GetBasePath()
    Returns
    Type Description
    string

    The base path

    GetPlayerCurrencies(string, string, string, string, string, string, int?, CancellationToken)

    Player currency balances Get a list of currency balances for a player. Results ordered in ascending currency ID.

    Declaration
    public ApiOperation<PlayerCurrencyBalanceResponse> GetPlayerCurrencies(string projectId, string playerId, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, string after = null, int? limit = 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 currency ID after which to retrieve the next page of balances. (optional)

    int? limit

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

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<PlayerCurrencyBalanceResponse>

    The operation

    IncrementPlayerCurrencyBalance(string, string, string, CurrencyModifyBalanceRequest, string, string, string, CancellationToken)

    Increment currency balance Increment a player's currency balance by a given value.

    Declaration
    public ApiOperation<CurrencyBalanceResponse> IncrementPlayerCurrencyBalance(string projectId, string playerId, string currencyId, CurrencyModifyBalanceRequest currencyModifyBalanceRequest, 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 currencyId

    Resource ID of the currency.

    CurrencyModifyBalanceRequest currencyModifyBalanceRequest
    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<CurrencyBalanceResponse>

    The operation

    SetPlayerCurrencyBalance(string, string, string, CurrencyBalanceRequest, string, string, string, CancellationToken)

    Set currency balance Set a player's currency balance.

    Declaration
    public ApiOperation<CurrencyBalanceResponse> SetPlayerCurrencyBalance(string projectId, string playerId, string currencyId, CurrencyBalanceRequest currencyBalanceRequest, 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 currencyId

    Resource ID of the currency.

    CurrencyBalanceRequest currencyBalanceRequest
    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<CurrencyBalanceResponse>

    The operation

    Implements

    IEconomyCurrenciesApi
    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)