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 IAsset
Declaration
Task<IAssetProject> CreateAssetProjectAsync(OrganizationId organizationId, IAssetProjectCreation projectCreation, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Organization |
organizationId | The organization to create the project in. |
IAsset |
projectCreation | The object containing the necessary information to create a new project. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IAsset |
A task whose result is the new IAsset |
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 |
---|---|---|
Organization |
organizationId | The id of the organization in which to add the field definitino. |
IField |
fieldDefinitionCreation | The object containing the necessary information to create a field definition. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IField |
A task whose result is the newly created IField |
DeleteFieldDefinitionAsync(FieldDefinitionDescriptor, CancellationToken)
Deletes an IField
Declaration
Task DeleteFieldDefinitionAsync(FieldDefinitionDescriptor fieldDefinitionDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Field |
fieldDefinitionDescriptor | The descriptor containing the indentifiers for the field definition. |
Cancellation |
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
DeserializeAssetIdentifiers(string)
Implement this method to get an Asset
Declaration
AssetDescriptor DeserializeAssetIdentifiers(string jsonSerialization)
Parameters
Type | Name | Description |
---|---|---|
string | jsonSerialization | The serialization of an asset's identifiers. Accepts the result of Serialize |
Returns
Type | Description |
---|---|
Asset |
An Asset |
GetAssetAsync(AssetDescriptor, CancellationToken)
Retrieves an IAsset by its id and version.
Declaration
Task<IAsset> GetAssetAsync(AssetDescriptor assetDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Asset |
assetDescriptor | The descriptor containing identifiers for the asset. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
GetAssetCollectionAsync(CollectionDescriptor, CancellationToken)
Gets an IAsset
Declaration
Task<IAssetCollection> GetAssetCollectionAsync(CollectionDescriptor collectionDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Collection |
collectionDescriptor | The object containing the necessary information for identifying the collection. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IAsset |
A task whose result is an IAsset |
GetAssetProjectAsync(ProjectDescriptor, CancellationToken)
Gets an organization's IAsset
Declaration
Task<IAssetProject> GetAssetProjectAsync(ProjectDescriptor projectDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Project |
projectDescriptor | The object containing the necessary information for identifying the project. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IAsset |
A task whose result is an IAsset |
GetDatasetAsync(DatasetDescriptor, CancellationToken)
Retrieves an IDataset from an asset version.
Declaration
Task<IDataset> GetDatasetAsync(DatasetDescriptor datasetDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Dataset |
datasetDescriptor | The descriptor containing identifiers for the dataset. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
GetFieldDefinitionAsync(FieldDefinitionDescriptor, CancellationToken)
Retrieves an IField
Declaration
Task<IFieldDefinition> GetFieldDefinitionAsync(FieldDefinitionDescriptor fieldDefinitionDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Field |
fieldDefinitionDescriptor | The descriptor containing the indentifiers for the field definition. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IField |
A task whose result is an IField |
GetFileAsync(FileDescriptor, CancellationToken)
Retrieves an IFile from a dataset.
Declaration
Task<IFile> GetFileAsync(FileDescriptor fileDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
File |
fileDescriptor | The descriptor containing identifiers for the file. |
Cancellation |
cancellationToken | A token that can be used to cancel the request. |
Returns
GetTransformationAsync(TransformationDescriptor, CancellationToken)
Retrieves an ITransformation from a dataset.
Declaration
Task<ITransformation> GetTransformationAsync(TransformationDescriptor transformationDescriptor, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Transformation |
transformationDescriptor | The descriptor containing identifiers for the transformation. |
Cancellation |
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<Project |
projectDescriptors | The projects to search. They must all belong to the same organization. |
Returns
Type | Description |
---|---|
Group |
QueryAssetProjects(OrganizationId)
Returns a builder to create a query to search an organization's IAsset
Declaration
AssetProjectQueryBuilder QueryAssetProjects(OrganizationId organizationId)
Parameters
Type | Name | Description |
---|---|---|
Organization |
organizationId | The id of the organization. |
Returns
Type | Description |
---|---|
Asset |
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<Project |
projectDescriptors | The projects to search. They must all belong to the same organization. |
Returns
Type | Description |
---|---|
Asset |
QueryFieldDefinitions(OrganizationId)
Returns a builder to create a query to search an organization's IField
Declaration
FieldDefinitionQueryBuilder QueryFieldDefinitions(OrganizationId organizationId)
Parameters
Type | Name | Description |
---|---|---|
Organization |
organizationId | The id of the organization. |
Returns
Type | Description |
---|---|
Field |