Interface IAssetFileManager
An interface that provides all the methods to interact with an IAssetFile.
Namespace: Unity.Cloud.Assets
Syntax
public interface IAssetFileManager
Methods
CreateAssetFileAsync(IOrganization, IProject, IAsset, IAssetFileCreation, CancellationToken)
Implement this method to create an asset file.
Declaration
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. |
Examples
async Task CreateAssetFileAsync(IOrganization organization, IProject project, IAsset asset, IAssetFileCreation assetFileCreation, CancellationToken token)
{
await m_AssetFileManager.CreateAssetFileAsync(organization, project, asset, assetFileCreation, token);
}
DeleteAssetFileAsync(IOrganization, IProject, IAssetFile, CancellationToken)
Implement this method to delete an asset file.
Declaration
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. |
Examples
async Task DeleteAssetFileAsync(IOrganization organization, IProject project, IAssetFile assetFile, CancellationToken token)
{
await m_AssetFileManager.DeleteAssetFileAsync(organization, project, assetFile, token);
}
FinalizeAssetFileUploadAsync(IOrganization, IProject, IAssetFile, CancellationToken)
Implement this method to finalize the upload of an asset file.
Declaration
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. |
Examples
async Task FinalizeAssetFileUploadAsync(IOrganization organization, IProject project, IAssetFile assetFile, CancellationToken token)
{
await m_AssetFileManager.FinalizeAssetFileUploadAsync(organization, project, assetFile, token);
}
GetAssetFileUrlAsync(IOrganization, IProject, IAssetFile, AssetFileUrlType, CancellationToken)
Implement this method to get an asset file url.
Declaration
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. |
Examples
async Task<string> GetAssetFileUrlAsync(IOrganization organization, IProject project, IAssetFile assetFile, AssetFileUrlType urlType, CancellationToken token)
{
return await m_AssetFileManager.GetAssetFileUrlAsync(organization, project, assetFile, urlType, token);
}
UpdateAssetFileAsync(IOrganization, IProject, IAssetFile, CancellationToken)
Implement this method to update an asset file.
Declaration
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. |
Examples
async Task UpdateAssetFileAsync(IOrganization organization, IProject project, IAssetFile assetFile, CancellationToken token)
{
await m_AssetFileManager.UpdateAssetFileAsync(organization, project, assetFile, token);
}
UploadAssetFileAsync(IOrganization, IProject, IAssetFile, Stream, CancellationToken)
Implement this method to upload an asset file.
Declaration
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. |
Examples
async Task<bool> UploadAssetFileAsync(IOrganization organization, IProject project, IAssetFile assetFile, Stream stream, CancellationToken token)
{
return await m_AssetFileManager.UploadAssetFileAsync(organization, project, assetFile, stream, token);
}