docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IMetadataContainer

    Namespace: Unity.Cloud.Assets
    Assembly: Unity.Cloud.Assets.dll
    Syntax
    public interface IMetadataContainer

    Methods

    AddOrUpdateAsync(IReadOnlyDictionary<string, MetadataValue>, CancellationToken)

    Adds or updates the specified fields in the metadata dictionary.

    Declaration
    Task AddOrUpdateAsync(IReadOnlyDictionary<string, MetadataValue> metadataObjects, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IReadOnlyDictionary<string, MetadataValue> metadataObjects

    A collection of metadata values to add or update.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    Remarks

    Can only be called if the version of the asset is unfrozen.

    Exceptions
    Type Condition
    ArgumentException

    If the type of a dictionary value is not recognized as valid metadata type.

    InvalidArgumentException

    If this version of the asset is frozen, because it cannot be modified.

    AddOrUpdateAsync(string, MetadataValue, CancellationToken)

    Adds or updates the specified field in the metadata dictionary.

    Declaration
    Task AddOrUpdateAsync(string key, MetadataValue metadataValue, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    string key

    The FieldKey of a corresponding IFieldDefinition.

    MetadataValue metadataValue

    The value of the field.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    Remarks

    Can only be called if the version of the asset is unfrozen.

    Exceptions
    Type Condition
    ArgumentException

    If metadataValue type is not a valid metadata type.

    InvalidArgumentException

    If this version of the asset is frozen, because it cannot be modified.

    Query()

    Returns a MetadataQueryBuilder for filtering and fetching metadata.

    Declaration
    MetadataQueryBuilder Query()
    Returns
    Type Description
    MetadataQueryBuilder

    A MetadataQueryBuilder for defining and executing queries.

    RemoveAsync(IEnumerable<string>, CancellationToken)

    Removes the specified fields from the metadata dictionary.

    Declaration
    Task RemoveAsync(IEnumerable<string> keys, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IEnumerable<string> keys

    The keys to remove from this dictionary.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    Remarks

    Can only be called if the version of the asset is unfrozen.

    Exceptions
    Type Condition
    InvalidArgumentException

    If this version of the asset is frozen, because it cannot be modified.

    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)