Class PlayerNamesApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.PlayerNames
Assembly: solution.dll
Syntax
public class PlayerNamesApi : IPlayerNamesApi, IApiAccessor
Constructors
PlayerNamesApi(IApiClient)
Initializes a new instance of the PlayerNamesApi class using a Configuration object and client instance.
Declaration
public PlayerNamesApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApiClient | apiClient | The client interface for synchronous API access. |
PlayerNamesApi(IApiClient, IApiConfiguration)
Initializes a new instance of the PlayerNamesApi class using a Configuration object and client instance.
Declaration
public PlayerNamesApi(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
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
GetName(string, bool?, bool?, CancellationToken)
Get a player's name. Get a player's name. The '/me' endpoint can be used to get the name of the calling player.
Declaration
public ApiOperation<Player> GetName(string playerId, bool? autoGenerate = null, bool? showMetadata = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | playerId | The player's ID. |
bool? | autoGenerate | Indicates if a player without a name should have one auto generated or not. Defaults to true. (optional) |
bool? | showMetadata | If true, returns additional metadata like 'autoGenerated' with records. Defaults to false. (optional) |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
ApiOperation<Player> | The operation |
UpdateName(string, UpdateNameRequest, CancellationToken)
Update a player's name. Update a player's name, or create it if it doesn't exist. White space is not allowed in the name, and a random numeric suffix will automatically be added to it.
Declaration
public ApiOperation<Player> UpdateName(string playerId, UpdateNameRequest updateNameRequest, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | playerId | The player's ID. |
UpdateNameRequest | updateNameRequest | |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
ApiOperation<Player> | The operation |