diff --git a/dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/DropboxApiTests.cs b/dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/DropboxApiTests.cs
index dc87074b6c..b6e59c06b4 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/DropboxApiTests.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/DropboxApiTests.cs
@@ -4,6 +4,8 @@
//
//-----------------------------------------------------------------------------
+using System.Threading;
+
namespace Dropbox.Api.Tests
{
using System;
@@ -526,6 +528,123 @@ public async Task TestCreateFolderWithDateFormat()
Assert.IsTrue(folders.Entries.Any(f => f.Name == folderNameWithDateFormat));
}
+ ///
+ /// Test retry with cancellation token.
+ ///
+ /// The .
+ [TestMethod]
+ public async Task TestRetryWithCancellation()
+ {
+ var count = 0;
+
+ var mockHandler = new MockHttpMessageHandler((r, s) =>
+ {
+ if (count++ < 3)
+ {
+ var error = new HttpResponseMessage(HttpStatusCode.InternalServerError)
+ {
+ Content = new StringContent("Error"),
+ };
+
+ return Task.FromResult(error);
+ }
+
+ return s(r);
+ });
+ var mockClient = new HttpClient(mockHandler);
+ var mockedClient = new DropboxClient(userAccessToken, new DropboxClientConfig { HttpClient = mockClient, MaxRetriesOnError = 10 });
+ var filePath = $"{TestingPath}/{DateTime.Now.Ticks}.txt";
+ await Assert.ThrowsExceptionAsync(async () =>
+ {
+ using var ctx = new CancellationTokenSource();
+ var response = mockedClient.Files.UploadAsync(filePath, body: GetStream("abc"), cancellationToken: ctx.Token);
+ ctx.Cancel();
+ await response;
+ });
+ await Assert.ThrowsExceptionAsync>(async () =>
+ {
+ await DropboxApiTests.client.Files.GetMetadataAsync(filePath);
+ });
+ }
+
+ ///
+ /// Test download with cancellation token.
+ ///
+ /// The .
+ [TestMethod]
+ public async Task TestDownloadWithCancellation()
+ {
+ var filePath = $"{TestingPath}/{DateTime.Now.Ticks}.txt";
+ await client.Files.UploadAsync(filePath, body: GetStream("abc"));
+ await Assert.ThrowsExceptionAsync(async () =>
+ {
+ using var cts = new CancellationTokenSource();
+ var downloadResponse = client.Files.DownloadAsync(TestingPath + "/Foo.txt", cancellationToken: cts.Token);
+ cts.Cancel();
+ await downloadResponse;
+ });
+ }
+
+ ///
+ /// Test upload with cancellation token.
+ ///
+ /// The .
+ [TestMethod]
+ public async Task TestUploadWithCancellation()
+ {
+ var filePath = $"{TestingPath}/{DateTime.Now.Ticks}.txt";
+ await Assert.ThrowsExceptionAsync(async () =>
+ {
+ using var cts = new CancellationTokenSource();
+ var response = client.Files.UploadAsync(filePath, body: GetStream("abc"), cancellationToken: cts.Token);
+ cts.Cancel();
+ await response;
+ });
+ await Assert.ThrowsExceptionAsync>(async () =>
+ {
+ await client.Files.GetMetadataAsync(filePath);
+ });
+ }
+
+ ///
+ /// Test CreateFolder with cancellation token.
+ ///
+ /// The .
+ [TestMethod]
+ public async Task TestCreateFolderWithCancellation()
+ {
+ var folderPath = $"{TestingPath}/{DateTime.Now.Ticks}";
+ await Assert.ThrowsExceptionAsync(async () =>
+ {
+ using var cts = new CancellationTokenSource();
+ var response = client.Files.CreateFolderAsync(folderPath, cancellationToken: cts.Token);
+ cts.Cancel();
+ await response;
+ });
+ await Assert.ThrowsExceptionAsync>(async () =>
+ {
+ await client.Files.GetMetadataAsync(folderPath);
+ });
+ }
+
+ ///
+ /// Test refresh access token with cancellation token.
+ ///
+ /// The .
+ [TestMethod]
+ public async Task TestRefreshAccessTokenWithCancellation()
+ {
+ await Assert.ThrowsExceptionAsync(async () =>
+ {
+ var clientToRefreshToken = new DropboxClient(userRefreshToken, appKey, appSecret);
+ using var cts = new CancellationTokenSource();
+ var response = clientToRefreshToken.RefreshAccessToken(Array.Empty(), cts.Token);
+ cts.Cancel();
+ var isRefreshed = await response;
+ Assert.IsFalse(isRefreshed);
+ });
+ }
+
///
/// Converts string to a memory stream.
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/StoneTests.cs b/dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/StoneTests.cs
index 58b8eae41f..ec8403db88 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/StoneTests.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/StoneTests.cs
@@ -7,6 +7,8 @@
namespace Dropbox.Api.Unit.Tests
{
using System;
+ using System.Threading;
+ using System.Threading.Tasks;
using Dropbox.Api.Files;
using Dropbox.Api.Stone;
using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -21,9 +23,9 @@ public class StoneTests
/// Smoke test for nested unions.
///
[TestMethod]
- public void TestNestedUnion()
+ public async Task TestNestedUnion()
{
- var result = JsonWriter.Write(
+ var result = await JsonWriter.WriteAsync(
new GetMetadataError.Path(LookupError.NotFound.Instance),
GetMetadataError.Encoder);
@@ -32,5 +34,23 @@ public void TestNestedUnion()
Assert.IsTrue(obj.IsPath);
Assert.IsTrue(obj.AsPath.Value.IsNotFound);
}
+
+ ///
+ /// Smoke test for JsonWriter with cancellation token.
+ ///
+ /// A representing the result of the asynchronous operation.
+ [TestMethod]
+ public async Task TestNestedUnionWithCancellation()
+ {
+ using var cts = new CancellationTokenSource();
+ cts.Cancel();
+ await Assert.ThrowsExceptionAsync(async () =>
+ {
+ await JsonWriter.WriteAsync(
+ new GetMetadataError.Path(LookupError.NotFound.Instance),
+ GetMetadataError.Encoder,
+ cancellationToken: cts.Token);
+ });
+ }
}
-}
+}
\ No newline at end of file
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/DropboxClient.cs b/dropbox-sdk-dotnet/Dropbox.Api/DropboxClient.cs
index 3fa3a850f9..61602f9e0f 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/DropboxClient.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/DropboxClient.cs
@@ -7,6 +7,7 @@
namespace Dropbox.Api
{
using System;
+ using System.Threading;
using System.Threading.Tasks;
using Dropbox.Api.Common;
@@ -256,10 +257,11 @@ public DropboxClient WithPathRoot(PathRoot pathRoot)
/// Refreshes access token regardless of if existing token is expired.
///
/// subset of scopes to refresh token with, or null to refresh with all scopes.
+ /// The cancellation token to cancel operation.
/// true if token is successfully refreshed, false otherwise.
- public Task RefreshAccessToken(string[] scopeList)
+ public Task RefreshAccessToken(string[] scopeList, CancellationToken cancellationToken = default)
{
- return this.requestHandler.RefreshAccessToken(scopeList);
+ return this.requestHandler.RefreshAccessToken(scopeList, cancellationToken);
}
}
}
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/DropboxRequestHandler.cs b/dropbox-sdk-dotnet/Dropbox.Api/DropboxRequestHandler.cs
index e6a4656fd9..c085189d37 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/DropboxRequestHandler.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/DropboxRequestHandler.cs
@@ -4,6 +4,8 @@
//
//-----------------------------------------------------------------------------
+using System.Threading;
+
namespace Dropbox.Api
{
using System;
@@ -131,6 +133,7 @@ internal enum RouteStyle
/// The request encoder.
/// The response decoder.
/// The error decoder.
+ /// The cancellation token to cancel operation.
/// An asynchronous task for the response.
///
/// This exception is thrown when there is an error reported by the server.
@@ -142,10 +145,11 @@ async Task ITransport.SendRpcRequestAsync requestEncoder,
IDecoder responseDecoder,
- IDecoder errorDecoder)
+ IDecoder errorDecoder,
+ CancellationToken cancellationToken)
{
- var serializedArg = JsonWriter.Write(request, requestEncoder);
- var res = await this.RequestJsonStringWithRetry(host, route, auth, RouteStyle.Rpc, serializedArg)
+ var serializedArg = await JsonWriter.WriteAsync(request, requestEncoder, cancellationToken: cancellationToken);
+ var res = await this.RequestJsonStringWithRetry(host, route, auth, RouteStyle.Rpc, serializedArg, cancellationToken: cancellationToken)
.ConfigureAwait(false);
if (res.IsError)
@@ -171,6 +175,7 @@ async Task ITransport.SendRpcRequestAsyncThe request encoder.
/// The response decoder.
/// The error decoder.
+ /// The cancellation token to cancel operation.
/// An asynchronous task for the response.
///
/// This exception is thrown when there is an error reported by the server.
@@ -183,10 +188,11 @@ async Task ITransport.SendUploadRequestAsync requestEncoder,
IDecoder responseDecoder,
- IDecoder errorDecoder)
+ IDecoder errorDecoder,
+ CancellationToken cancellationToken)
{
- var serializedArg = JsonWriter.Write(request, requestEncoder, true);
- var res = await this.RequestJsonStringWithRetry(host, route, auth, RouteStyle.Upload, serializedArg, body)
+ var serializedArg = await JsonWriter.WriteAsync(request, requestEncoder, true, cancellationToken);
+ var res = await this.RequestJsonStringWithRetry(host, route, auth, RouteStyle.Upload, serializedArg, body, cancellationToken)
.ConfigureAwait(false);
if (res.IsError)
@@ -211,6 +217,7 @@ async Task ITransport.SendUploadRequestAsyncThe request encoder.
/// The response decoder.
/// The error decoder.
+ /// The cancellation token to cancel operation.
/// An asynchronous task for the response.
///
/// This exception is thrown when there is an error reported by the server.
@@ -222,10 +229,11 @@ async Task> ITransport.SendDownloadRequestAsync requestEncoder,
IDecoder responseDecoder,
- IDecoder errorDecoder)
+ IDecoder errorDecoder,
+ CancellationToken cancellationToken)
{
- var serializedArg = JsonWriter.Write(request, requestEncoder, true);
- var res = await this.RequestJsonStringWithRetry(host, route, auth, RouteStyle.Download, serializedArg)
+ var serializedArg = await JsonWriter.WriteAsync(request, requestEncoder, true, cancellationToken);
+ var res = await this.RequestJsonStringWithRetry(host, route, auth, RouteStyle.Download, serializedArg, cancellationToken: cancellationToken)
.ConfigureAwait(false);
if (res.IsError)
@@ -242,8 +250,9 @@ async Task> ITransport.SendDownloadRequestAsync
/// The scope list.
+ /// The cancellation token to cancel operation.
/// A representing the result of the asynchronous operation.
- public async Task RefreshAccessToken(string[] scopeList = null)
+ public async Task RefreshAccessToken(string[] scopeList = null, CancellationToken cancellationToken = default)
{
if (this.options.OAuth2RefreshToken == null || this.options.AppKey == null)
{
@@ -272,7 +281,7 @@ public async Task RefreshAccessToken(string[] scopeList = null)
var bodyContent = new FormUrlEncodedContent(parameters);
- var response = await this.defaultHttpClient.PostAsync(url, bodyContent).ConfigureAwait(false);
+ var response = await this.defaultHttpClient.PostAsync(url, bodyContent, cancellationToken).ConfigureAwait(false);
// if response is an invalid grant, we want to throw this exception rather than the one thrown in
// response.EnsureSuccessStatusCode();
@@ -338,6 +347,7 @@ internal DropboxRequestHandler WithPathRoot(PathRoot pathRoot)
/// The request argument.
/// The body to upload if
/// is .
+ /// The cancellation token to cancel operation.
/// The asynchronous task with the result.
private async Task RequestJsonStringWithRetry(
string host,
@@ -345,7 +355,8 @@ private async Task RequestJsonStringWithRetry(
string auth,
RouteStyle routeStyle,
string requestArg,
- Stream body = null)
+ Stream body = null,
+ CancellationToken cancellationToken = default)
{
var attempt = 0;
var hasRefreshed = false;
@@ -367,14 +378,14 @@ private async Task RequestJsonStringWithRetry(
}
}
- await this.CheckAndRefreshAccessToken();
+ await this.CheckAndRefreshAccessToken(cancellationToken);
try
{
while (true)
{
try
{
- return await this.RequestJsonString(host, routeName, auth, routeStyle, requestArg, body)
+ return await this.RequestJsonString(host, routeName, auth, routeStyle, requestArg, body, cancellationToken)
.ConfigureAwait(false);
}
catch (AuthException e)
@@ -387,7 +398,7 @@ private async Task RequestJsonStringWithRetry(
}
else
{
- await this.RefreshAccessToken();
+ await this.RefreshAccessToken(cancellationToken: cancellationToken);
hasRefreshed = true;
}
}
@@ -418,9 +429,9 @@ private async Task RequestJsonStringWithRetry(
// use exponential backoff
var backoff = TimeSpan.FromSeconds(Math.Pow(2, attempt) * r.NextDouble());
#if PORTABLE40
- await TaskEx.Delay(backoff);
+ await TaskEx.Delay(backoff, cancellationToken);
#else
- await Task.Delay(backoff).ConfigureAwait(false);
+ await Task.Delay(backoff, cancellationToken).ConfigureAwait(false);
#endif
if (body != null)
{
@@ -471,6 +482,7 @@ private string CheckForError(string text)
/// The request argument.
/// The body to upload if
/// is .
+ /// The cancellation token to cancel operation.
/// The asynchronous task with the result.
private async Task RequestJsonString(
string host,
@@ -478,7 +490,8 @@ private async Task RequestJsonString(
string auth,
RouteStyle routeStyle,
string requestArg,
- Stream body = null)
+ Stream body = null,
+ CancellationToken cancellationToken = default)
{
var hostname = this.options.HostMap[host];
var uri = this.GetRouteUri(hostname, routeName);
@@ -517,7 +530,7 @@ private async Task RequestJsonString(
{
request.Headers.TryAddWithoutValidation(
"Dropbox-Api-Path-Root",
- JsonWriter.Write(this.pathRoot, PathRoot.Encoder));
+ await JsonWriter.WriteAsync(this.pathRoot, PathRoot.Encoder, cancellationToken: cancellationToken));
}
var completionOption = HttpCompletionOption.ResponseContentRead;
@@ -554,7 +567,7 @@ private async Task RequestJsonString(
}
var disposeResponse = true;
- var response = await this.GetHttpClient(host).SendAsync(request, completionOption).ConfigureAwait(false);
+ var response = await this.GetHttpClient(host).SendAsync(request, completionOption, cancellationToken).ConfigureAwait(false);
var requestId = this.GetRequestId(response);
try
@@ -640,14 +653,14 @@ private async Task RequestJsonString(
}
}
- private async Task CheckAndRefreshAccessToken()
+ private async Task CheckAndRefreshAccessToken(CancellationToken cancellationToken)
{
bool canRefresh = this.options.OAuth2RefreshToken != null && this.options.AppKey != null;
bool needsRefresh = this.options.OAuth2AccessTokenExpiresAt.HasValue && DateTime.Now.AddSeconds(TokenExpirationBuffer) >= this.options.OAuth2AccessTokenExpiresAt.Value;
bool needsToken = this.options.OAuth2AccessToken == null;
if ((needsRefresh || needsToken) && canRefresh)
{
- return await this.RefreshAccessToken();
+ return await this.RefreshAccessToken(cancellationToken: cancellationToken);
}
return false;
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Account/AccountUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Account/AccountUserRoutes.cs
index 4fb6ee6784..48c2a259f7 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Account/AccountUserRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Account/AccountUserRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Account.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -34,14 +35,15 @@ internal AccountUserRoutes(enc.ITransport transport)
/// Sets a user's profile photo.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task SetProfilePhotoAsync(SetProfilePhotoArg setProfilePhotoArg)
+ public t.Task SetProfilePhotoAsync(SetProfilePhotoArg setProfilePhotoArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(setProfilePhotoArg, "api", "/account/set_profile_photo", "user", global::Dropbox.Api.Account.SetProfilePhotoArg.Encoder, global::Dropbox.Api.Account.SetProfilePhotoResult.Decoder, global::Dropbox.Api.Account.SetProfilePhotoError.Decoder);
+ return this.Transport.SendRpcRequestAsync(setProfilePhotoArg, "api", "/account/set_profile_photo", "user", global::Dropbox.Api.Account.SetProfilePhotoArg.Encoder, global::Dropbox.Api.Account.SetProfilePhotoResult.Decoder, global::Dropbox.Api.Account.SetProfilePhotoError.Decoder, cancellationToken);
}
///
@@ -64,16 +66,18 @@ public sys.IAsyncResult BeginSetProfilePhoto(SetProfilePhotoArg setProfilePhotoA
/// Sets a user's profile photo.
///
/// Image to set as the user's new profile photo.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task SetProfilePhotoAsync(PhotoSourceArg photo)
+ public t.Task SetProfilePhotoAsync(PhotoSourceArg photo,
+ tr.CancellationToken cancellationToken = default)
{
var setProfilePhotoArg = new SetProfilePhotoArg(photo);
- return this.SetProfilePhotoAsync(setProfilePhotoArg);
+ return this.SetProfilePhotoAsync(setProfilePhotoArg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthAppRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthAppRoutes.cs
index ec25bdee80..62f7025052 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthAppRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthAppRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Auth.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -34,14 +35,15 @@ internal AuthAppRoutes(enc.ITransport transport)
/// token.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TokenFromOauth1Async(TokenFromOAuth1Arg tokenFromOAuth1Arg)
+ public t.Task TokenFromOauth1Async(TokenFromOAuth1Arg tokenFromOAuth1Arg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(tokenFromOAuth1Arg, "api", "/auth/token/from_oauth1", "app", global::Dropbox.Api.Auth.TokenFromOAuth1Arg.Encoder, global::Dropbox.Api.Auth.TokenFromOAuth1Result.Decoder, global::Dropbox.Api.Auth.TokenFromOAuth1Error.Decoder);
+ return this.Transport.SendRpcRequestAsync(tokenFromOAuth1Arg, "api", "/auth/token/from_oauth1", "app", global::Dropbox.Api.Auth.TokenFromOAuth1Arg.Encoder, global::Dropbox.Api.Auth.TokenFromOAuth1Result.Decoder, global::Dropbox.Api.Auth.TokenFromOAuth1Error.Decoder, cancellationToken);
}
///
@@ -67,18 +69,20 @@ public sys.IAsyncResult BeginTokenFromOauth1(TokenFromOAuth1Arg tokenFromOAuth1A
/// The supplied OAuth 1.0 access token.
/// The token secret associated with the supplied
/// access token.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
public t.Task TokenFromOauth1Async(string oauth1Token,
- string oauth1TokenSecret)
+ string oauth1TokenSecret,
+ tr.CancellationToken cancellationToken = default)
{
var tokenFromOAuth1Arg = new TokenFromOAuth1Arg(oauth1Token,
oauth1TokenSecret);
- return this.TokenFromOauth1Async(tokenFromOAuth1Arg);
+ return this.TokenFromOauth1Async(tokenFromOAuth1Arg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthUserRoutes.cs
index 0334fd481f..041a37234f 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthUserRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthUserRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Auth.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -32,10 +33,11 @@ internal AuthUserRoutes(enc.ITransport transport)
///
/// Disables the access token used to authenticate the call.
///
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
- public t.Task TokenRevokeAsync()
+ public t.Task TokenRevokeAsync(tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/auth/token/revoke", "user", enc.EmptyEncoder.Instance, enc.EmptyDecoder.Instance, enc.EmptyDecoder.Instance);
+ return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/auth/token/revoke", "user", enc.EmptyEncoder.Instance, enc.EmptyDecoder.Instance, enc.EmptyDecoder.Instance, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckAppRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckAppRoutes.cs
index 4ae125ab89..03fb920efe 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckAppRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckAppRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Check.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -37,11 +38,12 @@ internal CheckAppRoutes(enc.ITransport transport)
/// infrastructure is working and that the app key and secret valid.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
- public t.Task AppAsync(EchoArg echoArg)
+ public t.Task AppAsync(EchoArg echoArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(echoArg, "api", "/check/app", "app", global::Dropbox.Api.Check.EchoArg.Encoder, global::Dropbox.Api.Check.EchoResult.Decoder, enc.EmptyDecoder.Instance);
+ return this.Transport.SendRpcRequestAsync(echoArg, "api", "/check/app", "app", global::Dropbox.Api.Check.EchoArg.Encoder, global::Dropbox.Api.Check.EchoResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken);
}
///
@@ -68,13 +70,15 @@ public sys.IAsyncResult BeginApp(EchoArg echoArg, sys.AsyncCallback callback, ob
/// infrastructure is working and that the app key and secret valid.
///
/// The string that you'd like to be echoed back to you.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
- public t.Task AppAsync(string query = "")
+ public t.Task AppAsync(string query = "",
+ tr.CancellationToken cancellationToken = default)
{
var echoArg = new EchoArg(query);
- return this.AppAsync(echoArg);
+ return this.AppAsync(echoArg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckUserRoutes.cs
index 9ddb8b932a..f580de0029 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckUserRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Check/CheckUserRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Check.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -38,11 +39,12 @@ internal CheckUserRoutes(enc.ITransport transport)
/// infrastructure is working and that the access token is valid.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
- public t.Task UserAsync(EchoArg echoArg)
+ public t.Task UserAsync(EchoArg echoArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(echoArg, "api", "/check/user", "user", global::Dropbox.Api.Check.EchoArg.Encoder, global::Dropbox.Api.Check.EchoResult.Decoder, enc.EmptyDecoder.Instance);
+ return this.Transport.SendRpcRequestAsync(echoArg, "api", "/check/user", "user", global::Dropbox.Api.Check.EchoArg.Encoder, global::Dropbox.Api.Check.EchoResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken);
}
///
@@ -69,13 +71,15 @@ public sys.IAsyncResult BeginUser(EchoArg echoArg, sys.AsyncCallback callback, o
/// infrastructure is working and that the access token is valid.
///
/// The string that you'd like to be echoed back to you.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
- public t.Task UserAsync(string query = "")
+ public t.Task UserAsync(string query = "",
+ tr.CancellationToken cancellationToken = default)
{
var echoArg = new EchoArg(query);
- return this.UserAsync(echoArg);
+ return this.UserAsync(echoArg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Contacts/ContactsUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Contacts/ContactsUserRoutes.cs
index 6ec1718284..46baf39639 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Contacts/ContactsUserRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Contacts/ContactsUserRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Contacts.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -34,10 +35,11 @@ internal ContactsUserRoutes(enc.ITransport transport)
/// Removes all manually added contacts. You'll still keep contacts who are on
/// your team or who you imported. New contacts will be added when you share.
///
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
- public t.Task DeleteManualContactsAsync()
+ public t.Task DeleteManualContactsAsync(tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/contacts/delete_manual_contacts", "user", enc.EmptyEncoder.Instance, enc.EmptyDecoder.Instance, enc.EmptyDecoder.Instance);
+ return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/contacts/delete_manual_contacts", "user", enc.EmptyEncoder.Instance, enc.EmptyDecoder.Instance, enc.EmptyDecoder.Instance, cancellationToken);
}
///
@@ -74,13 +76,14 @@ public void EndDeleteManualContacts(sys.IAsyncResult asyncResult)
/// Removes manually added contacts from the given list.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task DeleteManualContactsBatchAsync(DeleteManualContactsArg deleteManualContactsArg)
+ public t.Task DeleteManualContactsBatchAsync(DeleteManualContactsArg deleteManualContactsArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(deleteManualContactsArg, "api", "/contacts/delete_manual_contacts_batch", "user", global::Dropbox.Api.Contacts.DeleteManualContactsArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Contacts.DeleteManualContactsError.Decoder);
+ return this.Transport.SendRpcRequestAsync(deleteManualContactsArg, "api", "/contacts/delete_manual_contacts_batch", "user", global::Dropbox.Api.Contacts.DeleteManualContactsArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Contacts.DeleteManualContactsError.Decoder, cancellationToken);
}
///
@@ -103,15 +106,17 @@ public sys.IAsyncResult BeginDeleteManualContactsBatch(DeleteManualContactsArg d
/// Removes manually added contacts from the given list.
///
/// List of manually added contacts to be deleted.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task DeleteManualContactsBatchAsync(col.IEnumerable emailAddresses)
+ public t.Task DeleteManualContactsBatchAsync(col.IEnumerable emailAddresses,
+ tr.CancellationToken cancellationToken = default)
{
var deleteManualContactsArg = new DeleteManualContactsArg(emailAddresses);
- return this.DeleteManualContactsBatchAsync(deleteManualContactsArg);
+ return this.DeleteManualContactsBatchAsync(deleteManualContactsArg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesTeamRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesTeamRoutes.cs
index ca92430c26..2e73b1eb37 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesTeamRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesTeamRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.FileProperties.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -37,14 +38,15 @@ internal FilePropertiesTeamRoutes(enc.ITransport transport)
/// Note: this endpoint will create team-owned templates.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesAddForTeamAsync(AddTemplateArg addTemplateArg)
+ public t.Task TemplatesAddForTeamAsync(AddTemplateArg addTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(addTemplateArg, "api", "/file_properties/templates/add_for_team", "team", global::Dropbox.Api.FileProperties.AddTemplateArg.Encoder, global::Dropbox.Api.FileProperties.AddTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(addTemplateArg, "api", "/file_properties/templates/add_for_team", "team", global::Dropbox.Api.FileProperties.AddTemplateArg.Encoder, global::Dropbox.Api.FileProperties.AddTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder, cancellationToken);
}
///
@@ -75,6 +77,7 @@ public sys.IAsyncResult BeginTemplatesAddForTeam(AddTemplateArg addTemplateArg,
/// be up to 1024 bytes.
/// Definitions of the property fields associated with this
/// template. There can be up to 32 properties in a single template.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
@@ -82,13 +85,14 @@ public sys.IAsyncResult BeginTemplatesAddForTeam(AddTemplateArg addTemplateArg,
/// cref="ModifyTemplateError"/>.
public t.Task TemplatesAddForTeamAsync(string name,
string description,
- col.IEnumerable fields)
+ col.IEnumerable fields,
+ tr.CancellationToken cancellationToken = default)
{
var addTemplateArg = new AddTemplateArg(name,
description,
fields);
- return this.TemplatesAddForTeamAsync(addTemplateArg);
+ return this.TemplatesAddForTeamAsync(addTemplateArg, cancellationToken);
}
///
@@ -143,14 +147,15 @@ public AddTemplateResult EndTemplatesAddForTeam(sys.IAsyncResult asyncResult)
/// Get the schema for a specified template.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesGetForTeamAsync(GetTemplateArg getTemplateArg)
+ public t.Task TemplatesGetForTeamAsync(GetTemplateArg getTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(getTemplateArg, "api", "/file_properties/templates/get_for_team", "team", global::Dropbox.Api.FileProperties.GetTemplateArg.Encoder, global::Dropbox.Api.FileProperties.GetTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(getTemplateArg, "api", "/file_properties/templates/get_for_team", "team", global::Dropbox.Api.FileProperties.GetTemplateArg.Encoder, global::Dropbox.Api.FileProperties.GetTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken);
}
///
@@ -177,16 +182,18 @@ public sys.IAsyncResult BeginTemplatesGetForTeam(GetTemplateArg getTemplateArg,
/// /> or .
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesGetForTeamAsync(string templateId)
+ public t.Task TemplatesGetForTeamAsync(string templateId,
+ tr.CancellationToken cancellationToken = default)
{
var getTemplateArg = new GetTemplateArg(templateId);
- return this.TemplatesGetForTeamAsync(getTemplateArg);
+ return this.TemplatesGetForTeamAsync(getTemplateArg, cancellationToken);
}
///
@@ -238,14 +245,15 @@ public GetTemplateResult EndTemplatesGetForTeam(sys.IAsyncResult asyncResult)
/// cref="Dropbox.Api.FileProperties.Routes.FilePropertiesTeamRoutes.TemplatesGetForTeamAsync"
/// />.
///
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesListForTeamAsync()
+ public t.Task TemplatesListForTeamAsync(tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_properties/templates/list_for_team", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_properties/templates/list_for_team", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken);
}
///
@@ -291,13 +299,14 @@ public ListTemplateResult EndTemplatesListForTeam(sys.IAsyncResult asyncResult)
/// cannot be undone.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesRemoveForTeamAsync(RemoveTemplateArg removeTemplateArg)
+ public t.Task TemplatesRemoveForTeamAsync(RemoveTemplateArg removeTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(removeTemplateArg, "api", "/file_properties/templates/remove_for_team", "team", global::Dropbox.Api.FileProperties.RemoveTemplateArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.TemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(removeTemplateArg, "api", "/file_properties/templates/remove_for_team", "team", global::Dropbox.Api.FileProperties.RemoveTemplateArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken);
}
///
@@ -327,15 +336,17 @@ public sys.IAsyncResult BeginTemplatesRemoveForTeam(RemoveTemplateArg removeTemp
/// /> or .
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesRemoveForTeamAsync(string templateId)
+ public t.Task TemplatesRemoveForTeamAsync(string templateId,
+ tr.CancellationToken cancellationToken = default)
{
var removeTemplateArg = new RemoveTemplateArg(templateId);
- return this.TemplatesRemoveForTeamAsync(removeTemplateArg);
+ return this.TemplatesRemoveForTeamAsync(removeTemplateArg, cancellationToken);
}
///
@@ -383,14 +394,15 @@ public void EndTemplatesRemoveForTeam(sys.IAsyncResult asyncResult)
/// name, the template description and add optional properties to templates.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesUpdateForTeamAsync(UpdateTemplateArg updateTemplateArg)
+ public t.Task TemplatesUpdateForTeamAsync(UpdateTemplateArg updateTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(updateTemplateArg, "api", "/file_properties/templates/update_for_team", "team", global::Dropbox.Api.FileProperties.UpdateTemplateArg.Encoder, global::Dropbox.Api.FileProperties.UpdateTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(updateTemplateArg, "api", "/file_properties/templates/update_for_team", "team", global::Dropbox.Api.FileProperties.UpdateTemplateArg.Encoder, global::Dropbox.Api.FileProperties.UpdateTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder, cancellationToken);
}
///
@@ -424,6 +436,7 @@ public sys.IAsyncResult BeginTemplatesUpdateForTeam(UpdateTemplateArg updateTemp
/// can be up to 1024 bytes.
/// Property field templates to be added to the group template.
/// There can be up to 32 properties in a single template.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
@@ -432,14 +445,15 @@ public sys.IAsyncResult BeginTemplatesUpdateForTeam(UpdateTemplateArg updateTemp
public t.Task TemplatesUpdateForTeamAsync(string templateId,
string name = null,
string description = null,
- col.IEnumerable addFields = null)
+ col.IEnumerable addFields = null,
+ tr.CancellationToken cancellationToken = default)
{
var updateTemplateArg = new UpdateTemplateArg(templateId,
name,
description,
addFields);
- return this.TemplatesUpdateForTeamAsync(updateTemplateArg);
+ return this.TemplatesUpdateForTeamAsync(updateTemplateArg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesUserRoutes.cs
index 1e4bcd3b63..2279083f15 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesUserRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileProperties/FilePropertiesUserRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.FileProperties.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -38,13 +39,14 @@ internal FilePropertiesUserRoutes(enc.ITransport transport)
/// /> to create new templates.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task PropertiesAddAsync(AddPropertiesArg addPropertiesArg)
+ public t.Task PropertiesAddAsync(AddPropertiesArg addPropertiesArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(addPropertiesArg, "api", "/file_properties/properties/add", "user", global::Dropbox.Api.FileProperties.AddPropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.AddPropertiesError.Decoder);
+ return this.Transport.SendRpcRequestAsync(addPropertiesArg, "api", "/file_properties/properties/add", "user", global::Dropbox.Api.FileProperties.AddPropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.AddPropertiesError.Decoder, cancellationToken);
}
///
@@ -73,17 +75,19 @@ public sys.IAsyncResult BeginPropertiesAdd(AddPropertiesArg addPropertiesArg, sy
/// A unique identifier for the file or folder.
/// The property groups which are to be added to a Dropbox
/// file. No two groups in the input should refer to the same template.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
public t.Task PropertiesAddAsync(string path,
- col.IEnumerable propertyGroups)
+ col.IEnumerable propertyGroups,
+ tr.CancellationToken cancellationToken = default)
{
var addPropertiesArg = new AddPropertiesArg(path,
propertyGroups);
- return this.PropertiesAddAsync(addPropertiesArg);
+ return this.PropertiesAddAsync(addPropertiesArg, cancellationToken);
}
///
@@ -137,13 +141,14 @@ public void EndPropertiesAdd(sys.IAsyncResult asyncResult)
/// /> will only delete fields that are explicitly marked for deletion.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task PropertiesOverwriteAsync(OverwritePropertyGroupArg overwritePropertyGroupArg)
+ public t.Task PropertiesOverwriteAsync(OverwritePropertyGroupArg overwritePropertyGroupArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(overwritePropertyGroupArg, "api", "/file_properties/properties/overwrite", "user", global::Dropbox.Api.FileProperties.OverwritePropertyGroupArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.InvalidPropertyGroupError.Decoder);
+ return this.Transport.SendRpcRequestAsync(overwritePropertyGroupArg, "api", "/file_properties/properties/overwrite", "user", global::Dropbox.Api.FileProperties.OverwritePropertyGroupArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.InvalidPropertyGroupError.Decoder, cancellationToken);
}
///
@@ -175,17 +180,19 @@ public sys.IAsyncResult BeginPropertiesOverwrite(OverwritePropertyGroupArg overw
/// A unique identifier for the file or folder.
/// The property groups "snapshot" updates to force apply.
/// No two groups in the input should refer to the same template.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
public t.Task PropertiesOverwriteAsync(string path,
- col.IEnumerable propertyGroups)
+ col.IEnumerable propertyGroups,
+ tr.CancellationToken cancellationToken = default)
{
var overwritePropertyGroupArg = new OverwritePropertyGroupArg(path,
propertyGroups);
- return this.PropertiesOverwriteAsync(overwritePropertyGroupArg);
+ return this.PropertiesOverwriteAsync(overwritePropertyGroupArg, cancellationToken);
}
///
@@ -243,13 +250,14 @@ public void EndPropertiesOverwrite(sys.IAsyncResult asyncResult)
/// />.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task PropertiesRemoveAsync(RemovePropertiesArg removePropertiesArg)
+ public t.Task PropertiesRemoveAsync(RemovePropertiesArg removePropertiesArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(removePropertiesArg, "api", "/file_properties/properties/remove", "user", global::Dropbox.Api.FileProperties.RemovePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.RemovePropertiesError.Decoder);
+ return this.Transport.SendRpcRequestAsync(removePropertiesArg, "api", "/file_properties/properties/remove", "user", global::Dropbox.Api.FileProperties.RemovePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.RemovePropertiesError.Decoder, cancellationToken);
}
///
@@ -289,17 +297,19 @@ public sys.IAsyncResult BeginPropertiesRemove(RemovePropertiesArg removeProperti
/// /> or .
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
public t.Task PropertiesRemoveAsync(string path,
- col.IEnumerable propertyTemplateIds)
+ col.IEnumerable propertyTemplateIds,
+ tr.CancellationToken cancellationToken = default)
{
var removePropertiesArg = new RemovePropertiesArg(path,
propertyTemplateIds);
- return this.PropertiesRemoveAsync(removePropertiesArg);
+ return this.PropertiesRemoveAsync(removePropertiesArg, cancellationToken);
}
///
@@ -350,14 +360,15 @@ public void EndPropertiesRemove(sys.IAsyncResult asyncResult)
/// Search across property templates for particular property field values.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task PropertiesSearchAsync(PropertiesSearchArg propertiesSearchArg)
+ public t.Task PropertiesSearchAsync(PropertiesSearchArg propertiesSearchArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(propertiesSearchArg, "api", "/file_properties/properties/search", "user", global::Dropbox.Api.FileProperties.PropertiesSearchArg.Encoder, global::Dropbox.Api.FileProperties.PropertiesSearchResult.Decoder, global::Dropbox.Api.FileProperties.PropertiesSearchError.Decoder);
+ return this.Transport.SendRpcRequestAsync(propertiesSearchArg, "api", "/file_properties/properties/search", "user", global::Dropbox.Api.FileProperties.PropertiesSearchArg.Encoder, global::Dropbox.Api.FileProperties.PropertiesSearchResult.Decoder, global::Dropbox.Api.FileProperties.PropertiesSearchError.Decoder, cancellationToken);
}
///
@@ -382,18 +393,20 @@ public sys.IAsyncResult BeginPropertiesSearch(PropertiesSearchArg propertiesSear
/// Queries to search.
/// Filter results to contain only properties associated
/// with these template IDs.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
public t.Task PropertiesSearchAsync(col.IEnumerable queries,
- TemplateFilter templateFilter = null)
+ TemplateFilter templateFilter = null,
+ tr.CancellationToken cancellationToken = default)
{
var propertiesSearchArg = new PropertiesSearchArg(queries,
templateFilter);
- return this.PropertiesSearchAsync(propertiesSearchArg);
+ return this.PropertiesSearchAsync(propertiesSearchArg, cancellationToken);
}
///
@@ -445,14 +458,15 @@ public PropertiesSearchResult EndPropertiesSearch(sys.IAsyncResult asyncResult)
/// />, use this to paginate through all search results.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task PropertiesSearchContinueAsync(PropertiesSearchContinueArg propertiesSearchContinueArg)
+ public t.Task PropertiesSearchContinueAsync(PropertiesSearchContinueArg propertiesSearchContinueArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(propertiesSearchContinueArg, "api", "/file_properties/properties/search/continue", "user", global::Dropbox.Api.FileProperties.PropertiesSearchContinueArg.Encoder, global::Dropbox.Api.FileProperties.PropertiesSearchResult.Decoder, global::Dropbox.Api.FileProperties.PropertiesSearchContinueError.Decoder);
+ return this.Transport.SendRpcRequestAsync(propertiesSearchContinueArg, "api", "/file_properties/properties/search/continue", "user", global::Dropbox.Api.FileProperties.PropertiesSearchContinueArg.Encoder, global::Dropbox.Api.FileProperties.PropertiesSearchResult.Decoder, global::Dropbox.Api.FileProperties.PropertiesSearchContinueError.Decoder, cancellationToken);
}
///
@@ -481,16 +495,18 @@ public sys.IAsyncResult BeginPropertiesSearchContinue(PropertiesSearchContinueAr
/// /> or .
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task PropertiesSearchContinueAsync(string cursor)
+ public t.Task PropertiesSearchContinueAsync(string cursor,
+ tr.CancellationToken cancellationToken = default)
{
var propertiesSearchContinueArg = new PropertiesSearchContinueArg(cursor);
- return this.PropertiesSearchContinueAsync(propertiesSearchContinueArg);
+ return this.PropertiesSearchContinueAsync(propertiesSearchContinueArg, cancellationToken);
}
///
@@ -547,13 +563,14 @@ public PropertiesSearchResult EndPropertiesSearchContinue(sys.IAsyncResult async
/// /> will delete any fields that are omitted from a property group.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task PropertiesUpdateAsync(UpdatePropertiesArg updatePropertiesArg)
+ public t.Task PropertiesUpdateAsync(UpdatePropertiesArg updatePropertiesArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(updatePropertiesArg, "api", "/file_properties/properties/update", "user", global::Dropbox.Api.FileProperties.UpdatePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.UpdatePropertiesError.Decoder);
+ return this.Transport.SendRpcRequestAsync(updatePropertiesArg, "api", "/file_properties/properties/update", "user", global::Dropbox.Api.FileProperties.UpdatePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.UpdatePropertiesError.Decoder, cancellationToken);
}
///
@@ -585,17 +602,19 @@ public sys.IAsyncResult BeginPropertiesUpdate(UpdatePropertiesArg updateProperti
/// A unique identifier for the file or folder.
/// The property groups "delta" updates to
/// apply.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
public t.Task PropertiesUpdateAsync(string path,
- col.IEnumerable updatePropertyGroups)
+ col.IEnumerable updatePropertyGroups,
+ tr.CancellationToken cancellationToken = default)
{
var updatePropertiesArg = new UpdatePropertiesArg(path,
updatePropertyGroups);
- return this.PropertiesUpdateAsync(updatePropertiesArg);
+ return this.PropertiesUpdateAsync(updatePropertiesArg, cancellationToken);
}
///
@@ -645,14 +664,15 @@ public void EndPropertiesUpdate(sys.IAsyncResult asyncResult)
/// admin's behalf.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesAddForUserAsync(AddTemplateArg addTemplateArg)
+ public t.Task TemplatesAddForUserAsync(AddTemplateArg addTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(addTemplateArg, "api", "/file_properties/templates/add_for_user", "user", global::Dropbox.Api.FileProperties.AddTemplateArg.Encoder, global::Dropbox.Api.FileProperties.AddTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(addTemplateArg, "api", "/file_properties/templates/add_for_user", "user", global::Dropbox.Api.FileProperties.AddTemplateArg.Encoder, global::Dropbox.Api.FileProperties.AddTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder, cancellationToken);
}
///
@@ -683,6 +703,7 @@ public sys.IAsyncResult BeginTemplatesAddForUser(AddTemplateArg addTemplateArg,
/// be up to 1024 bytes.
/// Definitions of the property fields associated with this
/// template. There can be up to 32 properties in a single template.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
@@ -690,13 +711,14 @@ public sys.IAsyncResult BeginTemplatesAddForUser(AddTemplateArg addTemplateArg,
/// cref="ModifyTemplateError"/>.
public t.Task TemplatesAddForUserAsync(string name,
string description,
- col.IEnumerable fields)
+ col.IEnumerable fields,
+ tr.CancellationToken cancellationToken = default)
{
var addTemplateArg = new AddTemplateArg(name,
description,
fields);
- return this.TemplatesAddForUserAsync(addTemplateArg);
+ return this.TemplatesAddForUserAsync(addTemplateArg, cancellationToken);
}
///
@@ -752,14 +774,15 @@ public AddTemplateResult EndTemplatesAddForUser(sys.IAsyncResult asyncResult)
/// team member or admin's behalf.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesGetForUserAsync(GetTemplateArg getTemplateArg)
+ public t.Task TemplatesGetForUserAsync(GetTemplateArg getTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(getTemplateArg, "api", "/file_properties/templates/get_for_user", "user", global::Dropbox.Api.FileProperties.GetTemplateArg.Encoder, global::Dropbox.Api.FileProperties.GetTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(getTemplateArg, "api", "/file_properties/templates/get_for_user", "user", global::Dropbox.Api.FileProperties.GetTemplateArg.Encoder, global::Dropbox.Api.FileProperties.GetTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken);
}
///
@@ -787,16 +810,18 @@ public sys.IAsyncResult BeginTemplatesGetForUser(GetTemplateArg getTemplateArg,
/// /> or .
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesGetForUserAsync(string templateId)
+ public t.Task TemplatesGetForUserAsync(string templateId,
+ tr.CancellationToken cancellationToken = default)
{
var getTemplateArg = new GetTemplateArg(templateId);
- return this.TemplatesGetForUserAsync(getTemplateArg);
+ return this.TemplatesGetForUserAsync(getTemplateArg, cancellationToken);
}
///
@@ -848,14 +873,15 @@ public GetTemplateResult EndTemplatesGetForUser(sys.IAsyncResult asyncResult)
/// cref="Dropbox.Api.FileProperties.Routes.FilePropertiesUserRoutes.TemplatesGetForUserAsync"
/// />. This endpoint can't be called on a team member or admin's behalf.
///
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesListForUserAsync()
+ public t.Task TemplatesListForUserAsync(tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_properties/templates/list_for_user", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_properties/templates/list_for_user", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken);
}
///
@@ -901,13 +927,14 @@ public ListTemplateResult EndTemplatesListForUser(sys.IAsyncResult asyncResult)
/// cannot be undone.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesRemoveForUserAsync(RemoveTemplateArg removeTemplateArg)
+ public t.Task TemplatesRemoveForUserAsync(RemoveTemplateArg removeTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(removeTemplateArg, "api", "/file_properties/templates/remove_for_user", "user", global::Dropbox.Api.FileProperties.RemoveTemplateArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.TemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(removeTemplateArg, "api", "/file_properties/templates/remove_for_user", "user", global::Dropbox.Api.FileProperties.RemoveTemplateArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken);
}
///
@@ -937,15 +964,17 @@ public sys.IAsyncResult BeginTemplatesRemoveForUser(RemoveTemplateArg removeTemp
/// /> or .
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesRemoveForUserAsync(string templateId)
+ public t.Task TemplatesRemoveForUserAsync(string templateId,
+ tr.CancellationToken cancellationToken = default)
{
var removeTemplateArg = new RemoveTemplateArg(templateId);
- return this.TemplatesRemoveForUserAsync(removeTemplateArg);
+ return this.TemplatesRemoveForUserAsync(removeTemplateArg, cancellationToken);
}
///
@@ -994,14 +1023,15 @@ public void EndTemplatesRemoveForUser(sys.IAsyncResult asyncResult)
/// endpoint can't be called on a team member or admin's behalf.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task TemplatesUpdateForUserAsync(UpdateTemplateArg updateTemplateArg)
+ public t.Task TemplatesUpdateForUserAsync(UpdateTemplateArg updateTemplateArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(updateTemplateArg, "api", "/file_properties/templates/update_for_user", "user", global::Dropbox.Api.FileProperties.UpdateTemplateArg.Encoder, global::Dropbox.Api.FileProperties.UpdateTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder);
+ return this.Transport.SendRpcRequestAsync(updateTemplateArg, "api", "/file_properties/templates/update_for_user", "user", global::Dropbox.Api.FileProperties.UpdateTemplateArg.Encoder, global::Dropbox.Api.FileProperties.UpdateTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder, cancellationToken);
}
///
@@ -1036,6 +1066,7 @@ public sys.IAsyncResult BeginTemplatesUpdateForUser(UpdateTemplateArg updateTemp
/// can be up to 1024 bytes.
/// Property field templates to be added to the group template.
/// There can be up to 32 properties in a single template.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
@@ -1044,14 +1075,15 @@ public sys.IAsyncResult BeginTemplatesUpdateForUser(UpdateTemplateArg updateTemp
public t.Task TemplatesUpdateForUserAsync(string templateId,
string name = null,
string description = null,
- col.IEnumerable addFields = null)
+ col.IEnumerable addFields = null,
+ tr.CancellationToken cancellationToken = default)
{
var updateTemplateArg = new UpdateTemplateArg(templateId,
name,
description,
addFields);
- return this.TemplatesUpdateForUserAsync(updateTemplateArg);
+ return this.TemplatesUpdateForUserAsync(updateTemplateArg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileRequests/FileRequestsUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileRequests/FileRequestsUserRoutes.cs
index cc0bce41e0..a962887853 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileRequests/FileRequestsUserRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/FileRequests/FileRequestsUserRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.FileRequests.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -34,14 +35,15 @@ internal FileRequestsUserRoutes(enc.ITransport transport)
/// Returns the total number of file requests owned by this user. Includes both
/// open and closed file requests.
///
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task CountAsync()
+ public t.Task CountAsync(tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_requests/count", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileRequests.CountFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.CountFileRequestsError.Decoder);
+ return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_requests/count", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileRequests.CountFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.CountFileRequestsError.Decoder, cancellationToken);
}
///
@@ -83,14 +85,15 @@ public CountFileRequestsResult EndCount(sys.IAsyncResult asyncResult)
/// Creates a file request for this user.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task CreateAsync(CreateFileRequestArgs createFileRequestArgs)
+ public t.Task CreateAsync(CreateFileRequestArgs createFileRequestArgs, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(createFileRequestArgs, "api", "/file_requests/create", "user", global::Dropbox.Api.FileRequests.CreateFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.FileRequest.Decoder, global::Dropbox.Api.FileRequests.CreateFileRequestError.Decoder);
+ return this.Transport.SendRpcRequestAsync(createFileRequestArgs, "api", "/file_requests/create", "user", global::Dropbox.Api.FileRequests.CreateFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.FileRequest.Decoder, global::Dropbox.Api.FileRequests.CreateFileRequestError.Decoder, cancellationToken);
}
///
@@ -122,6 +125,7 @@ public sys.IAsyncResult BeginCreate(CreateFileRequestArgs createFileRequestArgs,
/// request is closed, it will not accept any file submissions, but it can be opened
/// later.
/// A description of the file request.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
@@ -131,7 +135,8 @@ public t.Task CreateAsync(string title,
string destination,
FileRequestDeadline deadline = null,
bool open = true,
- string description = null)
+ string description = null,
+ tr.CancellationToken cancellationToken = default)
{
var createFileRequestArgs = new CreateFileRequestArgs(title,
destination,
@@ -139,7 +144,7 @@ public t.Task CreateAsync(string title,
open,
description);
- return this.CreateAsync(createFileRequestArgs);
+ return this.CreateAsync(createFileRequestArgs, cancellationToken);
}
///
@@ -202,14 +207,15 @@ public FileRequest EndCreate(sys.IAsyncResult asyncResult)
/// Delete a batch of closed file requests.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task DeleteAsync(DeleteFileRequestArgs deleteFileRequestArgs)
+ public t.Task DeleteAsync(DeleteFileRequestArgs deleteFileRequestArgs, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(deleteFileRequestArgs, "api", "/file_requests/delete", "user", global::Dropbox.Api.FileRequests.DeleteFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.DeleteFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.DeleteFileRequestError.Decoder);
+ return this.Transport.SendRpcRequestAsync(deleteFileRequestArgs, "api", "/file_requests/delete", "user", global::Dropbox.Api.FileRequests.DeleteFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.DeleteFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.DeleteFileRequestError.Decoder, cancellationToken);
}
///
@@ -232,16 +238,18 @@ public sys.IAsyncResult BeginDelete(DeleteFileRequestArgs deleteFileRequestArgs,
/// Delete a batch of closed file requests.
///
/// List IDs of the file requests to delete.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task DeleteAsync(col.IEnumerable ids)
+ public t.Task DeleteAsync(col.IEnumerable ids,
+ tr.CancellationToken cancellationToken = default)
{
var deleteFileRequestArgs = new DeleteFileRequestArgs(ids);
- return this.DeleteAsync(deleteFileRequestArgs);
+ return this.DeleteAsync(deleteFileRequestArgs, cancellationToken);
}
///
@@ -286,14 +294,15 @@ public DeleteFileRequestsResult EndDelete(sys.IAsyncResult asyncResult)
///
/// Delete all closed file requests owned by this user.
///
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task DeleteAllClosedAsync()
+ public t.Task DeleteAllClosedAsync(tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_requests/delete_all_closed", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileRequests.DeleteAllClosedFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.DeleteAllClosedFileRequestsError.Decoder);
+ return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_requests/delete_all_closed", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileRequests.DeleteAllClosedFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.DeleteAllClosedFileRequestsError.Decoder, cancellationToken);
}
///
@@ -336,14 +345,15 @@ public DeleteAllClosedFileRequestsResult EndDeleteAllClosed(sys.IAsyncResult asy
/// Returns the specified file request.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task GetAsync(GetFileRequestArgs getFileRequestArgs)
+ public t.Task GetAsync(GetFileRequestArgs getFileRequestArgs, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(getFileRequestArgs, "api", "/file_requests/get", "user", global::Dropbox.Api.FileRequests.GetFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.FileRequest.Decoder, global::Dropbox.Api.FileRequests.GetFileRequestError.Decoder);
+ return this.Transport.SendRpcRequestAsync(getFileRequestArgs, "api", "/file_requests/get", "user", global::Dropbox.Api.FileRequests.GetFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.FileRequest.Decoder, global::Dropbox.Api.FileRequests.GetFileRequestError.Decoder, cancellationToken);
}
///
@@ -366,16 +376,18 @@ public sys.IAsyncResult BeginGet(GetFileRequestArgs getFileRequestArgs, sys.Asyn
/// Returns the specified file request.
///
/// The ID of the file request to retrieve.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task GetAsync(string id)
+ public t.Task GetAsync(string id,
+ tr.CancellationToken cancellationToken = default)
{
var getFileRequestArgs = new GetFileRequestArgs(id);
- return this.GetAsync(getFileRequestArgs);
+ return this.GetAsync(getFileRequestArgs, cancellationToken);
}
///
@@ -422,14 +434,15 @@ public FileRequest EndGet(sys.IAsyncResult asyncResult)
/// folder.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task ListV2Async(ListFileRequestsArg listFileRequestsArg)
+ public t.Task ListV2Async(ListFileRequestsArg listFileRequestsArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(listFileRequestsArg, "api", "/file_requests/list_v2", "user", global::Dropbox.Api.FileRequests.ListFileRequestsArg.Encoder, global::Dropbox.Api.FileRequests.ListFileRequestsV2Result.Decoder, global::Dropbox.Api.FileRequests.ListFileRequestsError.Decoder);
+ return this.Transport.SendRpcRequestAsync(listFileRequestsArg, "api", "/file_requests/list_v2", "user", global::Dropbox.Api.FileRequests.ListFileRequestsArg.Encoder, global::Dropbox.Api.FileRequests.ListFileRequestsV2Result.Decoder, global::Dropbox.Api.FileRequests.ListFileRequestsError.Decoder, cancellationToken);
}
///
@@ -455,16 +468,18 @@ public sys.IAsyncResult BeginListV2(ListFileRequestsArg listFileRequestsArg, sys
///
/// The maximum number of file requests that should be returned per
/// request.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task ListV2Async(ulong limit = 1000)
+ public t.Task ListV2Async(ulong limit = 1000,
+ tr.CancellationToken cancellationToken = default)
{
var listFileRequestsArg = new ListFileRequestsArg(limit);
- return this.ListV2Async(listFileRequestsArg);
+ return this.ListV2Async(listFileRequestsArg, cancellationToken);
}
///
@@ -511,14 +526,15 @@ public ListFileRequestsV2Result EndListV2(sys.IAsyncResult asyncResult)
/// folder permission, this will only return file requests with destinations in the app
/// folder.
///
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task ListAsync()
+ public t.Task ListAsync(tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_requests/list", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileRequests.ListFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.ListFileRequestsError.Decoder);
+ return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/file_requests/list", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileRequests.ListFileRequestsResult.Decoder, global::Dropbox.Api.FileRequests.ListFileRequestsError.Decoder, cancellationToken);
}
///
@@ -567,14 +583,15 @@ public ListFileRequestsResult EndList(sys.IAsyncResult asyncResult)
/// />.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task ListContinueAsync(ListFileRequestsContinueArg listFileRequestsContinueArg)
+ public t.Task ListContinueAsync(ListFileRequestsContinueArg listFileRequestsContinueArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(listFileRequestsContinueArg, "api", "/file_requests/list/continue", "user", global::Dropbox.Api.FileRequests.ListFileRequestsContinueArg.Encoder, global::Dropbox.Api.FileRequests.ListFileRequestsV2Result.Decoder, global::Dropbox.Api.FileRequests.ListFileRequestsContinueError.Decoder);
+ return this.Transport.SendRpcRequestAsync(listFileRequestsContinueArg, "api", "/file_requests/list/continue", "user", global::Dropbox.Api.FileRequests.ListFileRequestsContinueArg.Encoder, global::Dropbox.Api.FileRequests.ListFileRequestsV2Result.Decoder, global::Dropbox.Api.FileRequests.ListFileRequestsContinueError.Decoder, cancellationToken);
}
///
@@ -605,16 +622,18 @@ public sys.IAsyncResult BeginListContinue(ListFileRequestsContinueArg listFileRe
///
/// The cursor returned by the previous API call specified in the
/// endpoint description.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task ListContinueAsync(string cursor)
+ public t.Task ListContinueAsync(string cursor,
+ tr.CancellationToken cancellationToken = default)
{
var listFileRequestsContinueArg = new ListFileRequestsContinueArg(cursor);
- return this.ListContinueAsync(listFileRequestsContinueArg);
+ return this.ListContinueAsync(listFileRequestsContinueArg, cancellationToken);
}
///
@@ -661,14 +680,15 @@ public ListFileRequestsV2Result EndListContinue(sys.IAsyncResult asyncResult)
/// Update a file request.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task UpdateAsync(UpdateFileRequestArgs updateFileRequestArgs)
+ public t.Task UpdateAsync(UpdateFileRequestArgs updateFileRequestArgs, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync(updateFileRequestArgs, "api", "/file_requests/update", "user", global::Dropbox.Api.FileRequests.UpdateFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.FileRequest.Decoder, global::Dropbox.Api.FileRequests.UpdateFileRequestError.Decoder);
+ return this.Transport.SendRpcRequestAsync(updateFileRequestArgs, "api", "/file_requests/update", "user", global::Dropbox.Api.FileRequests.UpdateFileRequestArgs.Encoder, global::Dropbox.Api.FileRequests.FileRequest.Decoder, global::Dropbox.Api.FileRequests.UpdateFileRequestError.Decoder, cancellationToken);
}
///
@@ -699,6 +719,7 @@ public sys.IAsyncResult BeginUpdate(UpdateFileRequestArgs updateFileRequestArgs,
/// set by Professional and Business accounts.
/// Whether to set this file request as open or closed.
/// The description of the file request.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
@@ -709,7 +730,8 @@ public t.Task UpdateAsync(string id,
string destination = null,
UpdateFileRequestDeadline deadline = null,
bool? open = null,
- string description = null)
+ string description = null,
+ tr.CancellationToken cancellationToken = default)
{
var updateFileRequestArgs = new UpdateFileRequestArgs(id,
title,
@@ -718,7 +740,7 @@ public t.Task UpdateAsync(string id,
open,
description);
- return this.UpdateAsync(updateFileRequestArgs);
+ return this.UpdateAsync(updateFileRequestArgs, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesAppRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesAppRoutes.cs
index 61c4d46600..2909a42f3b 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesAppRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesAppRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Files.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -33,14 +34,15 @@ internal FilesAppRoutes(enc.ITransport transport)
/// Get a thumbnail for a file.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
- public t.Task> GetThumbnailV2Async(ThumbnailV2Arg thumbnailV2Arg)
+ public t.Task> GetThumbnailV2Async(ThumbnailV2Arg thumbnailV2Arg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendDownloadRequestAsync(thumbnailV2Arg, "content", "/files/get_thumbnail_v2", "app", global::Dropbox.Api.Files.ThumbnailV2Arg.Encoder, global::Dropbox.Api.Files.PreviewResult.Decoder, global::Dropbox.Api.Files.ThumbnailV2Error.Decoder);
+ return this.Transport.SendDownloadRequestAsync(thumbnailV2Arg, "content", "/files/get_thumbnail_v2", "app", global::Dropbox.Api.Files.ThumbnailV2Arg.Encoder, global::Dropbox.Api.Files.PreviewResult.Decoder, global::Dropbox.Api.Files.ThumbnailV2Error.Decoder, cancellationToken);
}
///
@@ -71,6 +73,7 @@ public sys.IAsyncResult BeginGetThumbnailV2(ThumbnailV2Arg thumbnailV2Arg, sys.A
/// The size for the thumbnail image.
/// How to resize and crop the image to achieve the desired
/// size.
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
@@ -79,14 +82,15 @@ public sys.IAsyncResult BeginGetThumbnailV2(ThumbnailV2Arg thumbnailV2Arg, sys.A
public t.Task> GetThumbnailV2Async(PathOrLink resource,
ThumbnailFormat format = null,
ThumbnailSize size = null,
- ThumbnailMode mode = null)
+ ThumbnailMode mode = null,
+ tr.CancellationToken cancellationToken = default)
{
var thumbnailV2Arg = new ThumbnailV2Arg(resource,
format,
size,
mode);
- return this.GetThumbnailV2Async(thumbnailV2Arg);
+ return this.GetThumbnailV2Async(thumbnailV2Arg, cancellationToken);
}
///
diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesUserRoutes.cs
index 4a43cce759..27d34b6f55 100644
--- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesUserRoutes.cs
+++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesUserRoutes.cs
@@ -8,6 +8,7 @@ namespace Dropbox.Api.Files.Routes
using io = System.IO;
using col = System.Collections.Generic;
using t = System.Threading.Tasks;
+ using tr = System.Threading;
using enc = Dropbox.Api.Stone;
///
@@ -36,15 +37,16 @@ internal FilesUserRoutes(enc.ITransport transport)
/// Note: Metadata for the root folder is unsupported.
///
/// The request parameters
+ /// The cancellation token to cancel operation.
/// The task that represents the asynchronous send operation. The TResult
/// parameter contains the response from the server.
/// Thrown if there is an error
/// processing the request; This will contain a .
[sys.Obsolete("This function is deprecated, please use GetMetadataAsync instead.")]
- public t.Task AlphaGetMetadataAsync(AlphaGetMetadataArg alphaGetMetadataArg)
+ public t.Task AlphaGetMetadataAsync(AlphaGetMetadataArg alphaGetMetadataArg, tr.CancellationToken cancellationToken = default)
{
- return this.Transport.SendRpcRequestAsync