Class CommentsResource

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

public final class CommentsResource extends Object
Provides operations for managing comments on files and folders in Dosya.

This resource handles listing, creating, editing, and deleting comments.

Since:
0.1.0
  • Constructor Details

    • CommentsResource

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

    • list

      @NotNull public @NotNull List<CommentDetail> list(@NotNull @NotNull String workspaceId, @Nullable @Nullable String fileId, @Nullable @Nullable String folderId)
      Lists comments in a workspace, optionally filtered by file or folder.
      Parameters:
      workspaceId - the workspace whose comments to list
      fileId - filter by file ID, or null to include all
      folderId - filter by folder ID, or null to include all
      Returns:
      the list of comments
      Throws:
      DosyaApiException - if the API returns an error
    • list

      @NotNull public @NotNull List<CommentDetail> list(@NotNull @NotNull String workspaceId)
      Lists all comments in a workspace.
      Parameters:
      workspaceId - the workspace whose comments to list
      Returns:
      the list of comments
      Throws:
      DosyaApiException - if the API returns an error
    • create

      @NotNull public @NotNull CommentDetail create(@NotNull @NotNull CreateCommentParams params)
      Creates a new comment on a file or folder.
      Parameters:
      params - the comment creation parameters including workspace ID, body, and optional targets
      Returns:
      the created comment detail
      Throws:
      DosyaApiException - if the API returns an error
    • edit

      @NotNull public @NotNull CommentDetail edit(@NotNull @NotNull String commentId, @NotNull @NotNull String body)
      Edits the body of an existing comment.
      Parameters:
      commentId - the unique identifier of the comment to edit
      body - the new comment body text
      Returns:
      the updated comment detail
      Throws:
      DosyaApiException - if the API returns an error
    • delete

      public void delete(@NotNull @NotNull String commentId)
      Deletes a comment.
      Parameters:
      commentId - the unique identifier of the comment to delete
      Throws:
      DosyaApiException - if the API returns an error