Interface IAssetLibrary
This interface represents a library.
Namespace: Unity.Cloud.Assets
Assembly: Unity.Cloud.Assets.dll
Syntax
public interface IAssetLibrary
Properties
CacheConfiguration
The cache configuration for the library.
Declaration
AssetLibraryCacheConfiguration CacheConfiguration { get; }
Property Value
Type | Description |
---|---|
AssetLibraryCacheConfiguration |
Id
The identifier of the library.
Declaration
AssetLibraryId Id { get; }
Property Value
Type | Description |
---|---|
AssetLibraryId |
Methods
CountAssetsAsync(CancellationToken)
Returns the number of assets in the library.
Declaration
Task<int> CountAssetsAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<int> | A task whose result is the number of assets in the library. |
GetAssetAsync(AssetId, AssetVersion, CancellationToken)
Retrieves an asset by its ID and version.
Declaration
Task<IAsset> GetAssetAsync(AssetId assetId, AssetVersion assetVersion, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AssetId | assetId | The id of the asset. |
AssetVersion | assetVersion | 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 requested asset. |
GetAssetCollectionAsync(CollectionPath, CancellationToken)
Returns the collection at the specified path.
Declaration
Task<IAssetCollection> GetAssetCollectionAsync(CollectionPath collectionPath, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CollectionPath | collectionPath | The path to the collection. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IAssetCollection> | A task whose result is the requested collection. |
GetFieldDefinitionAsync(string, CancellationToken)
Retrieves an IFieldDefinition.
Declaration
Task<IFieldDefinition> GetFieldDefinitionAsync(string fieldKey, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | fieldKey | The key identifying the field definition. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IFieldDefinition> | A task whose result is an IFieldDefinition. |
GetLabelAsync(string, CancellationToken)
Retrieves a label by name.
Declaration
Task<ILabel> GetLabelAsync(string labelName, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | labelName | The name identifying the label. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<ILabel> | A task whose result is an ILabel. |
GetPropertiesAsync(CancellationToken)
Returns the properties of the library.
Declaration
Task<AssetLibraryProperties> GetPropertiesAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<AssetLibraryProperties> | A task whose result is the AssetLibraryProperties of the library. |
GroupAndCountAssets()
Returns a builder to create a query to count the library's IAsset.
Declaration
GroupAndCountAssetsQueryBuilder GroupAndCountAssets()
Returns
Type | Description |
---|---|
GroupAndCountAssetsQueryBuilder |
QueryAssetLabels(AssetId)
Returns an object that can be used to query asset labels across versions.
Declaration
AssetLabelQueryBuilder QueryAssetLabels(AssetId assetId)
Parameters
Type | Name | Description |
---|---|---|
AssetId | assetId | The id of the asset to query. |
Returns
Type | Description |
---|---|
AssetLabelQueryBuilder |
QueryAssetVersions(AssetId)
Returns an object that can be used to query the asset's versions.
Declaration
VersionQueryBuilder QueryAssetVersions(AssetId assetId)
Parameters
Type | Name | Description |
---|---|---|
AssetId | assetId | The id of the asset to query. |
Returns
Type | Description |
---|---|
VersionQueryBuilder |
QueryAssets()
Returns a builder to create a query to search the library's IAsset.
Declaration
AssetQueryBuilder QueryAssets()
Returns
Type | Description |
---|---|
AssetQueryBuilder |
QueryCollections()
Returns a builder to create a query to search the library's IAssetCollection.
Declaration
CollectionQueryBuilder QueryCollections()
Returns
Type | Description |
---|---|
CollectionQueryBuilder |
QueryFieldDefinitions(IEnumerable<string>)
Returns a builder to create a query to search the library's IFieldDefinition.
Declaration
FieldDefinitionQueryBuilder QueryFieldDefinitions(IEnumerable<string> fieldDefinitionKeys)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | fieldDefinitionKeys | The keys of the field definitions to query. |
Returns
Type | Description |
---|---|
FieldDefinitionQueryBuilder |
QueryLabels()
Returns a builder to create a query to search the library's labels.
Declaration
LabelQueryBuilder QueryLabels()
Returns
Type | Description |
---|---|
LabelQueryBuilder |
RefreshAsync(CancellationToken)
Retrieves and caches the library properties.
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. |
StartCopyAssetsJobAsync(ProjectDescriptor, AssetsToCopy, CancellationToken)
Copies assets from the library to a project.
Declaration
IAsyncEnumerable<IAssetLibraryJob> StartCopyAssetsJobAsync(ProjectDescriptor destinationProjectDescriptor, AssetsToCopy assetsToCopy, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ProjectDescriptor | destinationProjectDescriptor | The project to copy the assets to. |
AssetsToCopy | assetsToCopy | An object that defines the assets to be copied. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IAssetLibraryJob> | An enumeration of AssetLibraryJobId equal to the number of assets requested. |
WithCacheConfigurationAsync(AssetLibraryCacheConfiguration, CancellationToken)
Returns an asset library configured with the specified caching configuration.
Declaration
Task<IAssetLibrary> WithCacheConfigurationAsync(AssetLibraryCacheConfiguration assetLibraryCacheConfiguration, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AssetLibraryCacheConfiguration | assetLibraryCacheConfiguration | The caching configuration for the library. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IAssetLibrary> | A task whose result is an IAssetLibrary with cached values specified by the caching configuration. |