Class FriendsPresenceApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.Friends
Assembly: Unity.Services.Apis.dll
Syntax
public class FriendsPresenceApi : IFriendsPresenceApi, IApiAccessor
Constructors
FriendsPresenceApi(IApiClient)
Initializes a new instance of the Friends
Declaration
public FriendsPresenceApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
FriendsPresenceApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Friends
Declaration
public FriendsPresenceApi(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
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
GetPresence(string, CancellationToken)
Get presence for a user. Retrieves the presence data for a specific user. If the caller is a user, then the target user must be one that the caller has an active FRIEND
relationship with.
Declaration
public ApiOperation<UserPresence> GetPresence(string userId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | userId | The userID. |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
SetPresence(PresenceRequest, CancellationToken)
Set presence for a user. Updates the presence data for a user. This can be either or both of the availability and the activity. Updates to the presence for a user will be pushed to all users with active FRIEND relationships with that user.
Declaration
public ApiOperation<UserPresence> SetPresence(PresenceRequest presenceRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Presence |
presenceRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |