docs.unity3d.com
    Show / Hide Table of Contents

    Class CloudAssetFileManager

    A class that implements IAssetFileManager to provide asset file controller functionality. Users of this class will require a minimum Asset Manager Consumer role.

    Inheritance
    Object
    CloudAssetFileManager
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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 project resides.

    IProject project

    The project in which the asset resides. It must exist within the organization.

    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
    IAssetFileManager.CreateAssetFileAsync(IOrganization, IProject, IAsset, IAssetFileCreation, CancellationToken)

    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 project resides.

    IProject project

    The project in which the asset resides. It must exist within the organization.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetFileManager.DeleteAssetFileAsync(IOrganization, IProject, IAssetFile, CancellationToken)

    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 project resides.

    IProject project

    The project in which the asset resides. It must exist within the organization.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetFileManager.FinalizeAssetFileUploadAsync(IOrganization, IProject, IAssetFile, CancellationToken)

    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 project resides.

    IProject project

    The project in which the asset resides. It must exist within the organization.

    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
    IAssetFileManager.GetAssetFileUrlAsync(IOrganization, IProject, IAssetFile, AssetFileUrlType, CancellationToken)

    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 project resides.

    IProject project

    The project in which the asset resides. It must exist within the organization.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetFileManager.UpdateAssetFileAsync(IOrganization, IProject, IAssetFile, CancellationToken)

    UploadAssetFileAsync(IOrganization, IProject, IAssetFile, Stream, CancellationToken)

    Implement this method to upload an asset file.

    Declaration
    public async Task<bool> UploadAssetFileAsync(IOrganization organization, IProject project, IAssetFile assetFile, Stream contentStream, CancellationToken token)
    Parameters
    Type Name Description
    IOrganization organization

    The organization in which the project resides.

    IProject project

    The project in which the asset resides. It must exist within the organization.

    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.

    Implements
    IAssetFileManager.UploadAssetFileAsync(IOrganization, IProject, IAssetFile, Stream, CancellationToken)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023