Interface ICloudSaveDataClient
Namespace: Unity.Services.CloudSave
Syntax
public interface ICloudSaveDataClient
Methods
ForceDeleteAsync(String)
Removes one key at the time. If a given key doesn't exist, there is no feedback in place to inform a developer about it. There is no client validation implemented for this method. Throws a CloudSaveException with a reason code and explanation of what happened.
Declaration
Task ForceDeleteAsync(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key to be removed from the server |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
CloudSaveException | Thrown if request is unsuccessful. |
CloudSaveValidationException | Thrown if the service returned validation error. |
CloudSaveRateLimitedException | Thrown if the service returned rate limited error. |
ForceSaveAsync(Dictionary<String, Object>)
Upload one or more key-value pairs to the Cloud Save service, overwriting any values that are currently stored under the given keys. Throws a CloudSaveException with a reason code and explanation of what happened.
Dictionary
as a parameter ensures the uniqueness of given keys.
There is no client validation in place, which means the API can be called regardless if data is incorrect and/or missing.
Declaration
Task ForceSaveAsync(Dictionary<string, object> data)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<String, Object> | data | The dictionary of keys and corresponding values to upload |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
CloudSaveException | Thrown if request is unsuccessful. |
CloudSaveValidationException | Thrown if the service returned validation error. |
CloudSaveRateLimitedException | Thrown if the service returned rate limited error. |
LoadAllAsync()
Downloads all data from Cloud Save. There is no client validation in place. This method includes pagination. Throws a CloudSaveException with a reason code and explanation of what happened.
Declaration
Task<Dictionary<string, string>> LoadAllAsync()
Returns
Type | Description |
---|---|
Task<Dictionary<String, String>> | The dictionary of all key-value pairs that represents the current state of data on the server |
Exceptions
Type | Condition |
---|---|
CloudSaveException | Thrown if request is unsuccessful. |
CloudSaveValidationException | Thrown if the service returned validation error. |
CloudSaveRateLimitedException | Thrown if the service returned rate limited error. |
LoadAsync(HashSet<String>)
Downloads one or more values from Cloud Save, based on provided keys.
HashSet
as a parameter ensures the uniqueness of keys.
There is no client validation in place. This method includes pagination. Throws a CloudSaveException with a reason code and explanation of what happened.
Declaration
Task<Dictionary<string, string>> LoadAsync(HashSet<string> keys = null)
Parameters
Type | Name | Description |
---|---|---|
HashSet<String> | keys | The HashSet of keys to download from the server |
Returns
Type | Description |
---|---|
Task<Dictionary<String, String>> | The dictionary of key-value pairs that represents the current state of data on the server |
Exceptions
Type | Condition |
---|---|
CloudSaveException | Thrown if request is unsuccessful. |
CloudSaveValidationException | Thrown if the service returned validation error. |
CloudSaveRateLimitedException | Thrown if the service returned rate limited error. |
RetrieveAllKeysAsync()
Returns all keys stored in Cloud Save for the logged in player. Throws a CloudSaveException with a reason code and explanation of what happened.
This method includes pagination.
Declaration
Task<List<string>> RetrieveAllKeysAsync()
Returns
Type | Description |
---|---|
Task<List<String>> | A list of keys stored in the server for the logged in player. |
Exceptions
Type | Condition |
---|---|
CloudSaveException | Thrown if request is unsuccessful. |
CloudSaveValidationException | Thrown if the service returned validation error. |
CloudSaveRateLimitedException | Thrown if the service returned rate limited error. |