Class CloudAssetFileManager
A class that implements IAssetFileManager to provide asset file controller functionality.
Asset Manager Consumer role.
Inherited Members
Namespace: Unity.Cloud.Assets
Syntax
public sealed class CloudAssetFileManager : IAssetFileManager
Constructors
CloudAssetFileManager(IServiceHttpClient, IServiceHostResolver)
Initializes and returns an instance of CloudAssetFileManager
Declaration
public CloudAssetFileManager(IServiceHttpClient serviceHttpClient, IServiceHostResolver serviceHostResolver)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceHttpClient | serviceHttpClient | The IServiceHttpClient used to fetch the data. |
| IServiceHostResolver | serviceHostResolver | The IServiceHostResolver object. |
Methods
CreateAssetFileAsync(IOrganization, IProject, IAsset, IAssetFileCreation, CancellationToken)
Implement this method to create an asset file.
Declaration
public Task<IAssetFile> CreateAssetFileAsync(IOrganization organization, IProject project, IAsset asset, IAssetFileCreation assetFileCreation, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IOrganization | organization | The organization in which the |
| IProject | project | The project in which the asset resides. It must exist within the |
| IAsset | asset | The asset the file will linked to. |
| IAssetFileCreation | assetFileCreation | The object containing the information necessary to create an asset file. |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task<IAssetFile> | A task with no result. |
Implements
DeleteAssetFileAsync(IOrganization, IProject, IAssetFile, CancellationToken)
Implement this method to delete an asset file.
Declaration
public Task DeleteAssetFileAsync(IOrganization organization, IProject project, IAssetFile assetFile, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IOrganization | organization | The organization in which the |
| IProject | project | The project in which the asset resides. It must exist within the |
| IAssetFile | assetFile | The asset file |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task | A task with no result. |
Implements
FinalizeAssetFileUploadAsync(IOrganization, IProject, IAssetFile, CancellationToken)
Implement this method to finalize the upload of an asset file.
Declaration
public Task FinalizeAssetFileUploadAsync(IOrganization organization, IProject project, IAssetFile assetFile, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IOrganization | organization | The organization in which the |
| IProject | project | The project in which the asset resides. It must exist within the |
| IAssetFile | assetFile | The asset file |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task | A task with no result. |
Implements
GetAssetFileUrlAsync(IOrganization, IProject, IAssetFile, AssetFileUrlType, CancellationToken)
Implement this method to get an asset file url.
Declaration
public Task<string> GetAssetFileUrlAsync(IOrganization organization, IProject project, IAssetFile assetFile, AssetFileUrlType urlType, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IOrganization | organization | The organization in which the |
| IProject | project | The project in which the asset resides. It must exist within the |
| IAssetFile | assetFile | The asset file |
| AssetFileUrlType | urlType | The asset file's url type |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task<String> | A task with no result. |
Implements
UpdateAssetFileAsync(IOrganization, IProject, IAssetFile, CancellationToken)
Implement this method to update an asset file.
Declaration
public Task UpdateAssetFileAsync(IOrganization organization, IProject project, IAssetFile assetFile, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IOrganization | organization | The organization in which the |
| IProject | project | The project in which the asset resides. It must exist within the |
| IAssetFile | assetFile | The asset file |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task | A task with no result. |
Implements
UploadAssetFileAsync(IOrganization, IProject, IAssetFile, Stream, CancellationToken)
Implement this method to upload an asset file.
Declaration
public Task<bool> UploadAssetFileAsync(IOrganization organization, IProject project, IAssetFile assetFile, Stream contentStream, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IOrganization | organization | The organization in which the |
| IProject | project | The project in which the asset resides. It must exist within the |
| IAssetFile | assetFile | The asset file |
| Stream | contentStream | The stream to the file content |
| CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A task whose result signals the success of the upload. |