docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IAsset

    An interface containing the information about an asset.

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

    Properties

    ArchivedLabels

    The labels no longer associated to the asset version.

    Declaration
    [Obsolete("Use AssetProperties.ArchivedLabel instead.")]
    IEnumerable<LabelDescriptor> ArchivedLabels { get; }
    Property Value
    Type Description
    IEnumerable<LabelDescriptor>

    AuthoringInfo

    The creation and update information of the asset.

    Declaration
    [Obsolete("Use AssetProperties.AuthoringInfo instead.")]
    AuthoringInfo AuthoringInfo { get; }
    Property Value
    Type Description
    AuthoringInfo

    CacheConfiguration

    The caching configuration for the asset.

    Declaration
    AssetCacheConfiguration CacheConfiguration { get; }
    Property Value
    Type Description
    AssetCacheConfiguration

    Changelog

    The change log of the asset version.

    Declaration
    [Obsolete("Use AssetProperties.Changelog instead.")]
    string Changelog { get; }
    Property Value
    Type Description
    string

    Description

    The description of the asset.

    Declaration
    [Obsolete("Use AssetProperties.Description instead.")]
    string Description { get; }
    Property Value
    Type Description
    string

    Descriptor

    The descriptor of the asset.

    Declaration
    AssetDescriptor Descriptor { get; }
    Property Value
    Type Description
    AssetDescriptor

    FrozenSequenceNumber

    The sequence number of the asset. This will only be populated if the version is frozen.

    Declaration
    [Obsolete("Use AssetProperties.FrozenSequenceNumber instead.")]
    int FrozenSequenceNumber { get; }
    Property Value
    Type Description
    int

    IsFrozen

    Whether the asset version is frozen.

    Declaration
    [Obsolete("Use AssetProperties.State instead.")]
    bool IsFrozen { get; }
    Property Value
    Type Description
    bool

    Labels

    The labels associated to the asset version.

    Declaration
    [Obsolete("Use AssetProperties.Labels instead.")]
    IEnumerable<LabelDescriptor> Labels { get; }
    Property Value
    Type Description
    IEnumerable<LabelDescriptor>

    LinkedProjects

    The list of projects the asset is linked to.

    Declaration
    [Obsolete("Use AssetProperties.LinkedProjects instead.")]
    IEnumerable<ProjectDescriptor> LinkedProjects { get; }
    Property Value
    Type Description
    IEnumerable<ProjectDescriptor>

    Metadata

    The searchable metadata of the asset.

    Declaration
    IMetadataContainer Metadata { get; }
    Property Value
    Type Description
    IMetadataContainer

    Name

    The name of the asset.

    Declaration
    [Obsolete("Use AssetProperties.Name instead.")]
    string Name { get; }
    Property Value
    Type Description
    string

    ParentFrozenSequenceNumber

    The sequence number from which this version was branched.

    Declaration
    [Obsolete("Use AssetProperties.ParentFrozenSequenceNumber instead.")]
    int ParentFrozenSequenceNumber { get; }
    Property Value
    Type Description
    int

    ParentVersion

    The version id from which this version was branched.

    Declaration
    [Obsolete("Use AssetProperties.ParentVersion instead.")]
    AssetVersion ParentVersion { get; }
    Property Value
    Type Description
    AssetVersion

    PreviewFile

    The preview file ID of the asset.

    Declaration
    [Obsolete("Use AssetProperties.PreviewFileDescriptor instead.")]
    string PreviewFile { get; }
    Property Value
    Type Description
    string

    PreviewFileDescriptor

    The descriptor for the preview file of the asset.

    Declaration
    [Obsolete("Use AssetProperties.PreviewFileDescriptor instead.")]
    FileDescriptor PreviewFileDescriptor { get; }
    Property Value
    Type Description
    FileDescriptor

    SourceProject

    The source project of the asset.

    Declaration
    [Obsolete("Use AssetProperties.SourceProject instead.")]
    ProjectDescriptor SourceProject { get; }
    Property Value
    Type Description
    ProjectDescriptor

    State

    The state of the asset.

    Declaration
    [Obsolete("Use AssetProperties.State instead.")]
    AssetState State { get; }
    Property Value
    Type Description
    AssetState

    Status

    The status of the asset.

    Declaration
    [Obsolete("Use AssetProperties.StatusName instead.")]
    string Status { get; }
    Property Value
    Type Description
    string

    StatusFlowDescriptor

    The descriptor for the status flow of the asset.

    Declaration
    [Obsolete("Use AssetProperties.StatusFlowDescriptor instead.")]
    StatusFlowDescriptor StatusFlowDescriptor { get; }
    Property Value
    Type Description
    StatusFlowDescriptor

    StatusName

    The status of the asset.

    Declaration
    [Obsolete("Use AssetProperties.StatusName instead.")]
    string StatusName { get; }
    Property Value
    Type Description
    string

    SystemMetadata

    The system metadata of the asset.

    Declaration
    IReadOnlyMetadataContainer SystemMetadata { get; }
    Property Value
    Type Description
    IReadOnlyMetadataContainer

    SystemTags

    The tags of the asset.

    Declaration
    [Obsolete("Use AssetProperties.SystemTags instead.")]
    IEnumerable<string> SystemTags { get; }
    Property Value
    Type Description
    IEnumerable<string>

    Tags

    The tags of the asset.

    Declaration
    [Obsolete("Use AssetProperties.Tags instead.")]
    IEnumerable<string> Tags { get; }
    Property Value
    Type Description
    IEnumerable<string>

    Type

    The type of the asset.

    Declaration
    [Obsolete("Use AssetProperties.Type instead.")]
    AssetType Type { get; }
    Property Value
    Type Description
    AssetType

    Methods

    AddReferenceAsync(AssetId, string, CancellationToken)

    Creates a reference between the asset and another asset, where the asset is the source of the reference.

    Declaration
    Task<IAssetReference> AddReferenceAsync(AssetId targetAssetId, string targetLabel, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AssetId targetAssetId

    The id of the asset.

    string targetLabel

    The label associated to the asset version.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IAssetReference>

    A task whose result is the reference between the assets.

    AddReferenceAsync(AssetId, AssetVersion, CancellationToken)

    Creates a reference between the asset and another asset, where the asset is the source of the reference.

    Declaration
    Task<IAssetReference> AddReferenceAsync(AssetId targetAssetId, AssetVersion targetAssetVersion, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AssetId targetAssetId

    The id of the asset.

    AssetVersion targetAssetVersion

    The version of the asset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IAssetReference>

    A task whose result is the reference between the assets.

    AssignLabelsAsync(IEnumerable<string>, CancellationToken)

    Adds labels to the asset.

    Declaration
    Task AssignLabelsAsync(IEnumerable<string> labels, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IEnumerable<string> labels

    The collection of labels to add.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    CancelPendingFreezeAsync(CancellationToken)

    If the asset is pending freeze, cancels the freeze.

    Declaration
    Task CancelPendingFreezeAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    CreateDatasetAsync(DatasetCreation, CancellationToken)

    Returns a IDataset with the specified creation information.

    Declaration
    [Obsolete("Use CreateDatasetAsync(IDatasetCreation, CancellationToken) instead.")]
    Task<IDataset> CreateDatasetAsync(DatasetCreation datasetCreation, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    DatasetCreation datasetCreation

    The object containing the necessary information to create a dataset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IDataset>

    A task whose result is the newly created dataset.

    Remarks

    Can only be called on a version that is unfrozen.

    Exceptions
    Type Condition
    InvalidArgumentException

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

    CreateDatasetAsync(IDatasetCreation, CancellationToken)

    Returns a IDataset with the specified creation information.

    Declaration
    Task<IDataset> CreateDatasetAsync(IDatasetCreation datasetCreation, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IDatasetCreation datasetCreation

    The object containing the necessary information to create a dataset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IDataset>

    A task whose result is the newly created dataset.

    Remarks

    Can only be called on a version that is unfrozen.

    Exceptions
    Type Condition
    InvalidArgumentException

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

    CreateDatasetLiteAsync(IDatasetCreation, CancellationToken)

    Returns a IDataset with the specified creation information.

    Declaration
    Task<DatasetDescriptor> CreateDatasetLiteAsync(IDatasetCreation datasetCreation, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IDatasetCreation datasetCreation

    The object containing the necessary information to create a dataset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<DatasetDescriptor>

    A task whose result is the newly created dataset.

    Remarks

    Can only be called on a version that is unfrozen.

    Exceptions
    Type Condition
    InvalidArgumentException

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

    CreateUnfrozenVersionAsync(CancellationToken)

    Creates a new unfrozen version of the asset.

    Declaration
    Task<IAsset> CreateUnfrozenVersionAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IAsset>

    A task whose result is a new version of the asset.

    Remarks

    Can only be called if the version is frozen; this version will be the parent of the new version.

    Exceptions
    Type Condition
    InvalidArgumentException

    If the asset is unfrozen, because it cannot be used as a parent for a new version.

    CreateUnfrozenVersionLiteAsync(CancellationToken)

    Creates a new unfrozen version of the asset.

    Declaration
    Task<AssetDescriptor> CreateUnfrozenVersionLiteAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<AssetDescriptor>

    A task whose result is a new version of the asset.

    Remarks

    Can only be called if the version is frozen; this version will be the parent of the new version.

    Exceptions
    Type Condition
    InvalidArgumentException

    If the asset is unfrozen, because it cannot be used as a parent for a new version.

    FreezeAsync(string, CancellationToken)

    Freezes the current version.

    Declaration
    [Obsolete("Use FreezeAsync(IAssetFreeze, CancellationToken) instead.")]
    Task<int> FreezeAsync(string changeLog, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    string changeLog

    The change log for the new version.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<int>

    A task whose result is a frozen sequence number.

    Remarks

    Can only be called on a version that is unfrozen.

    Exceptions
    Type Condition
    InvalidArgumentException

    If the asset is frozen, because it cannot be re-submitted.

    InvalidArgumentException

    If there are on-going transformations.

    FreezeAsync(IAssetFreeze, CancellationToken)

    Freezes the current version.

    Declaration
    Task FreezeAsync(IAssetFreeze assetFreeze, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IAssetFreeze assetFreeze

    The object containing information to freeze the current version.

    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 on a version that is unfrozen.

    Exceptions
    Type Condition
    InvalidArgumentException

    If the asset is frozen, because it cannot be re-submitted.

    GetAssetDownloadUrlsAsync(CancellationToken)

    Returns the download URLs for the asset's files.

    Declaration
    Task<IDictionary<string, Uri>> GetAssetDownloadUrlsAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IDictionary<string, Uri>>

    A task whose result is the download URLs for all the asset's files and attachments.

    GetDatasetAsync(DatasetId, CancellationToken)

    Retrieves the specified IDataset.

    Declaration
    Task<IDataset> GetDatasetAsync(DatasetId datasetId, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    DatasetId datasetId

    The id of the dataset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IDataset>

    A task whose result is the requested dataset.

    GetFileAsync(string, CancellationToken)

    Retrieves the specified IFile.

    Declaration
    [Obsolete("Use IDataset.GetFileAsync instead.")]
    Task<IFile> GetFileAsync(string filePath, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    string filePath

    The id of the file

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IFile>

    A task whose result is an IFile.

    GetLinkedProjectsAsync(CancellationToken)

    Returns an enumeration of the asset's linked IAssetProject.

    Declaration
    IAsyncEnumerable<IAssetProject> GetLinkedProjectsAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    IAsyncEnumerable<IAssetProject>

    A task whose result is an async enumeration of IAssetProject.

    GetPreviewUrlAsync(CancellationToken)

    Returns the url to the preview image of the asset.

    Declaration
    Task<Uri> GetPreviewUrlAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<Uri>

    A task whose result is downloadble url pointing to the preview image.

    GetPropertiesAsync(CancellationToken)

    Returns the properties of the asset.

    Declaration
    Task<AssetProperties> GetPropertiesAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<AssetProperties>

    A task whose result is the AssetProperties of the asset.

    GetReachableStatusNamesAsync(CancellationToken)

    Returns a set of reachable statuses from the current status.

    Declaration
    Task<string[]> GetReachableStatusNamesAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<string[]>

    A task whose result is an array of status names.

    LinkToProjectAsync(ProjectDescriptor, CancellationToken)

    Creates a reference between an asset and the project.

    Declaration
    [Obsolete("Use IAssetProject.LinkAssetsAsync instead.")]
    Task LinkToProjectAsync(ProjectDescriptor projectDescriptor, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    ProjectDescriptor projectDescriptor

    The descriptor of the project to link to.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    ListDatasetsAsync(Range, CancellationToken)

    Retrieves all the IDataset.

    Declaration
    IAsyncEnumerable<IDataset> ListDatasetsAsync(Range range, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Range range

    The range of datasets to return.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    IAsyncEnumerable<IDataset>

    A task whose result is an async enumeration of datasets.

    ListFilesAsync(Range, CancellationToken)

    Retrieves all the IFiles for the asset.

    Declaration
    [Obsolete("Use IDataset.ListFilesAsync instead.")]
    IAsyncEnumerable<IFile> ListFilesAsync(Range range, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Range range
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    IAsyncEnumerable<IFile>

    A task whose result is an async enumeration of IFile referenced by the asset.

    ListLinkedAssetCollectionsAsync(Range, CancellationToken)

    Returns the IAssetCollection the asset belongs too.

    Declaration
    IAsyncEnumerable<CollectionDescriptor> ListLinkedAssetCollectionsAsync(Range range, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Range range

    The range of collections to return.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    IAsyncEnumerable<CollectionDescriptor>

    An async enumeration of IAssetCollection.

    ListReferencesAsync(Range, CancellationToken)

    Returns references to the asset.

    Declaration
    IAsyncEnumerable<IAssetReference> ListReferencesAsync(Range range, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Range range

    The range of results to return.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    IAsyncEnumerable<IAssetReference>

    An async enumeration of IAssetReference.

    ListVersionsAsync(Range, CancellationToken)

    Returns the versions of the asset.

    Declaration
    IAsyncEnumerable<IAsset> ListVersionsAsync(Range range, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Range range

    The range of results to return.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    IAsyncEnumerable<IAsset>

    An async enumeration of IAsset in descending order of FrozenSequenceNumber. Unfrozen assets will be listed last.

    QueryLabels()

    Returns an object that can be used to query asset labels across versions.

    Declaration
    AssetLabelQueryBuilder QueryLabels()
    Returns
    Type Description
    AssetLabelQueryBuilder

    A AssetLabelQueryBuilder.

    QueryVersions()

    Returns an object that can be used to query the asset's versions.

    Declaration
    [Obsolete("Use ListVersionsAsync or IAssetProject.QueryAssetVersions instead.")]
    VersionQueryBuilder QueryVersions()
    Returns
    Type Description
    VersionQueryBuilder

    A VersionQueryBuilder.

    RefreshAsync(CancellationToken)

    Fetches the latest changes.

    Declaration
    Task RefreshAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    RemoveReferenceAsync(string, CancellationToken)

    Removes a reference between the asset and another asset. The asset can be either the source or the target.

    Declaration
    Task RemoveReferenceAsync(string referenceId, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    string referenceId

    The id of the reference between the assets.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    Serialize()

    Returns a JSON string of the asset.

    Declaration
    [Obsolete("IAsset serialization is no longer supported.")]
    string Serialize()
    Returns
    Type Description
    string

    The asset serialized as a JSON string.

    Remarks

    To deserialize the asset use DeserializeAsset(string). The IAssetRepository is responsible for injecting the necessary dependencies into the asset.

    SerializeIdentifiers()

    Returns a JSON serialized string of the asset's identifiers.

    Declaration
    [Obsolete("Use Descriptor.ToJson() instead.")]
    string SerializeIdentifiers()
    Returns
    Type Description
    string

    The serialized identifiers of the asset.

    UnassignLabelsAsync(IEnumerable<string>, CancellationToken)

    Remove labels from the asset.

    Declaration
    Task UnassignLabelsAsync(IEnumerable<string> labels, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IEnumerable<string> labels

    The collection of labels to remove.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    UnlinkFromProjectAsync(ProjectDescriptor, CancellationToken)

    Removes the reference between an asset and the project.

    Declaration
    [Obsolete("Use IAssetProject.UnlinkAssetsAsync instead.")]
    Task UnlinkFromProjectAsync(ProjectDescriptor projectDescriptor, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    ProjectDescriptor projectDescriptor

    The descriptor of the project to unlink from.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    UpdateAsync(IAssetUpdate, CancellationToken)

    Updates the asset.

    Declaration
    Task UpdateAsync(IAssetUpdate assetUpdate, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IAssetUpdate assetUpdate

    The object containing information to update this version of the asset.

    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 on a version that is unfrozen.

    Exceptions
    Type Condition
    InvalidArgumentException

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

    UpdateStatusAsync(string, CancellationToken)

    Updates the asset's status.

    Declaration
    Task UpdateStatusAsync(string statusName, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    string statusName

    The name of the status.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    Remarks

    The status of an asset can be updated whether an asset is frozen or unfrozen. However, note that the reachable statuses may vary based on the state of the asset.

    UpdateStatusAsync(AssetStatusAction, CancellationToken)

    Updates the asset's status.

    Declaration
    [Obsolete("Use UpdateStatus(string, CancellationToken) instead.")]
    Task UpdateStatusAsync(AssetStatusAction statusAction, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AssetStatusAction statusAction

    The new status of the asset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task

    A task with no result.

    WithCacheConfigurationAsync(AssetCacheConfiguration, CancellationToken)

    Returns an asset configured with the specified caching configurations.

    Declaration
    Task<IAsset> WithCacheConfigurationAsync(AssetCacheConfiguration assetConfiguration, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AssetCacheConfiguration assetConfiguration

    The caching configuration for the asset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IAsset>

    A task whose result is an IAsset with cached values specified by the caching configurations.

    WithProject(ProjectDescriptor)

    Returns an asset in the context of the specified project.

    Declaration
    [Obsolete("Use WithProjectAsync instead.")]
    IAsset WithProject(ProjectDescriptor projectDescriptor)
    Parameters
    Type Name Description
    ProjectDescriptor projectDescriptor

    The descriptor of the project.

    Returns
    Type Description
    IAsset

    A copy of the asset with a different parent project.

    WithProjectAsync(ProjectDescriptor, CancellationToken)

    Changes the path of the asset to the specified project.

    Declaration
    Task<IAsset> WithProjectAsync(ProjectDescriptor projectDescriptor, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    ProjectDescriptor projectDescriptor

    The descriptor of the project.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IAsset>

    A task whose result is the IAsset with the specified project path.

    WithVersionAsync(string, CancellationToken)

    Switches the asset to the specified version.

    Declaration
    Task<IAsset> WithVersionAsync(string label, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    string label

    The label associated to the version of the asset.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IAsset>

    A task whose result is the IAsset with the version attributed to the specified label.

    WithVersionAsync(AssetVersion, CancellationToken)

    Switches the asset to the specified version.

    Declaration
    Task<IAsset> WithVersionAsync(AssetVersion assetVersion, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AssetVersion assetVersion

    The version of the asset to fetch.

    CancellationToken cancellationToken

    A token that can be used to cancel the request.

    Returns
    Type Description
    Task<IAsset>

    A task whose result is the IAsset with the specified version.

    Extension Methods

    AssetExtensions.AddReferenceAsync(IAsset, AssetDescriptor, CancellationToken)
    AssetExtensions.AddTagsAsync(IAsset, IEnumerable<string>, CancellationToken)
    AssetExtensions.GetPreviewDatasetAsync(IAsset, CancellationToken)
    AssetExtensions.GetSourceDatasetAsync(IAsset, CancellationToken)
    AssetExtensions.RemoveTagsAsync(IAsset, IEnumerable<string>, CancellationToken)
    AssetExtensions.WithLatestVersionAsync(IAsset, CancellationToken)
    AssetExtensions.WithVersionAsync(IAsset, int, CancellationToken)
    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)