FileRequestsRoutes

public class FileRequestsRoutes : DropboxTransportClientOwning

Routes for the file_requests namespace For Objective-C compatible routes see DBFileRequestsRoutes

  • Returns the total number of file requests owned by this user. Includes both open and closed file requests.

    • scope: file_requests.read

    Declaration

    Swift

    @discardableResult
    public func count() -> RpcRequest<FileRequests.CountFileRequestsResultSerializer, FileRequests.CountFileRequestsErrorSerializer>

    Return Value

    Through the response callback, the caller will receive a FileRequests.CountFileRequestsResult object on success or a FileRequests.CountFileRequestsError object on failure.

  • Creates a file request for this user.

    • scope: file_requests.write

    Declaration

    Swift

    @discardableResult
    public func create(
        title: String,
        destination: String,
        deadline: FileRequests.FileRequestDeadline? = nil,
        open: Bool = true,
        description_: String? = nil
    ) -> RpcRequest<FileRequests.FileRequestSerializer, FileRequests.CreateFileRequestErrorSerializer>

    Parameters

    title

    The title of the file request. Must not be empty.

    destination

    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

    The deadline for the file request. Deadlines can only be set by Professional and Business accounts.

    open

    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.

    description_

    A description of the file request.

    Return Value

    Through the response callback, the caller will receive a FileRequests.FileRequest object on success or a FileRequests.CreateFileRequestError object on failure.

  • Delete a batch of closed file requests.

    • scope: file_requests.write

    Declaration

    Swift

    @discardableResult
    public func delete(ids: [String])
        -> RpcRequest<FileRequests.DeleteFileRequestsResultSerializer, FileRequests.DeleteFileRequestErrorSerializer>

    Parameters

    ids

    List IDs of the file requests to delete.

    Return Value

    Through the response callback, the caller will receive a FileRequests.DeleteFileRequestsResult object on success or a FileRequests.DeleteFileRequestError object on failure.

  • Delete all closed file requests owned by this user.

    • scope: file_requests.write

    Declaration

    Swift

    @discardableResult
    public func deleteAllClosed()
        -> RpcRequest<FileRequests.DeleteAllClosedFileRequestsResultSerializer, FileRequests.DeleteAllClosedFileRequestsErrorSerializer>

    Return Value

    Through the response callback, the caller will receive a FileRequests.DeleteAllClosedFileRequestsResult object on success or a FileRequests.DeleteAllClosedFileRequestsError object on failure.

  • Returns the specified file request.

    • scope: file_requests.read

    Declaration

    Swift

    @discardableResult
    public func get(id: String) -> RpcRequest<FileRequests.FileRequestSerializer, FileRequests.GetFileRequestErrorSerializer>

    Parameters

    id

    The ID of the file request to retrieve.

    Return Value

    Through the response callback, the caller will receive a FileRequests.FileRequest object on success or a FileRequests.GetFileRequestError object on failure.

  • 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.

    • scope: file_requests.read

    Declaration

    Swift

    @discardableResult
    public func listV2(limit: UInt64 = 1_000)
        -> RpcRequest<FileRequests.ListFileRequestsV2ResultSerializer, FileRequests.ListFileRequestsErrorSerializer>

    Parameters

    limit

    The maximum number of file requests that should be returned per request.

    Return Value

    Through the response callback, the caller will receive a FileRequests.ListFileRequestsV2Result object on success or a FileRequests.ListFileRequestsError object on failure.

  • 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.

    • scope: file_requests.read

    Declaration

    Swift

    @discardableResult
    public func list_() -> RpcRequest<FileRequests.ListFileRequestsResultSerializer, FileRequests.ListFileRequestsErrorSerializer>

    Return Value

    Through the response callback, the caller will receive a FileRequests.ListFileRequestsResult object on success or a FileRequests.ListFileRequestsError object on failure.

  • Once a cursor has been retrieved from listV2, use this to paginate through all file requests. The cursor must come from a previous call to listV2 or listContinue.

    • scope: file_requests.read

    Declaration

    Swift

    @discardableResult
    public func listContinue(cursor: String)
        -> RpcRequest<FileRequests.ListFileRequestsV2ResultSerializer, FileRequests.ListFileRequestsContinueErrorSerializer>

    Parameters

    cursor

    The cursor returned by the previous API call specified in the endpoint description.

    Return Value

    Through the response callback, the caller will receive a FileRequests.ListFileRequestsV2Result object on success or a FileRequests.ListFileRequestsContinueError object on failure.

  • Update a file request.

    • scope: file_requests.write

    Declaration

    Swift

    @discardableResult
    public func update(
        id: String,
        title: String? = nil,
        destination: String? = nil,
        deadline: FileRequests.UpdateFileRequestDeadline = .noUpdate,
        open: Bool? = nil,
        description_: String? = nil
    ) -> RpcRequest<FileRequests.FileRequestSerializer, FileRequests.UpdateFileRequestErrorSerializer>

    Parameters

    id

    The ID of the file request to update.

    title

    The new title of the file request. Must not be empty.

    destination

    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

    The new deadline for the file request. Deadlines can only be set by Professional and Business accounts.

    open

    Whether to set this file request as open or closed.

    description_

    The description of the file request.

    Return Value

    Through the response callback, the caller will receive a FileRequests.FileRequest object on success or a FileRequests.UpdateFileRequestError object on failure.