Class AssetExtensions
Inherited Members
Namespace: Unity.Cloud.Assets
Assembly: Unity.Cloud.Assets.dll
Syntax
public static class AssetExtensions
Methods
GetPreviewDatasetAsync(IAsset, CancellationToken)
Returns the Preview dataset for the asset.
Declaration
public static Task<IDataset> GetPreviewDatasetAsync(this IAsset asset, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsset | asset | The asset to query. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IDataset> | A task whose result is an IDataset. |
GetSourceDatasetAsync(IAsset, CancellationToken)
Returns the Source dataset for the asset.
Declaration
public static Task<IDataset> GetSourceDatasetAsync(this IAsset asset, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsset | asset | The asset to query. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IDataset> | A task whose result is an IDataset. |
WithLatestVersionAsync(IAsset, CancellationToken)
Returns the latest version of the asset.
Declaration
public static Task<IAsset> WithLatestVersionAsync(this IAsset asset, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsset | asset | The asset to query. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IAsset> | A task whose result is an IAsset. |
WithVersionAsync(IAsset, int, CancellationToken)
Returns the version of the asset with the specified sequence number.
Declaration
public static Task<IAsset> WithVersionAsync(this IAsset asset, int frozenSequenceNumber, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsset | asset | The asset to query. |
| int | frozenSequenceNumber | The sequence number of 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 frozen version attributed to the specified sequence number. |
Exceptions
| Type | Condition |
|---|---|
| NotFoundException | If a version with the corresponding |