Interface IAssetRepository
An interface that provides all the methods to interact with asset entities.
Namespace: Unity.Cloud.Assets
Assembly: solution.dll
Syntax
public interface IAssetRepository
Methods
CreateAssetProjectAsync(OrganizationId, IAssetProjectCreation, CancellationToken)
Creates a new IAssetProject in the specified organization.
Declaration
Task<IAssetProject> CreateAssetProjectAsync(OrganizationId organizationId, IAssetProjectCreation projectCreation, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| OrganizationId | organizationId | The organization to create the project in. |
| IAssetProjectCreation | projectCreation | The object containing the necessary information to create a new project. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IAssetProject> | A task whose result is the new IAssetProject. |
CreateFieldDefinitionAsync(OrganizationId, IFieldDefinitionCreation, CancellationToken)
Creates a new field definition within an organization.
Declaration
Task<IFieldDefinition> CreateFieldDefinitionAsync(OrganizationId organizationId, IFieldDefinitionCreation fieldDefinitionCreation, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| OrganizationId | organizationId | The id of the organization in which to add the field definitino. |
| IFieldDefinitionCreation | fieldDefinitionCreation | The object containing the necessary information to create a field definition. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IFieldDefinition> | A task whose result is the newly created IFieldDefinition. |
DeleteFieldDefinitionAsync(FieldDefinitionDescriptor, CancellationToken)
Deletes an IFieldDefinition.
Declaration
Task DeleteFieldDefinitionAsync(FieldDefinitionDescriptor fieldDefinitionDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldDefinitionDescriptor | fieldDefinitionDescriptor | The descriptor containing the indentifiers for the field definition. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task | A task with no result. |
DeserializeAsset(string)
Retrieves an IAsset with a serialized JSON.
Declaration
IAsset DeserializeAsset(string jsonSerialization)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jsonSerialization | The serialization of an asset. Accepts the result of Serialize(). |
Returns
| Type | Description |
|---|---|
| IAsset | An IAsset. |
DeserializeAssetIdentifiers(string)
Implement this method to get an AssetDescriptor given a serialized json of asset identifiers.
Declaration
AssetDescriptor DeserializeAssetIdentifiers(string jsonSerialization)
Parameters
| Type | Name | Description |
|---|---|---|
| string | jsonSerialization | The serialization of an asset's identifiers. Accepts the result of SerializeIdentifiers(). |
Returns
| Type | Description |
|---|---|
| AssetDescriptor | An AssetDescriptor. |
GetAssetAsync(AssetDescriptor, CancellationToken)
Retrieves an IAsset by its id and version.
Declaration
Task<IAsset> GetAssetAsync(AssetDescriptor assetDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetDescriptor | assetDescriptor | The descriptor containing identifiers 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. |
GetAssetCollectionAsync(CollectionDescriptor, CancellationToken)
Gets an IAssetCollection.
Declaration
Task<IAssetCollection> GetAssetCollectionAsync(CollectionDescriptor collectionDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectionDescriptor | collectionDescriptor | The object containing the necessary information for identifying the collection. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IAssetCollection> | A task whose result is an IAssetCollection |
GetAssetProjectAsync(ProjectDescriptor, CancellationToken)
Gets an organization's IAssetProject for current user.
Declaration
Task<IAssetProject> GetAssetProjectAsync(ProjectDescriptor projectDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectDescriptor | projectDescriptor | The object containing the necessary information for identifying the project. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IAssetProject> | A task whose result is an IAssetProject. |
GetDatasetAsync(DatasetDescriptor, CancellationToken)
Retrieves an IDataset from an asset version.
Declaration
Task<IDataset> GetDatasetAsync(DatasetDescriptor datasetDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| DatasetDescriptor | datasetDescriptor | The descriptor containing identifiers for the dataset. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IDataset> | A task whose result is an IDataset. |
GetFieldDefinitionAsync(FieldDefinitionDescriptor, CancellationToken)
Retrieves an IFieldDefinition.
Declaration
Task<IFieldDefinition> GetFieldDefinitionAsync(FieldDefinitionDescriptor fieldDefinitionDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldDefinitionDescriptor | fieldDefinitionDescriptor | The descriptor containing the indentifiers for 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. |
GetFileAsync(FileDescriptor, CancellationToken)
Retrieves an IFile from a dataset.
Declaration
Task<IFile> GetFileAsync(FileDescriptor fileDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| FileDescriptor | fileDescriptor | The descriptor containing identifiers for 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. |
GetTransformationAsync(TransformationDescriptor, CancellationToken)
Retrieves an ITransformation from a dataset.
Declaration
Task<ITransformation> GetTransformationAsync(TransformationDescriptor transformationDescriptor, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| TransformationDescriptor | transformationDescriptor | The descriptor containing identifiers for the transformation. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<ITransformation> | A task whose result is an ITransformation. |
GroupAndCountAssets(IEnumerable<ProjectDescriptor>)
Returns a builder to create a query to count an organization's IAsset.
Declaration
GroupAndCountAssetsQueryBuilder GroupAndCountAssets(IEnumerable<ProjectDescriptor> projectDescriptors)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ProjectDescriptor> | projectDescriptors | The projects to search. They must all belong to the same organization. |
Returns
| Type | Description |
|---|---|
| GroupAndCountAssetsQueryBuilder |
QueryAssetProjects(OrganizationId)
Returns a builder to create a query to search an organization's IAssetProject.
Declaration
AssetProjectQueryBuilder QueryAssetProjects(OrganizationId organizationId)
Parameters
| Type | Name | Description |
|---|---|---|
| OrganizationId | organizationId | The id of the organization. |
Returns
| Type | Description |
|---|---|
| AssetProjectQueryBuilder |
QueryAssets(IEnumerable<ProjectDescriptor>)
Returns a builder to create a query to search an organization's IAsset.
Declaration
AssetQueryBuilder QueryAssets(IEnumerable<ProjectDescriptor> projectDescriptors)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ProjectDescriptor> | projectDescriptors | The projects to search. They must all belong to the same organization. |
Returns
| Type | Description |
|---|---|
| AssetQueryBuilder |
QueryFieldDefinitions(OrganizationId)
Returns a builder to create a query to search an organization's IFieldDefinition.
Declaration
FieldDefinitionQueryBuilder QueryFieldDefinitions(OrganizationId organizationId)
Parameters
| Type | Name | Description |
|---|---|---|
| OrganizationId | organizationId | The id of the organization. |
Returns
| Type | Description |
|---|---|
| FieldDefinitionQueryBuilder |