Class CloudSaveFilesApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.CloudSave
Assembly: Unity.Services.Apis.dll
Syntax
public class CloudSaveFilesApi : ICloudSaveFilesApi, IApiAccessor
Constructors
CloudSaveFilesApi(IApiClient)
Initializes a new instance of the Cloud
Declaration
public CloudSaveFilesApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
CloudSaveFilesApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Cloud
Declaration
public CloudSaveFilesApi(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
DeleteFile(string, string, string, string, CancellationToken)
Delete Player File Deletes the specified player file. If a WriteLock is provided, the file will only be deleted if it matches the stored WriteLock.
Declaration
public ApiOperation DeleteFile(string projectId, string playerId, string key, string writeLock = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | The player ID supplied by the Authorization service. |
string | key | Item key. |
string | writeLock | Enforces conflict checking when deleting an existing file. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
GetDownloadUrl(string, string, string, CancellationToken)
Get Player File Download URL Generates a signed URL that will allow the client to download the requested player file for a limited period of time. If successful, an object will be returned containing all necessary information to perform the download.
Declaration
public ApiOperation<SignedUrlResponse> GetDownloadUrl(string projectId, string playerId, string key, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | The player ID supplied by the Authorization service. |
string | key | Item key. |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetFileMetadata(string, string, string, CancellationToken)
Get Player File Metadata Retrieves the metadata (size, date last modified and created, key, content type, and current WriteLock) of a single player file.
Declaration
public ApiOperation<FileItem> GetFileMetadata(string projectId, string playerId, string key, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | The player ID supplied by the Authorization service. |
string | key | Item key. |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetUploadUrl(string, string, string, FileDetails, CancellationToken)
Get Player File upload URL Initiates the player file upload process and returns a URL to which the actual file contents can be uploaded. The type, length and MD5 hash of the file have to be provided up-front. If successful, an object will be returned containing all necessary information to perform the upload.
Declaration
public ApiOperation<SignedUrlResponse> GetUploadUrl(string projectId, string playerId, string key, FileDetails fileDetails = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | The player ID supplied by the Authorization service. |
string | key | Item key. |
File |
fileDetails | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
ListPlayerFiles(string, string, string, CancellationToken)
List Player Files Retrieves a list of names of all the files currently saved in storage for a player along with size (in bytes), last date modified and current WriteLock. Ordered alphabetically in page sizes of 20.
Declaration
public ApiOperation<FileList> ListPlayerFiles(string projectId, string playerId, string after = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | The player ID supplied by the Authorization service. |
string | after | The key after which to retrieve the next page of files. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |