Interface IDataService
Namespace: Unity.Services.CloudSave.Internal
Assembly: Unity.Services.CloudSave.dll
Syntax
public interface IDataService
Properties
Custom
Declaration
ICustomDataService Custom { get; }
Property Value
Type | Description |
---|---|
ICustomDataService |
Player
Declaration
IPlayerDataService Player { get; }
Property Value
Type | Description |
---|---|
IPlayerDataService |
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
[Obsolete("This method will be removed in an upcoming release. In order to delete a key without write lock validation, call: Task CloudSaveService.Instance.Data.Player.DeleteAsync(string key)", false)]
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
[Obsolete("This method will be removed in an upcoming release. In order to save data without write lock validation, call: Task CloudSaveService.Instance.Data.Player.SaveAsync(Dictionary<string, object> data)", false)]
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
[Obsolete("This method will be removed in an upcoming release. In order to get all serialized object values, call: Task<Dictionary<string, Item>> CloudSaveService.Instance.Data.Player.LoadAllAsync() and use the GetAsString() method provided by IDeserializable on Item.Value", false)]
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
[Obsolete("This method will be removed in an upcoming release. In order to get a serialized object value, call: Task<Dictionary<string, Item>> CloudSaveService.Instance.Data.Player.LoadAsync(ISet<string> keys) and use the GetAsString() method provided by IDeserializable on Item.Value", false)]
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
[Obsolete("This method will be removed in an upcoming release. In order to retrieve keys, call: Task<List<ItemKey>> CloudSaveService.Instance.Data.Player.ListAllKeysAsync() and use ItemKey.Key to get the string value for each key", false)]
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. |