Package dev.dosya.sdk.resource
Class FileRequestsResource
java.lang.Object
dev.dosya.sdk.resource.FileRequestsResource
Provides operations for managing file requests in Dosya workspaces.
File requests allow users to collect file uploads from external recipients via a shareable link. This resource handles creating, retrieving, updating, deleting file requests, and managing their uploads and recipients.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a recipient of a file request invitation.static final classRepresents a file that was uploaded in response to a file request. -
Constructor Summary
ConstructorsConstructorDescriptionFileRequestsResource(@NotNull DosyaHttpClient http) Creates a newFileRequestsResourcebacked by the given HTTP client. -
Method Summary
Modifier and TypeMethodDescription@NotNull FileRequestCreateResponsecreate(@NotNull CreateFileRequestParams params) Creates a new file request.voidDeletes a file request.@NotNull FileRequestDetailRetrieves detailed information about a file request.listRecipients(@NotNull String requestId) Lists all recipients of a file request.@NotNull List<FileRequestsResource.FileRequestUpload>listUploads(@NotNull String requestId) Lists all uploads received through a file request.voidResends the file request notification to all recipients.voidResends the file request notification to specific recipients or all recipients.voidUpdates a file request's title and/or message.
-
Constructor Details
-
FileRequestsResource
Creates a newFileRequestsResourcebacked by the given HTTP client.- Parameters:
http- the HTTP client used to make API requests
-
-
Method Details
-
create
@NotNull public @NotNull FileRequestCreateResponse create(@NotNull @NotNull CreateFileRequestParams params) Creates a new file request.- Parameters:
params- the creation parameters including workspace ID and optional settings- Returns:
- the response containing the created file request summary
- Throws:
DosyaApiException- if the API returns an error
-
get
Retrieves detailed information about a file request.- Parameters:
requestId- the unique identifier of the file request- Returns:
- the file request detail
- Throws:
DosyaApiException- if the API returns an error
-
update
public void update(@NotNull @NotNull String requestId, @Nullable @Nullable String title, @Nullable @Nullable String message) Updates a file request's title and/or message.- Parameters:
requestId- the unique identifier of the file requesttitle- the new title, ornullto leave unchangedmessage- the new message, ornullto leave unchanged- Throws:
DosyaApiException- if the API returns an error
-
delete
Deletes a file request.- Parameters:
requestId- the unique identifier of the file request to delete- Throws:
DosyaApiException- if the API returns an error
-
listUploads
@NotNull public @NotNull List<FileRequestsResource.FileRequestUpload> listUploads(@NotNull @NotNull String requestId) Lists all uploads received through a file request.- Parameters:
requestId- the unique identifier of the file request- Returns:
- the list of uploads received
- Throws:
DosyaApiException- if the API returns an error
-
listRecipients
@NotNull public @NotNull List<FileRequestsResource.FileRequestRecipient> listRecipients(@NotNull @NotNull String requestId) Lists all recipients of a file request.- Parameters:
requestId- the unique identifier of the file request- Returns:
- the list of recipients
- Throws:
DosyaApiException- if the API returns an error
-
resend
public void resend(@NotNull @NotNull String requestId, @Nullable @Nullable List<String> recipientIds) Resends the file request notification to specific recipients or all recipients.- Parameters:
requestId- the unique identifier of the file requestrecipientIds- the list of recipient IDs to resend to, ornullto resend to all- Throws:
DosyaApiException- if the API returns an error
-
resend
Resends the file request notification to all recipients.- Parameters:
requestId- the unique identifier of the file request- Throws:
DosyaApiException- if the API returns an error
-