Package dev.dosya.sdk.resource
Class CommentsResource
java.lang.Object
dev.dosya.sdk.resource.CommentsResource
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 Summary
ConstructorsConstructorDescriptionCommentsResource(@NotNull DosyaHttpClient http) Creates a newCommentsResourcebacked by the given HTTP client. -
Method Summary
Modifier and TypeMethodDescription@NotNull CommentDetailcreate(@NotNull CreateCommentParams params) Creates a new comment on a file or folder.voidDeletes a comment.@NotNull CommentDetailEdits the body of an existing comment.@NotNull List<CommentDetail>Lists all comments in a workspace.@NotNull List<CommentDetail>Lists comments in a workspace, optionally filtered by file or folder.
-
Constructor Details
-
CommentsResource
Creates a newCommentsResourcebacked 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 listfileId- filter by file ID, ornullto include allfolderId- filter by folder ID, ornullto include all- Returns:
- the list of comments
- Throws:
DosyaApiException- if the API returns an error
-
list
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
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 editbody- the new comment body text- Returns:
- the updated comment detail
- Throws:
DosyaApiException- if the API returns an error
-
delete
Deletes a comment.- Parameters:
commentId- the unique identifier of the comment to delete- Throws:
DosyaApiException- if the API returns an error
-