docs.unity3d.com
    Show / Hide Table of Contents

    Class WorkspaceRepository

    Provides CRUD operations for workspaces using given storage and scene clients.

    Inheritance
    Object
    WorkspaceRepository
    CloudWorkspaceRepository
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Cloud.Storage
    Syntax
    public abstract class WorkspaceRepository : IWorkspaceRepository

    Methods

    CreateWorkspaceAsync(IWorkspaceCreation, CancellationToken)

    Creates and adds an IWorkspace to the repository.

    Declaration
    public async Task<IWorkspace> CreateWorkspaceAsync(IWorkspaceCreation workspaceCreation, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    IWorkspaceCreation workspaceCreation

    The IWorkspaceCreation object that contains the necessary information to create the new workspace.

    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    Task<IWorkspace>

    A task that results in the created IWorkspace when completed.

    Implements
    IWorkspaceRepository.CreateWorkspaceAsync(IWorkspaceCreation, CancellationToken)
    Exceptions
    Type Condition
    HttpRequestException

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

    UnauthorizedException
    ConnectionException
    ForbiddenException
    ServiceException

    Thrown when service failed to execute the request. See the returned StatusCode for more details.

    DeleteWorkspaceAsync(WorkspaceId, CancellationToken)

    Deletes an IWorkspace with a specified ID from the repository.

    Declaration
    public Task DeleteWorkspaceAsync(WorkspaceId workspaceId, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    WorkspaceId workspaceId

    The ID of the workspace to delete.

    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IWorkspaceRepository.DeleteWorkspaceAsync(WorkspaceId, CancellationToken)
    Exceptions
    Type Condition
    HttpRequestException

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

    UnauthorizedException
    ConnectionException
    ForbiddenException

    GetWorkspaceAsync(WorkspaceId, CancellationToken)

    Asynchronously requests an IWorkspace with a specified ID.

    Declaration
    public async Task<IWorkspace> GetWorkspaceAsync(WorkspaceId workspaceId, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    WorkspaceId workspaceId

    A workspace Id.

    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    Task<IWorkspace>

    Returns a Task that results in an IWorkspace when completed.

    Implements
    IWorkspaceRepository.GetWorkspaceAsync(WorkspaceId, CancellationToken)
    Exceptions
    Type Condition
    HttpRequestException

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

    UnauthorizedException
    ConnectionException
    ForbiddenException

    GetWorkspacesCountAsync(CancellationToken)

    Asynchronously requests the amount of workspaces in the repository.

    Declaration
    public Task<int> GetWorkspacesCountAsync(CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    Task<Int32>

    Returns a Task that results in an Int32 when completed.

    Implements
    IWorkspaceRepository.GetWorkspacesCountAsync(CancellationToken)
    Exceptions
    Type Condition
    HttpRequestException

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

    UnauthorizedException
    ConnectionException
    ForbiddenException

    ListWorkspacesAsync(Range, CancellationToken)

    Requests an asynchronous list of IWorkspace.

    Declaration
    public IAsyncEnumerable<IWorkspace> ListWorkspacesAsync(Range range, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Range range

    A range of workspaces to request. For example, Range.All will return all workspaces available, while Range(0,10) will return the first 10, if exist

    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    IAsyncEnumerable<IWorkspace>

    Returns an asynchronous collection of IWorkspace.

    Implements
    IWorkspaceRepository.ListWorkspacesAsync(Range, CancellationToken)
    Remarks

    If the requested range cannot be served due to the existing amount of items, the results will be clamped. For example, if the repository contains 5 workspaces then Range(0,10) will return only 5 existing items and Range(10, 100) will return an empty collection.

    Exceptions
    Type Condition
    HttpRequestException

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

    UnauthorizedException
    ConnectionException
    ForbiddenException

    UpdateWorkspaceAsync(WorkspaceId, IWorkspaceUpdate, CancellationToken)

    Updates an IWorkspace in the repository.

    Declaration
    public async Task<IWorkspace> UpdateWorkspaceAsync(WorkspaceId workspaceId, IWorkspaceUpdate workspaceUpdate, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    WorkspaceId workspaceId

    The ID of the workspace to be updated.

    IWorkspaceUpdate workspaceUpdate

    The IWorkspaceUpdate object that contains the necessary information to update the workspace.

    CancellationToken cancellationToken

    An optional cancellation token.

    Returns
    Type Description
    Task<IWorkspace>

    A task that results in the updated IWorkspace when completed.

    Implements
    IWorkspaceRepository.UpdateWorkspaceAsync(WorkspaceId, IWorkspaceUpdate, CancellationToken)
    Exceptions
    Type Condition
    HttpRequestException

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

    UnauthorizedException
    ConnectionException
    ForbiddenException
    ServiceException

    Thrown when service failed to execute the request. 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