Interface IAssetFile
This class contains all the information pertaining to an asset file.
Namespace: Unity.Cloud.Assets
Syntax
public interface IAssetFile
Properties
Description
The description of the asset file.
Declaration
string Description { get; set; }
Property Value
Type | Description |
---|---|
String |
Details
The details of the asset file.
Declaration
IDeserializable Details { get; set; }
Property Value
Type | Description |
---|---|
IDeserializable |
FileSize
The file size of the asset file.
Declaration
long FileSize { get; set; }
Property Value
Type | Description |
---|---|
Int64 |
Id
The id of the asset file.
Declaration
string Id { get; }
Property Value
Type | Description |
---|---|
String |
Metadata
The metadata of the asset file.
Declaration
IDeserializable Metadata { get; set; }
Property Value
Type | Description |
---|---|
IDeserializable |
Name
The name of the asset file.
Declaration
string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Status
The status of the asset.
Declaration
string Status { get; set; }
Property Value
Type | Description |
---|---|
String |
StatusDetails
The status details of the asset.
Declaration
string StatusDetails { get; set; }
Property Value
Type | Description |
---|---|
String |
Storage
The storage id of the asset file.
Declaration
string Storage { get; }
Property Value
Type | Description |
---|---|
String |
Tags
The tags of the asset file.
Declaration
List<string> Tags { get; set; }
Property Value
Type | Description |
---|---|
List<String> |
Type
The type of the asset file.
Declaration
string Type { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
DownloadAsync(Stream, IProgress<HttpProgress>, CancellationToken)
Implement this method to download an asset file.
Declaration
Task DownloadAsync(Stream contentStream, IProgress<HttpProgress> progress, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Stream | contentStream | The destination stream for the file content |
IProgress<HttpProgress> | progress | The progress provider. |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task | A task with no result. |
Examples
FinalizeUploadAsync(CancellationToken)
Finalizes the upload of the asset file.
Declaration
Task FinalizeUploadAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task with no result. |
GetDownloadUrlAsync(CancellationToken)
Generates a url for uploading or downloading the asset file content.
Declaration
Task<string> GetDownloadUrlAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<String> | A task whose result is the url of the specified type. |
Examples
GetUploadUrlAsync(CancellationToken)
Generates a url for uploading or downloading the asset file content.
Declaration
Task<string> GetUploadUrlAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<String> | A task whose result is the url of the specified type. |
Examples
UpdateAsync(CancellationToken)
Synchronizes the local changes to the asset file with the data source.
Declaration
Task UpdateAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task with no result. |
UploadAsync(Stream, IProgress<HttpProgress>, CancellationToken)
Uploads content to the asset file.
Declaration
Task UploadAsync(Stream contentStream, IProgress<HttpProgress> progress, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Stream | contentStream | The content of the asset file. |
IProgress<HttpProgress> | progress | The progress provider. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task | A task with no result. |
Examples