docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PlayerNamesApi

    Represents a collection of functions to interact with the API endpoints

    Inheritance
    object
    PlayerNamesApi
    Implements
    IPlayerNamesApi
    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.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

    Implements

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