GBA003/External/Harmony/Backends/Dropbox/SwiftyDropbox/spec/file_requests.stone
2024-05-30 10:22:15 +08:00

262 lines
8.2 KiB
Plaintext

namespace file_requests
"This namespace contains endpoints and data types for file request operations."
alias FileRequestId = String(pattern="[-_0-9a-zA-Z]+", min_length=1)
import common
import files
#
# Common file requests objects
#
union GracePeriod
one_day
two_days
seven_days
thirty_days
always
example default
seven_days = null
struct FileRequestDeadline
deadline common.DropboxTimestamp
"The deadline for this file request."
allow_late_uploads GracePeriod?
"If set, allow uploads after the deadline has passed. These
uploads will be marked overdue."
example deadline
deadline = "2020-10-12T17:00:00Z"
example deadline_with_grace_period
deadline = "2020-10-12T17:00:00Z"
allow_late_uploads = seven_days
struct FileRequest
"A :link:`file request https://www.dropbox.com/help/9090` for receiving
files into the user's Dropbox account."
id FileRequestId
"The ID of the file request."
url String(min_length=1)
"The URL of the file request."
title String(min_length=1)
"The title of the file request."
destination files.Path?
"The path of the folder in the Dropbox where uploaded files will be
sent. This can be :val:`null` if the destination was removed. For apps
with the app folder permission, this will be relative to the app
folder."
created common.DropboxTimestamp
"When this file request was created."
deadline FileRequestDeadline?
"The deadline for this file request. Only set if the request has a
deadline."
is_open Boolean
"Whether or not the file request is open. If the file request is
closed, it will not accept any more file submissions."
file_count Int64
"The number of files this file request has received."
example default
id = "oaCAVmEyrqYnkZX9955Y"
url = "https://www.dropbox.com/request/oaCAVmEyrqYnkZX9955Y"
title = "Homework submission"
destination = "/File Requests/Homework"
created = "2015-10-05T17:00:00Z"
deadline = deadline_with_grace_period
is_open = true
file_count = 3
example with_deadline
id = "BAJ7IrRGicQKGToykQdB"
url = "https://www.dropbox.com/request/BAJ7IrRGjcQKGToykQdB"
title = "Photo contest submission"
destination = "/Photo contest entries"
created = "2015-11-02T04:00:00Z"
deadline = deadline
is_open = true
file_count = 105
example with_no_deadline
id = "rxwMPvK3ATTa0VxOJu5T"
url = "https://www.dropbox.com/request/rxwMPvK3ATTa0VxOJu5T"
title = "Wedding photo submission"
destination = "/Wedding photos"
created = "2015-12-15T13:02:00Z"
deadline = null
is_open = true
file_count = 37
alias FileRequestValidationError = String?
union GeneralFileRequestsError
"There is an error accessing the file requests functionality."
disabled_for_team
"This user's Dropbox Business team doesn't allow file requests."
union FileRequestError extends GeneralFileRequestsError
"There is an error with the file request."
not_found
"This file request ID was not found."
not_a_folder
"The specified path is not a folder."
app_lacks_access
"This file request is not accessible to this app. Apps with the app
folder permission can only access file requests in their app folder."
no_permission
"This user doesn't have permission to access or modify this file
request."
email_unverified
"This user's email address is not verified. File requests are only
available on accounts with a verified email address. Users can verify
their email address :link:`here https://www.dropbox.com/help/317`."
validation_error
"There was an error validating the request. For example, the title was
invalid, or there were disallowed characters in the destination path."
#
# Getting file requests
#
route list(Void, ListFileRequestsResult, ListFileRequestsError)
"Returns a list of file requests owned by this user. For apps with the app
folder permission, this will only return file requests with destinations in
the app folder."
attrs
owner = "api-platform"
allow_app_folder_app = true
struct ListFileRequestsResult
"Result for :route:`list`."
file_requests List(FileRequest)
"The file requests owned by this user. Apps with the app folder
permission will only see file requests in their app folder."
example default
file_requests = [default, with_deadline, with_no_deadline]
union ListFileRequestsError extends GeneralFileRequestsError
"There was an error retrieving the file requests."
#
# Getting individual file requests
#
route get(GetFileRequestArgs, FileRequest, GetFileRequestError)
"Returns the specified file request."
attrs
owner = "api-platform"
allow_app_folder_app = true
struct GetFileRequestArgs
"Arguments for :route:`get`."
id FileRequestId
"The ID of the file request to retrieve."
example default
id = "oaCAVmEyrqYnkZX9955Y"
union GetFileRequestError extends FileRequestError
"There was an error retrieving the specified file request."
#
# Creating new file requests
#
route create(CreateFileRequestArgs, FileRequest, CreateFileRequestError)
"Creates a file request for this user."
attrs
owner = "api-platform"
allow_app_folder_app = true
struct CreateFileRequestArgs
"Arguments for :route:`create`."
title String(min_length=1)
"The title of the file request. Must not be empty."
destination files.Path
"The path of the folder in the Dropbox where uploaded files will be
sent. For apps with the app folder permission, this will be relative to
the app folder."
deadline FileRequestDeadline?
"The deadline for the file request. Deadlines can only be set by
Professional and Business accounts."
open Boolean = true
"Whether or not the file request should be open. If the file request is
closed, it will not accept any file submissions, but it can be opened
later."
example default
title = "Homework submission"
destination = "/File Requests/Homework"
deadline = deadline_with_grace_period
union CreateFileRequestError extends FileRequestError
"There was an error creating the file request."
invalid_location
"File requests are not available on the specified folder."
rate_limit
"The user has reached the rate limit for creating file requests. The
limit is currently 100 file requests per day."
#
# Updating existing file requests
#
route update(UpdateFileRequestArgs, FileRequest, UpdateFileRequestError)
"Update a file request."
attrs
owner = "api-platform"
allow_app_folder_app = true
struct UpdateFileRequestArgs
"Arguments for :route:`update`."
id FileRequestId
"The ID of the file request to update."
title String(min_length=1)?
"The new title of the file request. Must not be empty."
destination files.Path?
"The new path of the folder in the Dropbox where uploaded files will be
sent. For apps with the app folder permission, this will be relative to
the app folder."
deadline UpdateFileRequestDeadline = no_update
"The new deadline for the file request. Deadlines can only be set by
Professional and Business accounts."
union
no_update
"Do not change the file request's deadline."
update FileRequestDeadline?
"If :val:`null`, the file request's deadline is cleared."
example set_deadline
update = deadline_with_grace_period
open Boolean?
"Whether to set this file request as open or closed."
example default
id = "oaCAVmEyrqYnkZX9955Y"
title = "Homework submission"
destination = "/File Requests/Homework"
deadline = set_deadline
open = true
union UpdateFileRequestError extends FileRequestError
"There is an error updating the file request."