Class WorkspacesResource

java.lang.Object
dev.dosya.sdk.resource.WorkspacesResource

public final class WorkspacesResource extends Object
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 Details

    • WorkspacesResource

      public WorkspacesResource(@NotNull @NotNull DosyaHttpClient http)
      Creates a new WorkspacesResource backed by the given HTTP client.
      Parameters:
      http - the HTTP client used to make API requests
  • Method Details

    • list

      @NotNull public @NotNull List<WorkspaceListItem> list()
      Lists all workspaces accessible by the authenticated user.
      Returns:
      the list of workspace items
      Throws:
      DosyaApiException - if the API returns an error
    • get

      @NotNull public @NotNull WorkspaceGetResponse get(@NotNull @NotNull String workspaceId)
      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

      @NotNull public @NotNull WorkspaceDetail create(@NotNull @NotNull CreateWorkspaceParams params)
      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 update
      params - 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 workspace
      settings - the new workspace settings
      Throws:
      DosyaApiException - if the API returns an error
    • delete

      public void delete(@NotNull @NotNull String workspaceId)
      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