Package dev.dosya.sdk.resource
Class WorkspacesResource
java.lang.Object
dev.dosya.sdk.resource.WorkspacesResource
Provides operations for managing workspaces in Dosya.
This resource handles listing, creating, retrieving, updating, and deleting workspaces, as well as updating workspace settings.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionWorkspacesResource(@NotNull DosyaHttpClient http) Creates a newWorkspacesResourcebacked by the given HTTP client. -
Method Summary
Modifier and TypeMethodDescription@NotNull WorkspaceDetailcreate(@NotNull CreateWorkspaceParams params) Creates a new workspace.voidPermanently deletes a workspace and all its contents.@NotNull WorkspaceGetResponseRetrieves detailed information about a workspace, including its settings.@NotNull List<WorkspaceListItem>list()Lists all workspaces accessible by the authenticated user.voidupdate(@NotNull String workspaceId, @NotNull UpdateWorkspaceParams params) Updates an existing workspace's name, icon, or default region.voidupdateSettings(@NotNull String workspaceId, @NotNull WorkspaceSettings settings) Replaces the settings for a workspace.
-
Constructor Details
-
WorkspacesResource
Creates a newWorkspacesResourcebacked by the given HTTP client.- Parameters:
http- the HTTP client used to make API requests
-
-
Method Details
-
list
Lists all workspaces accessible by the authenticated user.- Returns:
- the list of workspace items
- Throws:
DosyaApiException- if the API returns an error
-
get
Retrieves detailed information about a workspace, including its settings.- Parameters:
workspaceId- the unique identifier of the workspace- Returns:
- the response containing workspace detail, settings, and role information
- Throws:
DosyaApiException- if the API returns an error
-
create
Creates a new workspace.- Parameters:
params- the creation parameters including name and optional icon/region settings- Returns:
- the created workspace detail
- Throws:
DosyaApiException- if the API returns an error
-
update
public void update(@NotNull @NotNull String workspaceId, @NotNull @NotNull UpdateWorkspaceParams params) Updates an existing workspace's name, icon, or default region.- Parameters:
workspaceId- the unique identifier of the workspace to updateparams- the update parameters (only non-null fields are applied)- Throws:
DosyaApiException- if the API returns an error
-
updateSettings
public void updateSettings(@NotNull @NotNull String workspaceId, @NotNull @NotNull WorkspaceSettings settings) Replaces the settings for a workspace.- Parameters:
workspaceId- the unique identifier of the workspacesettings- the new workspace settings- Throws:
DosyaApiException- if the API returns an error
-
delete
Permanently deletes a workspace and all its contents.- Parameters:
workspaceId- the unique identifier of the workspace to delete- Throws:
DosyaApiException- if the API returns an error
-