Interface IWorkspace
This interface holds information about a workspace.
Inherited Members
Namespace: Unity.Cloud.Storage
Syntax
public interface IWorkspace : INotifyPropertyChanged, IMetadataContainer, IRefreshableEntity
Properties
Id
Gets the ID of the workspace.
Declaration
WorkspaceId Id { get; }
Property Value
Type | Description |
---|---|
WorkspaceId |
Name
Gets the name of the workspace.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String |
OrgId
Gets the organization ID of the workspace.
Declaration
OrganizationId OrgId { get; }
Property Value
Type | Description |
---|---|
OrganizationId |
Methods
CreateDatasetAsync(IDatasetCreation, CancellationToken)
Creates and adds an IDataset to the workspace.
Declaration
Task<IDataset> CreateDatasetAsync(IDatasetCreation datasetCreation, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IDatasetCreation | datasetCreation | The IDatasetCreation object that contains the necessary information to create the new dataset. |
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
Task<IDataset> | A task that results in the created IDataset when completed. |
Examples
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. |
DeleteDatasetAsync(DatasetId, CancellationToken)
Deletes an IDataset with a specified ID from the repository.
Declaration
Task DeleteDatasetAsync(DatasetId datasetId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
DatasetId | datasetId | The ID of the dataset to delete. |
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
Task | A task with no result. |
Examples
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |
UnauthorizedException | |
ConnectionException | |
ForbiddenException |
GetDatasetAsync(DatasetId, CancellationToken)
Asynchronously requests an IDataset with a specified ID.
Declaration
Task<IDataset> GetDatasetAsync(DatasetId datasetId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
DatasetId | datasetId | A dataset ID. |
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
Task<IDataset> |
Examples
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |
UnauthorizedException | |
ConnectionException | |
ForbiddenException | |
InvalidOperationException | Thrown when the requested dataset doesn't belong to the workspace |
GetDatasetsCountAsync(CancellationToken)
Asynchronously requests the amount of datasets in the workspace.
Declaration
Task<int> GetDatasetsCountAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
Task<Int32> |
Examples
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |
UnauthorizedException | |
ConnectionException | |
ForbiddenException |
GetSceneAsync(SceneId)
Returns a task that results in a IScene when completed.
Declaration
Task<IScene> GetSceneAsync(SceneId sceneId)
Parameters
Type | Name | Description |
---|---|---|
SceneId | sceneId | A scene ID. |
Returns
Type | Description |
---|---|
Task<IScene> |
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |
UnauthorizedException | |
ConnectionException | |
ForbiddenException |
ListDatasetsAsync(Range, CancellationToken)
Requests an asynchronous list of IDataset.
Declaration
IAsyncEnumerable<IDataset> ListDatasetsAsync(Range range, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Range | range | A range of datasets to request. For example, Range.All will return all datasets available in the workspace, while Range(0,10) will return the first 10, if exist |
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IDataset> | Returns an asynchronous collection of IDataset. |
Remarks
If the requested range cannot be served due to the existing amount of items, the results will be clamped. For example, if the workspace contains 5 dataset then Range(0,10) will return only 5 existing items and Range(10, 100) will return an empty collection.
Examples
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |
UnauthorizedException | |
ConnectionException | |
ForbiddenException |
ListScenesAsync()
Asynchronously requests a list of IScene in the workspace.
Declaration
Task<IEnumerable<IScene>> ListScenesAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<IScene>> | Returns a task that results in a list of IScene when completed. |
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |
UnauthorizedException | |
ConnectionException | |
ForbiddenException |
UpdateDatasetAsync(DatasetId, IDatasetUpdate, CancellationToken)
Updates an IDataset in the repository.
Declaration
Task<IDataset> UpdateDatasetAsync(DatasetId datasetId, IDatasetUpdate datasetUpdate, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
DatasetId | datasetId | The ID of the dataset to update. |
IDatasetUpdate | datasetUpdate | The IDatasetUpdate object that contains the necessary information to update the dataset. |
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
Task<IDataset> | A task that results in the updated IDataset when completed. |
Examples
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. |