Class CloudCodeApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.CloudCode
Assembly: Unity.Services.Apis.dll
Syntax
public class CloudCodeApi : ICloudCodeApi, IApiAccessor
Constructors
CloudCodeApi(IApiClient)
Initializes a new instance of the Cloud
Declaration
public CloudCodeApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
CloudCodeApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Cloud
Declaration
public CloudCodeApi(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 |
RunModule(string, string, string, RunModuleArguments, CancellationToken)
Run module function Run a Cloud Code function from a module for a project.
Declaration
public ApiOperation<RunModuleResponse> RunModule(string projectId, string moduleName, string functionName, RunModuleArguments runModuleArguments = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | moduleName | Name of the Cloud Code module. |
string | functionName | Name of the function to invoke from the given module. |
Run |
runModuleArguments | A JSON object containing the parameters to pass to the function. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
RunScript(string, string, RunScriptArguments, CancellationToken)
Run script Run a Cloud Code script for a project.
Declaration
public ApiOperation<RunScriptResponse> RunScript(string projectId, string scriptName, RunScriptArguments runScriptArguments = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | scriptName | Name of the script. |
Run |
runScriptArguments | A JSON object containing the script run arguments. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
SubscriptionTokenPlayer(string, CancellationToken)
Create a player subscription token Create a subscription token for player messages.
Declaration
public ApiOperation<SubscriptionTokenResponse> SubscriptionTokenPlayer(string projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
SubscriptionTokenProject(string, CancellationToken)
Create a project subscription token Create a subscription token for project messages.
Declaration
public ApiOperation<SubscriptionTokenResponse> SubscriptionTokenProject(string projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |