Table of Contents

Interface IWorkspaceClient

Namespace
OpenShell
Assembly
OpenShell.Sdk.dll

Workspace and membership management.

public interface IWorkspaceClient

Methods

AddMemberAsync(string, string, WorkspaceRole, string?, CancellationToken)

Adds a principal to a workspace with the given role.

ValueTask<WorkspaceMember> AddMemberAsync(string workspace, string principalSubject, WorkspaceRole role, string? requestId = null, CancellationToken cancellationToken = default)

Parameters

workspace string
principalSubject string
role WorkspaceRole
requestId string
cancellationToken CancellationToken

Returns

ValueTask<WorkspaceMember>

CreateAsync(string, IReadOnlyDictionary<string, string>?, string?, CancellationToken)

Creates a workspace. The name must be a DNS-1123 label.

ValueTask<Workspace> CreateAsync(string name, IReadOnlyDictionary<string, string>? labels = null, string? requestId = null, CancellationToken cancellationToken = default)

Parameters

name string
labels IReadOnlyDictionary<string, string>
requestId string
cancellationToken CancellationToken

Returns

ValueTask<Workspace>

DeleteAsync(string, DeleteOptions?, CancellationToken)

Deletes a workspace. Inspect Outcome.

ValueTask<DeletionResult> DeleteAsync(string name, DeleteOptions? options = null, CancellationToken cancellationToken = default)

Parameters

name string
options DeleteOptions
cancellationToken CancellationToken

Returns

ValueTask<DeletionResult>

GetAsync(string, CancellationToken)

Gets a workspace by name.

ValueTask<Workspace> GetAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string
cancellationToken CancellationToken

Returns

ValueTask<Workspace>

List(ListOptions?)

Lists workspaces lazily. AllWorkspaces does not apply to workspaces and is ignored.

Pager<Workspace> List(ListOptions? options = null)

Parameters

options ListOptions

Returns

Pager<Workspace>

ListMembers(string, ListOptions?)

Lists the members of a workspace lazily.

Pager<WorkspaceMember> ListMembers(string workspace, ListOptions? options = null)

Parameters

workspace string
options ListOptions

Returns

Pager<WorkspaceMember>

RemoveMemberAsync(string, string, DeleteOptions?, CancellationToken)

Removes a principal from a workspace.

ValueTask<DeletionResult> RemoveMemberAsync(string workspace, string principalSubject, DeleteOptions? options = null, CancellationToken cancellationToken = default)

Parameters

workspace string
principalSubject string
options DeleteOptions
cancellationToken CancellationToken

Returns

ValueTask<DeletionResult>