Class LeaderboardsApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.Leaderboards
Assembly: Unity.Services.Apis.dll
Syntax
public class LeaderboardsApi : ILeaderboardsApi, IApiAccessor
Constructors
LeaderboardsApi(IApiClient)
Initializes a new instance of the Leaderboards
Declaration
public LeaderboardsApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
LeaderboardsApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Leaderboards
Declaration
public LeaderboardsApi(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
AddLeaderboardPlayerScore(string, string, string, AddLeaderboardScore, CancellationToken)
Add Player Score Add score for the specified player to the specified leaderboard.
Declaration
public ApiOperation<LeaderboardEntryWithUpdatedTime> AddLeaderboardPlayerScore(string projectId, string leaderboardId, string playerId, AddLeaderboardScore addLeaderboardScore = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | playerId | ID of the player |
Add |
addLeaderboardScore | (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 |
GetLeaderboardPlayerScore(string, string, string, bool?, CancellationToken)
Get Player Score Get score and rank for the specified player in the specified leaderboard.
Declaration
public ApiOperation<LeaderboardEntryWithUpdatedTime> GetLeaderboardPlayerScore(string projectId, string leaderboardId, string playerId, bool? includeMetadata = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | playerId | ID of the player |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardScores(string, string, bool?, int?, int?, CancellationToken)
Get Scores Get list of scores and ranks for the specified leaderboard, with specified pagination.
Declaration
public ApiOperation<LeaderboardScoresPage> GetLeaderboardScores(string projectId, string leaderboardId, bool? includeMetadata = null, int? offset = null, int? limit = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
int? | offset | The number of entries to skip when retrieving the leaderboard scores. Defaults to 0 (optional) |
int? | limit | The number of leaderboard scores to return. Defaults to 10 (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardScoresByPlayerIds(string, string, bool?, LeaderboardPlayerIds, CancellationToken)
Get Scores By PlayerIds Get list of scores and ranks for the specified leaderboard, with specified playerIds.
Declaration
public ApiOperation<LeaderboardScoresWithNotFoundPlayerIds> GetLeaderboardScoresByPlayerIds(string projectId, string leaderboardId, bool? includeMetadata = null, LeaderboardPlayerIds leaderboardPlayerIds = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
Leaderboard |
leaderboardPlayerIds | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardScoresByPlayerIdsArchiveVersion(string, string, string, bool?, LeaderboardPlayerIds, CancellationToken)
Get Scores By PlayerIds for Archived Leaderboard Get list of scores and ranks for an archived leaderboard, with specified playerIds.
Declaration
public ApiOperation<LeaderboardVersionScoresByPlayerIds> GetLeaderboardScoresByPlayerIdsArchiveVersion(string projectId, string leaderboardId, string versionId, bool? includeMetadata = null, LeaderboardPlayerIds leaderboardPlayerIds = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | versionId | ID of the leaderboard version |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
Leaderboard |
leaderboardPlayerIds | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardScoresByTier(string, string, string, bool?, int?, int?, CancellationToken)
Get Scores By Tier Get list of scores and ranks for the specified leaderboard, within the specified tier, with specified pagination.
Declaration
public ApiOperation<LeaderboardTierScoresPage> GetLeaderboardScoresByTier(string projectId, string leaderboardId, string tierId, bool? includeMetadata = null, int? offset = null, int? limit = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | tierId | ID of the leaderboard tier. |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
int? | offset | The number of entries to skip when retrieving the leaderboard scores. Defaults to 0 (optional) |
int? | limit | The number of leaderboard scores to return. Defaults to 10 (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardScoresPlayerRange(string, string, string, bool?, int?, CancellationToken)
Get Player Range Get the list of neighbouring players for the specified player Id.
Declaration
public ApiOperation<LeaderboardScores> GetLeaderboardScoresPlayerRange(string projectId, string leaderboardId, string playerId, bool? includeMetadata = null, int? rangeLimit = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | playerId | ID of the player |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
int? | rangeLimit | The number of entries either side of the player to retrieve. Defaults to 5. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardVersionPlayerScore(string, string, string, string, bool?, CancellationToken)
Get Archived Version Player Score Get score and rank for the specified player in the specified archived leaderboard version.
Declaration
public ApiOperation<LeaderboardVersionEntry> GetLeaderboardVersionPlayerScore(string projectId, string leaderboardId, string versionId, string playerId, bool? includeMetadata = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | versionId | ID of the leaderboard version |
string | playerId | ID of the player |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardVersionScores(string, string, string, bool?, int?, int?, CancellationToken)
Get Archived Version Scores Get list of scores and ranks for the specified archived leaderboard version, with specified pagination.
Declaration
public ApiOperation<LeaderboardVersionScoresPage> GetLeaderboardVersionScores(string projectId, string leaderboardId, string versionId, bool? includeMetadata = null, int? offset = null, int? limit = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | versionId | ID of the leaderboard version |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
int? | offset | The number of entries to skip when retrieving the leaderboard scores. Defaults to 0 (optional) |
int? | limit | The number of leaderboard scores to return. Defaults to 10 (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardVersionScoresByTier(string, string, string, string, bool?, int?, int?, CancellationToken)
Get Archived Version Scores By Tier Get list of scores and ranks for the specified archived leaderboard version, within the specified tier, with specified pagination.
Declaration
public ApiOperation<LeaderboardVersionTierScoresPage> GetLeaderboardVersionScoresByTier(string projectId, string leaderboardId, string versionId, string tierId, bool? includeMetadata = null, int? offset = null, int? limit = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | versionId | ID of the leaderboard version |
string | tierId | ID of the leaderboard tier. |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
int? | offset | The number of entries to skip when retrieving the leaderboard scores. Defaults to 0 (optional) |
int? | limit | The number of leaderboard scores to return. Defaults to 10 (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardVersionScoresPlayerRange(string, string, string, string, bool?, int?, CancellationToken)
Get Player Range for Archived Leaderboard Get the list of neighbouring players for the specified player Id for an archived Leaderboard.
Declaration
public ApiOperation<LeaderboardVersionRange> GetLeaderboardVersionScoresPlayerRange(string projectId, string leaderboardId, string versionId, string playerId, bool? includeMetadata = null, int? rangeLimit = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
string | versionId | ID of the leaderboard version |
string | playerId | ID of the player |
bool? | includeMetadata | True/false to determine whether to include metadata. (optional) |
int? | rangeLimit | The number of entries either side of the player to retrieve. Defaults to 5. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLeaderboardVersions(string, string, int?, CancellationToken)
Get Archived Versions Get list of archived leaderboard versions for the specified leaderboard, with specified pagination.
Declaration
public ApiOperation<LeaderboardVersions> GetLeaderboardVersions(string projectId, string leaderboardId, int? limit = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project's Project ID |
string | leaderboardId | ID of the leaderboard |
int? | limit | The number of leaderboard versions to return. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |