Interface IAssetRepository
An interface that provides all the methods to interact with asset entities.
Namespace: Unity.Cloud.Assets
Assembly: Unity.Cloud.Assets.dll
Syntax
public interface IAssetRepository
Properties
CacheConfiguration
The caching configuration for the asset repository entities.
Declaration
AssetRepositoryCacheConfiguration CacheConfiguration { get; }
Property Value
Type | Description |
---|---|
AssetRepositoryCacheConfiguration |
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. |
CreateAssetProjectLiteAsync(OrganizationId, IAssetProjectCreation, CancellationToken)
Creates a new project in the specified organization.
Declaration
Task<ProjectDescriptor> CreateAssetProjectLiteAsync(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<ProjectDescriptor> | A task whose result is the new project's Unity.Cloud.Common.ProjectDescriptor. |
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. |
CreateFieldDefinitionLiteAsync(OrganizationId, IFieldDefinitionCreation, CancellationToken)
Creates a new field definition within an organization.
Declaration
Task<FieldDefinitionDescriptor> CreateFieldDefinitionLiteAsync(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<FieldDefinitionDescriptor> | A task whose result is the newly created field definition's FieldDefinitionDescriptor. |
CreateLabelAsync(OrganizationId, ILabelCreation, CancellationToken)
Creates a new label within an organization.
Declaration
Task<ILabel> CreateLabelAsync(OrganizationId organizationId, ILabelCreation labelCreation, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
OrganizationId | organizationId | The id of the organization in which to add the label. |
ILabelCreation | labelCreation | The object containing the necessary information to create a 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. |
CreateLabelLiteAsync(OrganizationId, ILabelCreation, CancellationToken)
Creates a new label within an organization.
Declaration
Task<LabelDescriptor> CreateLabelLiteAsync(OrganizationId organizationId, ILabelCreation labelCreation, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
OrganizationId | organizationId | The id of the organization in which to add the label. |
ILabelCreation | labelCreation | The object containing the necessary information to create a label. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<LabelDescriptor> | A task whose result is the new label's LabelDescriptor. |
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 from a serialized JSON string. The IAssetRepository is responsible for injecting the necessary dependencies into the asset.
Declaration
[Obsolete("IAsset serialization is no longer supported.")]
IAsset DeserializeAsset(string jsonSerialization)
Parameters
Type | Name | Description |
---|---|---|
string | jsonSerialization | The serialized JSON string of an asset. |
Returns
Type | Description |
---|---|
IAsset | An IAsset. |
Remarks
To serialize an asset use Serialize().
DeserializeAssetIdentifiers(string)
Implement this method to get an Unity.Cloud.Common.AssetDescriptor given a serialized json of asset identifiers.
Declaration
[Obsolete("Use Common.AssetDescriptor.FromJson instead.")]
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 Unity.Cloud.Common.AssetDescriptor. |
EnableProjectForAssetManagerAsync(ProjectDescriptor, CancellationToken)
Enables a pre-existing dashboard project in asset manager.
Declaration
Task<IAssetProject> EnableProjectForAssetManagerAsync(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. |
EnableProjectForAssetManagerLiteAsync(ProjectDescriptor, CancellationToken)
Enables a pre-existing dashboard project in asset manager.
Declaration
Task EnableProjectForAssetManagerLiteAsync(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 | A task with no result. |
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. |
GetAssetAsync(ProjectDescriptor, AssetId, string, CancellationToken)
Retrieves an IAsset by its id and label.
Declaration
Task<IAsset> GetAssetAsync(ProjectDescriptor projectDescriptor, AssetId assetId, string label, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ProjectDescriptor | projectDescriptor | The project the asset belongs to. |
AssetId | assetId | The id of the asset. |
string | label | The label associated to the asset version. |
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. |
GetLabelAsync(LabelDescriptor, CancellationToken)
Retrieves a label by name.
Declaration
Task<ILabel> GetLabelAsync(LabelDescriptor labelDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
LabelDescriptor | labelDescriptor | The descriptor containing the indentifiers for 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. |
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 which can query the asset count for a set of projects.
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 |
GroupAndCountAssets(OrganizationId)
Returns a builder which can query the asset count for an organization.
Declaration
GroupAndCountAssetsQueryBuilder GroupAndCountAssets(OrganizationId organizationId)
Parameters
Type | Name | Description |
---|---|---|
OrganizationId | organizationId | The id of the 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 which can query for assets in a set of projects.
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 |
QueryAssets(OrganizationId)
Returns a builder which can query for assets in an organization.
Declaration
AssetQueryBuilder QueryAssets(OrganizationId organizationId)
Parameters
Type | Name | Description |
---|---|---|
OrganizationId | organizationId | The id of the 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 |
QueryLabels(OrganizationId)
Returns a builder to create a query to search an organization's labels.
Declaration
LabelQueryBuilder QueryLabels(OrganizationId organizationId)
Parameters
Type | Name | Description |
---|---|---|
OrganizationId | organizationId | The id of the organization. |
Returns
Type | Description |
---|---|
LabelQueryBuilder |
QueryStatusFlows(OrganizationId)
Returns a builder to create a query to search an organization's IStatusFlow.
Declaration
StatusFlowQueryBuilder QueryStatusFlows(OrganizationId organizationId)
Parameters
Type | Name | Description |
---|---|---|
OrganizationId | organizationId | The id of the organization. |
Returns
Type | Description |
---|---|
StatusFlowQueryBuilder |