Class ProjectExtensions
Inherited Members
Namespace: Unity.Cloud.Assets
Assembly: Unity.Cloud.Assets.dll
Syntax
public static class ProjectExtensions
Methods
CountAssetsAsync(IAssetProject, IAssetSearchFilter, CancellationToken)
Returns the total count of assets in the specified projects based on the provided criteria.
Declaration
public static Task<int> CountAssetsAsync(this IAssetProject assetProject, IAssetSearchFilter assetSearchFilter, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IAssetProject | assetProject | The IAssetProject. |
IAssetSearchFilter | assetSearchFilter | The filter specifying the search criteria. Can be null. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<int> | A task whose result is an asset count. |
GetAssetWithLatestVersionAsync(IAssetProject, AssetId, CancellationToken)
Returns the latest version of the asset.
Declaration
public static Task<IAsset> GetAssetWithLatestVersionAsync(this IAssetProject assetProject, AssetId assetId, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IAssetProject | assetProject | The project to query. |
AssetId | assetId | The id 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 an IAsset. |
LinkAssetsAsync(IAssetProject, ProjectDescriptor, IEnumerable<IAsset>, CancellationToken)
Links the assets to the project.
Declaration
public static Task LinkAssetsAsync(this IAssetProject assetProject, ProjectDescriptor sourceProjectDescriptor, IEnumerable<IAsset> assets, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IAssetProject | assetProject | The target project. |
ProjectDescriptor | sourceProjectDescriptor | The id of the project that is common to the assets. |
IEnumerable<IAsset> | assets | The assets to link. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task | A task with no result. |
ListCollectionsAsync(IAssetProject, Range, CancellationToken)
Returns the collections of the project.
Declaration
public static IAsyncEnumerable<IAssetCollection> ListCollectionsAsync(this IAssetProject assetProject, Range range, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IAssetProject | assetProject | The IAssetProject. |
Range | range | The range of results to return. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IAssetCollection> |
UnlinkAssetsAsync(IAssetProject, IEnumerable<IAsset>, CancellationToken)
Unlinks the assets from the project.
Declaration
public static Task UnlinkAssetsAsync(this IAssetProject assetProject, IEnumerable<IAsset> assets, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IAssetProject | assetProject | The target project. |
IEnumerable<IAsset> | assets | The assets to unlink from the project. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task | A task with no result. |