docs.unity3d.com
    Show / Hide Table of Contents

    Interface IArtifact

    This interface holds information about an artifact.

    Namespace: Unity.Cloud.Storage
    Syntax
    public interface IArtifact

    Properties

    Id

    Gets the ID of the artifact.

    Declaration
    ArtifactId Id { get; }
    Property Value
    Type Description
    ArtifactId

    Name

    Gets the name of the artifact.

    Declaration
    string Name { get; }
    Property Value
    Type Description
    String

    SizeBytes

    Gets the size of the artifact in bytes.

    Declaration
    long SizeBytes { get; }
    Property Value
    Type Description
    Int64

    Version

    Gets the dataset version that the artifact belongs to.

    Declaration
    IDatasetVersion Version { get; }
    Property Value
    Type Description
    IDatasetVersion

    Methods

    DownloadFileAsync(Stream, CancellationToken)

    Asynchronously downloads the artifact and writes it to a specified stream. The stream position will advance by the number of bytes downloaded.

    Declaration
    Task DownloadFileAsync(Stream destinationStream, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Stream destinationStream

    The stream to which the contents of the artifact will be written.

    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    Task

    A task with no result.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if data failed to be written to destinationStream. See InnerException for more details.

    ArgumentNullException

    Thrown if destinationStream is null.

    HttpRequestException

    Thrown when the request fails to complete. See the returned StatusCode for more details.

    DownloadFileAsync(String, CancellationToken)

    Asynchronously downloads the artifact to a specified file.

    Declaration
    Task DownloadFileAsync(string destinationPath, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    String destinationPath

    Path to file to be written.

    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    Task

    A task with no result.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if a file cannot be read. See InnerException for more details.

    ArgumentNullException

    Thrown if destinationPath is null.

    HttpRequestException

    Thrown when the request fails to complete. See the returned StatusCode for more details.

    Back to top
    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