Interface IProvidesCloudDataStorage
Defines the API for a Cloud Data Storage Provider This functionality provider is responsible for providing a storage in the cloud for
Inherited Members
Namespace: Unity.MARS
Syntax
public interface IProvidesCloudDataStorage : IFunctionalityProvider
Methods
CloudLoadAsync(String, Action<Boolean, Int64, Byte[]>, ProgressCallback)
Load from the cloud asynchronously the byte array which was saved with a known key
Declaration
void CloudLoadAsync(string key, Action<bool, long, byte[]> callback, ProgressCallback progress = null)
Parameters
Type | Name | Description |
---|---|---|
String | key | string that uniquely identifies this instance of the type. |
Action<Boolean, Int64, Byte[]> | callback | a callback which returns whether the operation was successful, as well as the response code and byte array if it was. |
ProgressCallback | progress | Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively |
CloudLoadAsync(String, Action<Boolean, Int64, String>, ProgressCallback)
Load from the cloud asynchronously the data of an object of a certain type which was saved with a known key
Declaration
void CloudLoadAsync(string key, Action<bool, long, string> callback, ProgressCallback progress = null)
Parameters
Type | Name | Description |
---|---|---|
String | key | string that uniquely identifies this instance of the type. |
Action<Boolean, Int64, String> | callback | a callback which returns whether the operation was successful, as well as the response code and serialized string of the object if it was. |
ProgressCallback | progress | Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively |
CloudSaveAsync(String, Byte[], Action<Boolean, Int64, String>, ProgressCallback)
Save to the cloud asynchronously data in a byte array with a specified key
Declaration
void CloudSaveAsync(string key, byte[] bytesObject, Action<bool, long, string> callback, ProgressCallback progress = null)
Parameters
Type | Name | Description |
---|---|---|
String | key | string that uniquely identifies this instance of the type. |
Byte[] | bytesObject | Bytes array of the object being saved |
Action<Boolean, Int64, String> | callback | a callback when the asynchronous call is done to show whether it was successful, with the response code and string. |
ProgressCallback | progress | Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively |
CloudSaveAsync(String, String, Action<Boolean, Int64, String>, ProgressCallback)
Save to the cloud asynchronously the data of an object of a certain type with a specified key
Declaration
void CloudSaveAsync(string key, string serializedObject, Action<bool, long, string> callback, ProgressCallback progress = null)
Parameters
Type | Name | Description |
---|---|---|
String | key | string that uniquely identifies this instance of the type. |
String | serializedObject | string serialization of the object being saved. |
Action<Boolean, Int64, String> | callback | a callback when the asynchronous call is done to show whether it was successful, with the response code and string. |
ProgressCallback | progress | Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively |
GetAPIKey()
Get the current authentication token
Declaration
string GetAPIKey()
Returns
Type | Description |
---|---|
String |
GetProjectIdentifier()
Set the current project identifier
Declaration
string GetProjectIdentifier()
Returns
Type | Description |
---|---|
String |
IsConnected()
Get the current state of the connection to the cloud storage
Declaration
bool IsConnected()
Returns
Type | Description |
---|---|
Boolean | True if the Cloud Storage is connected to this client, false otherwise. |
SetAPIKey(String)
Set the current authentication token
Declaration
void SetAPIKey(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key |
SetProjectIdentifier(String)
Set the current project identifier
Declaration
void SetProjectIdentifier(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id |