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
IEnumerable<LabelDescriptor> ArchivedLabels { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Label |
AuthoringInfo
The creation and update information of the asset.
Declaration
AuthoringInfo AuthoringInfo { get; }
Property Value
Type | Description |
---|---|
Authoring |
Changelog
The change log of the asset version.
Declaration
string Changelog { get; }
Property Value
Type | Description |
---|---|
string |
Description
The description of the asset.
Declaration
string Description { get; }
Property Value
Type | Description |
---|---|
string |
Descriptor
The descriptor of the asset.
Declaration
AssetDescriptor Descriptor { get; }
Property Value
Type | Description |
---|---|
Asset |
FrozenSequenceNumber
The sequence number of the asset. This will only be populated if the version is frozen.
Declaration
int FrozenSequenceNumber { get; }
Property Value
Type | Description |
---|---|
int |
IsFrozen
Whether the asset version is frozen.
Declaration
bool IsFrozen { get; }
Property Value
Type | Description |
---|---|
bool |
Labels
The labels associated to the asset version.
Declaration
IEnumerable<LabelDescriptor> Labels { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Label |
LinkedProjects
The list of projects the asset is linked to.
Declaration
IEnumerable<ProjectDescriptor> LinkedProjects { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Project |
Metadata
The searchable metadata of the asset.
Declaration
IMetadataContainer Metadata { get; }
Property Value
Type | Description |
---|---|
IMetadata |
Name
The name of the asset.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
ParentFrozenSequenceNumber
The sequence number from which this version was branched.
Declaration
int ParentFrozenSequenceNumber { get; }
Property Value
Type | Description |
---|---|
int |
ParentVersion
The version id from which this version was branched.
Declaration
AssetVersion ParentVersion { get; }
Property Value
Type | Description |
---|---|
Asset |
PreviewFile
The preview file ID of the asset.
Declaration
string PreviewFile { get; }
Property Value
Type | Description |
---|---|
string |
SourceProject
The source project of the asset.
Declaration
ProjectDescriptor SourceProject { get; }
Property Value
Type | Description |
---|---|
Project |
Status
The status of the asset.
Declaration
string Status { get; }
Property Value
Type | Description |
---|---|
string |
SystemMetadata
The system metadata of the asset.
Declaration
IReadOnlyMetadataContainer SystemMetadata { get; }
Property Value
Type | Description |
---|---|
IRead |
SystemTags
The tags of the asset.
Declaration
IEnumerable<string> SystemTags { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
Tags
The tags of the asset.
Declaration
IEnumerable<string> Tags { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
Type
The type of the asset.
Declaration
AssetType Type { get; }
Property Value
Type | Description |
---|---|
Asset |
Methods
AssignLabelsAsync(IEnumerable<string>, CancellationToken)
Adds labels to this asset.
Declaration
Task AssignLabelsAsync(IEnumerable<string> labels, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | labels | The collection of labels to add. |
Cancellation |
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
Task<IDataset> CreateDatasetAsync(DatasetCreation datasetCreation, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Dataset |
datasetCreation | The object containing the necessary information to create a dataset. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Remarks
Can only be called on a version that is not frozen.
Exceptions
Type | Condition |
---|---|
Invalid |
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 |
---|---|---|
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Remarks
Can only be called if the version is frozen; this version will be the parent of the new version.
Exceptions
Type | Condition |
---|---|
Invalid |
If the asset is unfrozen, because it cannot be used as a parent for a new version. |
FreezeAsync(string, CancellationToken)
Submits the asset to freeze the current version.
Declaration
Task<int> FreezeAsync(string changeLog, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | changeLog | The change log for the new version. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Remarks
Can only be called on a version that is not frozen.
Exceptions
Type | Condition |
---|---|
Invalid |
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 |
---|---|---|
Cancellation |
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 |
---|---|---|
Dataset |
datasetId | The id of the dataset. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
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 |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
GetLinkedProjectsAsync(CancellationToken)
Returns an enumeration of the asset's linked IAsset
Declaration
IAsyncEnumerable<IAssetProject> GetLinkedProjectsAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsync |
A task whose result is an async enumeration of IAsset |
GetPreviewUrlAsync(CancellationToken)
Returns the url to the preview image of the asset.
Declaration
Task<Uri> GetPreviewUrlAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
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 |
---|---|---|
Project |
projectDescriptor | The descriptor of the project to link to. |
Cancellation |
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. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsync |
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 | |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsync |
A task whose result is an async enumeration of IFile referenced by the asset. |
ListLinkedAssetCollectionsAsync(Range, CancellationToken)
Returns the IAsset
Declaration
IAsyncEnumerable<CollectionDescriptor> ListLinkedAssetCollectionsAsync(Range range, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Range | range | The range of collections to return. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsync |
An async enumeration of IAsset |
QueryLabels()
Returns an object that can be used to query asset labels across versions.
Declaration
AssetLabelQueryBuilder QueryLabels()
Returns
Type | Description |
---|---|
Asset |
QueryVersions()
Returns an object that can be used to query the asset's versions.
Declaration
VersionQueryBuilder QueryVersions()
Returns
Type | Description |
---|---|
Version |
RefreshAsync(CancellationToken)
Fetches the latest changes.
Declaration
Task RefreshAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Cancellation |
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
string Serialize()
Returns
Type | Description |
---|---|
string | The asset serialized as a JSON string. |
Remarks
To deserialize the asset use Deserialize
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 this asset.
Declaration
Task UnassignLabelsAsync(IEnumerable<string> labels, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | labels | The collection of labels to remove. |
Cancellation |
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 |
---|---|---|
Project |
projectDescriptor | The descriptor of the project to unlink from. |
Cancellation |
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 |
---|---|---|
IAsset |
assetUpdate | The object containing information to update this version of the asset. |
Cancellation |
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 not frozen.
Exceptions
Type | Condition |
---|---|
Invalid |
If the asset is frozen, because it cannot be modified. |
UpdateStatusAsync(AssetStatusAction, CancellationToken)
Updates the asset's status.
Declaration
Task UpdateStatusAsync(AssetStatusAction statusAction, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Asset |
statusAction | The new status of the asset. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task | A task with no result. |
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 |
---|---|---|
Project |
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 this asset to the specified project.
Declaration
Task<IAsset> WithProjectAsync(ProjectDescriptor projectDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Project |
projectDescriptor | The descriptor of the project. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
WithVersionAsync(string, CancellationToken)
Switches this 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. |
Cancellation |
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 this asset to the specified version.
Declaration
Task<IAsset> WithVersionAsync(AssetVersion assetVersion, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Asset |
assetVersion | The version of the asset to fetch. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |