Class UGCPlayerApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.UGC
Assembly: solution.dll
Syntax
public class UGCPlayerApi : IUGCPlayerApi, IApiAccessor
Constructors
UGCPlayerApi(IApiClient)
Initializes a new instance of the UGCPlayerApi class using a Configuration object and client instance.
Declaration
public UGCPlayerApi(IApiClient apiClient)
Parameters
| Type | Name | Description |
|---|---|---|
| IApiClient | apiClient | The client interface for synchronous API access. |
UGCPlayerApi(IApiClient, IApiConfiguration)
Initializes a new instance of the UGCPlayerApi class using a Configuration object and client instance.
Declaration
public UGCPlayerApi(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
BanPlayer(string, string, BanPlayerRequest, CancellationToken)
Ban a player from doing any actions
Declaration
public ApiOperation<BannedPlayerDTO> BanPlayer(string projectId, string environmentId, BanPlayerRequest banPlayerRequest = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | The project for this player |
| string | environmentId | The environment for this player |
| BanPlayerRequest | banPlayerRequest | Reason for the ban (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<BannedPlayerDTO> | The operation |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
| Type | Description |
|---|---|
| string | The base path |
GetPlayerStatistics(string, string, CancellationToken)
Get Current Player Statistics
Declaration
public ApiOperation<PlayerStatisticsDTO> GetPlayerStatistics(string projectId, string environmentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | |
| string | environmentId | |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<PlayerStatisticsDTO> | The operation |
UnbanPlayer(string, string, UnbanPlayerRequest, CancellationToken)
Unban a previously banned player
Declaration
public ApiOperation UnbanPlayer(string projectId, string environmentId, UnbanPlayerRequest unbanPlayerRequest = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | The project for this player |
| string | environmentId | The environment for this player |
| UnbanPlayerRequest | unbanPlayerRequest | The playerId of the player (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation | The operation |