docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IPlayerDataService

    Namespace: Unity.Services.CloudSave.Internal
    Assembly: Unity.Services.CloudSave.dll
    Syntax
    public interface IPlayerDataService

    Methods

    DeleteAllAsync()

    Removes all keys for the player without write lock validation. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task DeleteAllAsync()
    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    DeleteAllAsync(DeleteAllOptions)

    Removes all keys for the player without write lock validation. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task DeleteAllAsync(DeleteAllOptions options)
    Parameters
    Type Name Description
    DeleteAllOptions options

    Options to modify the behavior of the method, specifying AccessClass and PlayerId

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    DeleteAsync(string, DeleteOptions)

    Removes one key at a time, with optional write lock validation. If the given key doesn't exist, there is no feedback in place to inform a developer about it. If a write lock is provided and it does not match with the existing write lock, will throw a conflict exception. There is no client validation on the arguments for this method. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    [Obsolete("The interface provided by CloudSaveService.Instance.Data.Player.DeleteAsync(string key, Unity.Services.CloudSave.DeleteOptions deleteOptions) has been replaced by CloudSaveService.Instance.Data.Player.DeleteAsync(string key, Unity.Services.CloudSave.Models.Data.Player.DeleteOptions options), and should be accessed from there instead. This API will be removed in an upcoming release.", false)]
    Task DeleteAsync(string key, DeleteOptions deleteOptions = null)
    Parameters
    Type Name Description
    string key

    The key to be removed from the server

    DeleteOptions deleteOptions

    The optional options object for specifying the write lock to check conflict in 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.

    CloudSaveConflictException

    Thrown if the service returned write lock conflict error.

    DeleteAsync(string, DeleteOptions)

    Removes one key at a time, with optional write lock validation. If the given key doesn't exist, there is no feedback in place to inform a developer about it. If a write lock is provided and it does not match with the existing write lock, will throw a conflict exception. There is no client validation on the arguments for this method. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task DeleteAsync(string key, DeleteOptions options)
    Parameters
    Type Name Description
    string key

    The key to be removed from the server

    DeleteOptions options

    The optional options object for specifying the write lock to check conflict in the server, as well as AccessClass

    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.

    CloudSaveConflictException

    Thrown if the service returned write lock conflict error.

    ListAllKeysAsync()

    Returns all keys stored in Cloud Save for the logged in player. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task<List<ItemKey>> ListAllKeysAsync()
    Returns
    Type Description
    Task<List<ItemKey>>

    A list of keys and their metadata as 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.

    ListAllKeysAsync(ListAllKeysOptions)

    Returns all keys stored in Cloud Save for the logged in player. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task<List<ItemKey>> ListAllKeysAsync(ListAllKeysOptions options)
    Parameters
    Type Name Description
    ListAllKeysOptions options

    Options to modify the behavior of the method, specifying AccessClass and PlayerId

    Returns
    Type Description
    Task<List<ItemKey>>

    A list of keys and their metadata as 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.

    LoadAllAsync()

    Downloads data from Cloud Save for all keys. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task<Dictionary<string, Item>> LoadAllAsync()
    Returns
    Type Description
    Task<Dictionary<string, Item>>

    The dictionary of all key-value pairs that represents the current state of data on the server including their write locks

    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(LoadAllOptions)

    Downloads data from Cloud Save for all keys. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task<Dictionary<string, Item>> LoadAllAsync(LoadAllOptions options)
    Parameters
    Type Name Description
    LoadAllOptions options

    Options to modify the behavior of the method, specifying AccessClass and PlayerId

    Returns
    Type Description
    Task<Dictionary<string, Item>>

    The dictionary of all key-value pairs that represents the current state of data on the server including their write locks

    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(ISet<string>)

    Downloads data from Cloud Save for the keys provided. There is no client validation in place for the provided keys. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task<Dictionary<string, Item>> LoadAsync(ISet<string> keys)
    Parameters
    Type Name Description
    ISet<string> keys

    The optional set of keys to load data for

    Returns
    Type Description
    Task<Dictionary<string, Item>>

    The dictionary of all key-value pairs that represents the current state of data on the server including their write locks

    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(ISet<string>, LoadOptions)

    Downloads data from Cloud Save for the keys provided. There is no client validation in place for the provided keys. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task<Dictionary<string, Item>> LoadAsync(ISet<string> keys, LoadOptions options)
    Parameters
    Type Name Description
    ISet<string> keys

    The optional set of keys to load data for

    LoadOptions options

    Options to modify the behavior of the method, specifying AccessClass and PlayerId

    Returns
    Type Description
    Task<Dictionary<string, Item>>

    The dictionary of all key-value pairs that represents the current state of data on the server including their write locks

    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.

    QueryAsync(Query, QueryOptions)

    Queries indexed player data from Cloud Save, and returns the requested keys for matching items. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    Task<List<EntityData>> QueryAsync(Query query, QueryOptions options)
    Parameters
    Type Name Description
    Query query
    QueryOptions options

    The query conditions to apply, including field filters and sort orders

    Returns
    Type Description
    Task<List<EntityData>>

    The dictionary of all key-value pairs that represents the current state of data on the server including their write locks

    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.

    SaveAsync(IDictionary<string, object>)

    Upload one or more key-value pairs to the Cloud Save service without write lock validation, overwriting any values that are currently stored under the given keys. Key can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. 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, invalid, and/or missing.

    Declaration
    Task<Dictionary<string, string>> SaveAsync(IDictionary<string, object> data)
    Parameters
    Type Name Description
    IDictionary<string, object> data

    The dictionary of keys and corresponding values to upload

    Returns
    Type Description
    Task<Dictionary<string, string>>

    The dictionary of saved keys and the corresponding updated write lock

    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.

    SaveAsync(IDictionary<string, object>, SaveOptions)

    Upload one or more key-value pairs to the Cloud Save service without write lock validation, overwriting any values that are currently stored under the given keys. Key can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. 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, invalid, and/or missing.

    Declaration
    Task<Dictionary<string, string>> SaveAsync(IDictionary<string, object> data, SaveOptions options)
    Parameters
    Type Name Description
    IDictionary<string, object> data

    The dictionary of keys and corresponding values to upload

    SaveOptions options

    Options to modify the behavior of the method, specifying AccessClass

    Returns
    Type Description
    Task<Dictionary<string, string>>

    The dictionary of saved keys and the corresponding updated write lock

    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.

    SaveAsync(IDictionary<string, SaveItem>)

    Upload one or more key-value pairs to the Cloud Save service, with optional write lock validation. If a write lock is provided on an item and it does not match with the existing write lock, will throw a conflict exception. If the write lock for an item is set to null, the write lock validation for that item will be skipped and any existing value currently stored for that key will be overwritten. Keys can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. 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 or keys are incorrect, invalid, and/or missing.

    Declaration
    Task<Dictionary<string, string>> SaveAsync(IDictionary<string, SaveItem> data)
    Parameters
    Type Name Description
    IDictionary<string, SaveItem> data

    The dictionary of keys and corresponding values to upload, together with optional write lock to check conflict

    Returns
    Type Description
    Task<Dictionary<string, string>>

    The dictionary of saved keys and the corresponding updated write lock

    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.

    CloudSaveConflictException

    Thrown if the service returned write lock conflict error.

    SaveAsync(IDictionary<string, SaveItem>, SaveOptions)

    Upload one or more key-value pairs to the Cloud Save service, with optional write lock validation. If a write lock is provided on an item and it does not match with the existing write lock, will throw a conflict exception. If the write lock for an item is set to null, the write lock validation for that item will be skipped and any existing value currently stored for that key will be overwritten. Keys can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. 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 or keys are incorrect, invalid, and/or missing.

    Declaration
    Task<Dictionary<string, string>> SaveAsync(IDictionary<string, SaveItem> data, SaveOptions options)
    Parameters
    Type Name Description
    IDictionary<string, SaveItem> data

    The dictionary of keys and corresponding values to upload, together with optional write lock to check conflict

    SaveOptions options

    Options to modify the behavior of the method, specifying AccessClass and PlayerId

    Returns
    Type Description
    Task<Dictionary<string, string>>

    The dictionary of saved keys and the corresponding updated write lock

    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.

    CloudSaveConflictException

    Thrown if the service returned write lock conflict error.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)