/// <summary> /// <para>Update a file request.</para> /// </summary> /// <param name="id">The ID of the file request to update.</param> /// <param name="title">The new title of the file request. Must not be empty.</param> /// <param name="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.</param> /// <param name="deadline">The new deadline for the file request.</param> /// <param name="open">Whether to set this file request as open or closed.</param> /// <returns>The task that represents the asynchronous send operation. The TResult /// parameter contains the response from the server.</returns> /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error /// processing the request; This will contain a <see /// cref="UpdateFileRequestError"/>.</exception> public t.Task <FileRequest> UpdateAsync(string id, string title = null, string destination = null, UpdateFileRequestDeadline deadline = null, bool?open = null) { var updateFileRequestArgs = new UpdateFileRequestArgs(id, title, destination, deadline, open); return(this.UpdateAsync(updateFileRequestArgs)); }
/// <summary> /// <para>Begins an asynchronous send to the update route.</para> /// </summary> /// <param name="id">The ID of the file request to update.</param> /// <param name="title">The new title of the file request. Must not be empty.</param> /// <param name="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.</param> /// <param name="deadline">The new deadline for the file request.</param> /// <param name="open">Whether to set this file request as open or closed.</param> /// <param name="callback">The method to be called when the asynchronous send is /// completed.</param> /// <param name="callbackState">A user provided object that distinguished this send /// from other send requests.</param> /// <returns>An object that represents the asynchronous send request.</returns> public sys.IAsyncResult BeginUpdate(string id, string title = null, string destination = null, UpdateFileRequestDeadline deadline = null, bool?open = null, sys.AsyncCallback callback = null, object callbackState = null) { var updateFileRequestArgs = new UpdateFileRequestArgs(id, title, destination, deadline, open); return(this.BeginUpdate(updateFileRequestArgs, callback, callbackState)); }
private static async Task <FileRequest> UpdateFileRequest(DropboxClient client, FileRequest fileRequest, DateTime?deadline = null, string path = null, bool?isOpen = null, string title = null) { UpdateFileRequestDeadline frDeadline = null; if (deadline != null) { frDeadline = new UpdateFileRequestDeadline.Update(new FileRequestDeadline((DateTime)deadline)); } UpdateFileRequestArgs args = new UpdateFileRequestArgs(fileRequest.Id, title, path, frDeadline, isOpen); try { return(await client.FileRequests.UpdateAsync(args)); } catch { //TODO: Add error handling return(null); } }
/// <summary> /// <para>Begins an asynchronous send to the update route.</para> /// </summary> /// <param name="updateFileRequestArgs">The request parameters.</param> /// <param name="callback">The method to be called when the asynchronous send is /// completed.</param> /// <param name="state">A user provided object that distinguished this send from other /// send requests.</param> /// <returns>An object that represents the asynchronous send request.</returns> public sys.IAsyncResult BeginUpdate(UpdateFileRequestArgs updateFileRequestArgs, sys.AsyncCallback callback, object state = null) { var task = this.UpdateAsync(updateFileRequestArgs); return(enc.Util.ToApm(task, callback, state)); }
/// <summary> /// <para>Update a file request.</para> /// </summary> /// <param name="updateFileRequestArgs">The request parameters</param> /// <returns>The task that represents the asynchronous send operation. The TResult /// parameter contains the response from the server.</returns> /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error /// processing the request; This will contain a <see /// cref="UpdateFileRequestError"/>.</exception> public t.Task <FileRequest> UpdateAsync(UpdateFileRequestArgs updateFileRequestArgs) { return(this.Transport.SendRpcRequestAsync <UpdateFileRequestArgs, FileRequest, UpdateFileRequestError>(updateFileRequestArgs, "api", "/file_requests/update", "user", global::Dropbox.Api.FileRequests.UpdateFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.FileRequest.Decoder, global::Dropbox.Api.FileRequests.UpdateFileRequestError.Decoder)); }