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
workspacestringprincipalSubjectstringroleWorkspaceRolerequestIdstringcancellationTokenCancellationToken
Returns
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
namestringlabelsIReadOnlyDictionary<string, string>requestIdstringcancellationTokenCancellationToken
Returns
DeleteAsync(string, DeleteOptions?, CancellationToken)
Deletes a workspace. Inspect Outcome.
ValueTask<DeletionResult> DeleteAsync(string name, DeleteOptions? options = null, CancellationToken cancellationToken = default)
Parameters
namestringoptionsDeleteOptionscancellationTokenCancellationToken
Returns
GetAsync(string, CancellationToken)
Gets a workspace by name.
ValueTask<Workspace> GetAsync(string name, CancellationToken cancellationToken = default)
Parameters
namestringcancellationTokenCancellationToken
Returns
List(ListOptions?)
Lists workspaces lazily. AllWorkspaces does not apply to workspaces and is ignored.
Pager<Workspace> List(ListOptions? options = null)
Parameters
optionsListOptions
Returns
ListMembers(string, ListOptions?)
Lists the members of a workspace lazily.
Pager<WorkspaceMember> ListMembers(string workspace, ListOptions? options = null)
Parameters
workspacestringoptionsListOptions
Returns
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
workspacestringprincipalSubjectstringoptionsDeleteOptionscancellationTokenCancellationToken