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(alphaGetMetadataArg, "api", "/files/alpha/get_metadata", "user", global::Dropbox.Api.Files.AlphaGetMetadataArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.AlphaGetMetadataError.Decoder); + return this.Transport.SendRpcRequestAsync(alphaGetMetadataArg, "api", "/files/alpha/get_metadata", "user", global::Dropbox.Api.Files.AlphaGetMetadataArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.AlphaGetMetadataError.Decoder, cancellationToken); } /// @@ -85,6 +87,7 @@ public sys.IAsyncResult BeginAlphaGetMetadata(AlphaGetMetadataArg alphaGetMetada /// If set to a valid list of template IDs, is set for files with /// custom properties. + /// 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 @@ -96,7 +99,8 @@ public t.Task AlphaGetMetadataAsync(string path, bool includeDeleted = false, bool includeHasExplicitSharedMembers = false, global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null, - col.IEnumerable includePropertyTemplates = null) + col.IEnumerable includePropertyTemplates = null, + tr.CancellationToken cancellationToken = default) { var alphaGetMetadataArg = new AlphaGetMetadataArg(path, includeMediaInfo, @@ -105,7 +109,7 @@ public t.Task AlphaGetMetadataAsync(string path, includePropertyGroups, includePropertyTemplates); - return this.AlphaGetMetadataAsync(alphaGetMetadataArg); + return this.AlphaGetMetadataAsync(alphaGetMetadataArg, cancellationToken); } /// @@ -184,15 +188,16 @@ public Metadata EndAlphaGetMetadata(sys.IAsyncResult asyncResult) /// /// The request parameters /// The content to upload. + /// 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 AlphaUploadAsync instead.")] - public t.Task AlphaUploadAsync(CommitInfoWithProperties commitInfoWithProperties, io.Stream body) + public t.Task AlphaUploadAsync(CommitInfoWithProperties commitInfoWithProperties, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(commitInfoWithProperties, body, "content", "/files/alpha/upload", "user", global::Dropbox.Api.Files.CommitInfoWithProperties.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.UploadErrorWithProperties.Decoder); + return this.Transport.SendUploadRequestAsync(commitInfoWithProperties, body, "content", "/files/alpha/upload", "user", global::Dropbox.Api.Files.CommitInfoWithProperties.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.UploadErrorWithProperties.Decoder, cancellationToken); } /// @@ -243,6 +248,7 @@ public sys.IAsyncResult BeginAlphaUpload(CommitInfoWithProperties commitInfoWith /// deleted. This also forces a conflict even when the target path refers to a file /// with identical contents. /// The document to upload + /// 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 @@ -256,7 +262,8 @@ public t.Task AlphaUploadAsync(string path, bool mute = false, col.IEnumerable propertyGroups = null, bool strictConflict = false, - io.Stream body = null) + io.Stream body = null, + tr.CancellationToken cancellationToken = default) { var commitInfoWithProperties = new CommitInfoWithProperties(path, mode, @@ -266,7 +273,7 @@ public t.Task AlphaUploadAsync(string path, propertyGroups, strictConflict); - return this.AlphaUploadAsync(commitInfoWithProperties, body); + return this.AlphaUploadAsync(commitInfoWithProperties, body, cancellationToken); } /// @@ -349,14 +356,15 @@ public FileMetadata EndAlphaUpload(sys.IAsyncResult asyncResult) /// If the source path is a folder all its contents will be copied. /// /// 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 CopyV2Async(RelocationArg relocationArg) + public t.Task CopyV2Async(RelocationArg relocationArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/copy_v2", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.RelocationResult.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder); + return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/copy_v2", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.RelocationResult.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder, cancellationToken); } /// @@ -387,6 +395,7 @@ public sys.IAsyncResult BeginCopyV2(RelocationArg relocationArg, sys.AsyncCallba /// Allow moves by owner even if it would result /// in an ownership transfer for the content being moved. This does not apply to /// copies. + /// 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 @@ -396,7 +405,8 @@ public t.Task CopyV2Async(string fromPath, string toPath, bool allowSharedFolder = false, bool autorename = false, - bool allowOwnershipTransfer = false) + bool allowOwnershipTransfer = false, + tr.CancellationToken cancellationToken = default) { var relocationArg = new RelocationArg(fromPath, toPath, @@ -404,7 +414,7 @@ public t.Task CopyV2Async(string fromPath, autorename, allowOwnershipTransfer); - return this.CopyV2Async(relocationArg); + return this.CopyV2Async(relocationArg, cancellationToken); } /// @@ -465,15 +475,16 @@ public RelocationResult EndCopyV2(sys.IAsyncResult asyncResult) /// If the source path is a folder all its contents will be copied. /// /// 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 CopyV2Async instead.")] - public t.Task CopyAsync(RelocationArg relocationArg) + public t.Task CopyAsync(RelocationArg relocationArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/copy", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder); + return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/copy", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder, cancellationToken); } /// @@ -505,6 +516,7 @@ public sys.IAsyncResult BeginCopy(RelocationArg relocationArg, sys.AsyncCallback /// Allow moves by owner even if it would result /// in an ownership transfer for the content being moved. This does not apply to /// copies. + /// 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 @@ -515,7 +527,8 @@ public t.Task CopyAsync(string fromPath, string toPath, bool allowSharedFolder = false, bool autorename = false, - bool allowOwnershipTransfer = false) + bool allowOwnershipTransfer = false, + tr.CancellationToken cancellationToken = default) { var relocationArg = new RelocationArg(fromPath, toPath, @@ -523,7 +536,7 @@ public t.Task CopyAsync(string fromPath, autorename, allowOwnershipTransfer); - return this.CopyAsync(relocationArg); + return this.CopyAsync(relocationArg, cancellationToken); } /// @@ -595,11 +608,12 @@ public Metadata EndCopy(sys.IAsyncResult asyncResult) /// the job status. /// /// 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 CopyBatchV2Async(RelocationBatchArgBase relocationBatchArgBase) + public t.Task CopyBatchV2Async(RelocationBatchArgBase relocationBatchArgBase, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relocationBatchArgBase, "api", "/files/copy_batch_v2", "user", global::Dropbox.Api.Files.RelocationBatchArgBase.Encoder, global::Dropbox.Api.Files.RelocationBatchV2Launch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(relocationBatchArgBase, "api", "/files/copy_batch_v2", "user", global::Dropbox.Api.Files.RelocationBatchArgBase.Encoder, global::Dropbox.Api.Files.RelocationBatchV2Launch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -635,15 +649,17 @@ public sys.IAsyncResult BeginCopyBatchV2(RelocationBatchArgBase relocationBatchA /// cref="RelocationPath" />. /// If there's a conflict with any file, have the Dropbox /// server try to autorename that file to avoid the conflict. + /// 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 CopyBatchV2Async(col.IEnumerable entries, - bool autorename = false) + bool autorename = false, + tr.CancellationToken cancellationToken = default) { var relocationBatchArgBase = new RelocationBatchArgBase(entries, autorename); - return this.CopyBatchV2Async(relocationBatchArgBase); + return this.CopyBatchV2Async(relocationBatchArgBase, cancellationToken); } /// @@ -696,12 +712,13 @@ public RelocationBatchV2Launch EndCopyBatchV2(sys.IAsyncResult asyncResult) /// job status. /// /// 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. [sys.Obsolete("This function is deprecated, please use CopyBatchV2Async instead.")] - public t.Task CopyBatchAsync(RelocationBatchArg relocationBatchArg) + public t.Task CopyBatchAsync(RelocationBatchArg relocationBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relocationBatchArg, "api", "/files/copy_batch", "user", global::Dropbox.Api.Files.RelocationBatchArg.Encoder, global::Dropbox.Api.Files.RelocationBatchLaunch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(relocationBatchArg, "api", "/files/copy_batch", "user", global::Dropbox.Api.Files.RelocationBatchArg.Encoder, global::Dropbox.Api.Files.RelocationBatchLaunch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -737,20 +754,22 @@ public sys.IAsyncResult BeginCopyBatch(RelocationBatchArg relocationBatchArg, sy /// Allow moves by owner even if it would result /// in an ownership transfer for the content being moved. This does not apply to /// copies. + /// The cancellation token to cancel operation. /// The task that represents the asynchronous send operation. The TResult /// parameter contains the response from the server. [sys.Obsolete("This function is deprecated, please use CopyBatchV2Async instead.")] public t.Task CopyBatchAsync(col.IEnumerable entries, bool autorename = false, bool allowSharedFolder = false, - bool allowOwnershipTransfer = false) + bool allowOwnershipTransfer = false, + tr.CancellationToken cancellationToken = default) { var relocationBatchArg = new RelocationBatchArg(entries, autorename, allowSharedFolder, allowOwnershipTransfer); - return this.CopyBatchAsync(relocationBatchArg); + return this.CopyBatchAsync(relocationBatchArg, cancellationToken); } /// @@ -810,14 +829,15 @@ public RelocationBatchLaunch EndCopyBatch(sys.IAsyncResult asyncResult) /// list of results for each entry. /// /// 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 CopyBatchCheckV2Async(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task CopyBatchCheckV2Async(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/copy_batch/check_v2", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchV2JobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/copy_batch/check_v2", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchV2JobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -843,16 +863,18 @@ public sys.IAsyncResult BeginCopyBatchCheckV2(global::Dropbox.Api.Async.PollArg /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 CopyBatchCheckV2Async(string asyncJobId) + public t.Task CopyBatchCheckV2Async(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.CopyBatchCheckV2Async(pollArg); + return this.CopyBatchCheckV2Async(pollArg, cancellationToken); } /// @@ -901,15 +923,16 @@ public RelocationBatchV2JobStatus EndCopyBatchCheckV2(sys.IAsyncResult asyncResu /// returns list of results for each entry. /// /// 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 CopyBatchCheckV2Async instead.")] - public t.Task CopyBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task CopyBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/copy_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/copy_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -936,17 +959,19 @@ public sys.IAsyncResult BeginCopyBatchCheck(global::Dropbox.Api.Async.PollArg po /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 CopyBatchCheckV2Async instead.")] - public t.Task CopyBatchCheckAsync(string asyncJobId) + public t.Task CopyBatchCheckAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.CopyBatchCheckAsync(pollArg); + return this.CopyBatchCheckAsync(pollArg, cancellationToken); } /// @@ -997,14 +1022,15 @@ public RelocationBatchJobStatus EndCopyBatchCheck(sys.IAsyncResult asyncResult) /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.CopyReferenceSaveAsync" />. /// /// 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 CopyReferenceGetAsync(GetCopyReferenceArg getCopyReferenceArg) + public t.Task CopyReferenceGetAsync(GetCopyReferenceArg getCopyReferenceArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getCopyReferenceArg, "api", "/files/copy_reference/get", "user", global::Dropbox.Api.Files.GetCopyReferenceArg.Encoder, global::Dropbox.Api.Files.GetCopyReferenceResult.Decoder, global::Dropbox.Api.Files.GetCopyReferenceError.Decoder); + return this.Transport.SendRpcRequestAsync(getCopyReferenceArg, "api", "/files/copy_reference/get", "user", global::Dropbox.Api.Files.GetCopyReferenceArg.Encoder, global::Dropbox.Api.Files.GetCopyReferenceResult.Decoder, global::Dropbox.Api.Files.GetCopyReferenceError.Decoder, cancellationToken); } /// @@ -1030,16 +1056,18 @@ public sys.IAsyncResult BeginCopyReferenceGet(GetCopyReferenceArg getCopyReferen /// /// The path to the file or folder you want to get a copy reference /// to. + /// 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 CopyReferenceGetAsync(string path) + public t.Task CopyReferenceGetAsync(string path, + tr.CancellationToken cancellationToken = default) { var getCopyReferenceArg = new GetCopyReferenceArg(path); - return this.CopyReferenceGetAsync(getCopyReferenceArg); + return this.CopyReferenceGetAsync(getCopyReferenceArg, cancellationToken); } /// @@ -1088,14 +1116,15 @@ public GetCopyReferenceResult EndCopyReferenceGet(sys.IAsyncResult asyncResult) /// user's Dropbox. /// /// 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 CopyReferenceSaveAsync(SaveCopyReferenceArg saveCopyReferenceArg) + public t.Task CopyReferenceSaveAsync(SaveCopyReferenceArg saveCopyReferenceArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(saveCopyReferenceArg, "api", "/files/copy_reference/save", "user", global::Dropbox.Api.Files.SaveCopyReferenceArg.Encoder, global::Dropbox.Api.Files.SaveCopyReferenceResult.Decoder, global::Dropbox.Api.Files.SaveCopyReferenceError.Decoder); + return this.Transport.SendRpcRequestAsync(saveCopyReferenceArg, "api", "/files/copy_reference/save", "user", global::Dropbox.Api.Files.SaveCopyReferenceArg.Encoder, global::Dropbox.Api.Files.SaveCopyReferenceResult.Decoder, global::Dropbox.Api.Files.SaveCopyReferenceError.Decoder, cancellationToken); } /// @@ -1122,18 +1151,20 @@ public sys.IAsyncResult BeginCopyReferenceSave(SaveCopyReferenceArg saveCopyRefe /// A copy reference returned by . /// Path in the user's Dropbox that is the destination. + /// 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 CopyReferenceSaveAsync(string copyReference, - string path) + string path, + tr.CancellationToken cancellationToken = default) { var saveCopyReferenceArg = new SaveCopyReferenceArg(copyReference, path); - return this.CopyReferenceSaveAsync(saveCopyReferenceArg); + return this.CopyReferenceSaveAsync(saveCopyReferenceArg, cancellationToken); } /// @@ -1183,14 +1214,15 @@ public SaveCopyReferenceResult EndCopyReferenceSave(sys.IAsyncResult asyncResult /// Create a folder at a given path. /// /// 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 CreateFolderV2Async(CreateFolderArg createFolderArg) + public t.Task CreateFolderV2Async(CreateFolderArg createFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(createFolderArg, "api", "/files/create_folder_v2", "user", global::Dropbox.Api.Files.CreateFolderArg.Encoder, global::Dropbox.Api.Files.CreateFolderResult.Decoder, global::Dropbox.Api.Files.CreateFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(createFolderArg, "api", "/files/create_folder_v2", "user", global::Dropbox.Api.Files.CreateFolderArg.Encoder, global::Dropbox.Api.Files.CreateFolderResult.Decoder, global::Dropbox.Api.Files.CreateFolderError.Decoder, cancellationToken); } /// @@ -1215,18 +1247,20 @@ public sys.IAsyncResult BeginCreateFolderV2(CreateFolderArg createFolderArg, sys /// Path in the user's Dropbox to create. /// If there's a conflict, have the Dropbox server try to /// autorename the folder to avoid the conflict. + /// 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 CreateFolderV2Async(string path, - bool autorename = false) + bool autorename = false, + tr.CancellationToken cancellationToken = default) { var createFolderArg = new CreateFolderArg(path, autorename); - return this.CreateFolderV2Async(createFolderArg); + return this.CreateFolderV2Async(createFolderArg, cancellationToken); } /// @@ -1276,15 +1310,16 @@ public CreateFolderResult EndCreateFolderV2(sys.IAsyncResult asyncResult) /// Create a folder at a given path. /// /// 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 CreateFolderV2Async instead.")] - public t.Task CreateFolderAsync(CreateFolderArg createFolderArg) + public t.Task CreateFolderAsync(CreateFolderArg createFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(createFolderArg, "api", "/files/create_folder", "user", global::Dropbox.Api.Files.CreateFolderArg.Encoder, global::Dropbox.Api.Files.FolderMetadata.Decoder, global::Dropbox.Api.Files.CreateFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(createFolderArg, "api", "/files/create_folder", "user", global::Dropbox.Api.Files.CreateFolderArg.Encoder, global::Dropbox.Api.Files.FolderMetadata.Decoder, global::Dropbox.Api.Files.CreateFolderError.Decoder, cancellationToken); } /// @@ -1310,6 +1345,7 @@ public sys.IAsyncResult BeginCreateFolder(CreateFolderArg createFolderArg, sys.A /// Path in the user's Dropbox to create. /// If there's a conflict, have the Dropbox server try to /// autorename the folder to avoid the conflict. + /// 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 @@ -1317,12 +1353,13 @@ public sys.IAsyncResult BeginCreateFolder(CreateFolderArg createFolderArg, sys.A /// cref="CreateFolderError"/>. [sys.Obsolete("This function is deprecated, please use CreateFolderV2Async instead.")] public t.Task CreateFolderAsync(string path, - bool autorename = false) + bool autorename = false, + tr.CancellationToken cancellationToken = default) { var createFolderArg = new CreateFolderArg(path, autorename); - return this.CreateFolderAsync(createFolderArg); + return this.CreateFolderAsync(createFolderArg, cancellationToken); } /// @@ -1381,11 +1418,12 @@ public FolderMetadata EndCreateFolder(sys.IAsyncResult asyncResult) /// check the job status. /// /// 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 CreateFolderBatchAsync(CreateFolderBatchArg createFolderBatchArg) + public t.Task CreateFolderBatchAsync(CreateFolderBatchArg createFolderBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(createFolderBatchArg, "api", "/files/create_folder_batch", "user", global::Dropbox.Api.Files.CreateFolderBatchArg.Encoder, global::Dropbox.Api.Files.CreateFolderBatchLaunch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(createFolderBatchArg, "api", "/files/create_folder_batch", "user", global::Dropbox.Api.Files.CreateFolderBatchArg.Encoder, global::Dropbox.Api.Files.CreateFolderBatchLaunch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -1420,17 +1458,19 @@ public sys.IAsyncResult BeginCreateFolderBatch(CreateFolderBatchArg createFolder /// autorename the folder to avoid the conflict. /// Whether to force the create to happen /// asynchronously. + /// 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 CreateFolderBatchAsync(col.IEnumerable paths, bool autorename = false, - bool forceAsync = false) + bool forceAsync = false, + tr.CancellationToken cancellationToken = default) { var createFolderBatchArg = new CreateFolderBatchArg(paths, autorename, forceAsync); - return this.CreateFolderBatchAsync(createFolderBatchArg); + return this.CreateFolderBatchAsync(createFolderBatchArg, cancellationToken); } /// @@ -1484,14 +1524,15 @@ public CreateFolderBatchLaunch EndCreateFolderBatch(sys.IAsyncResult asyncResult /// success, it returns list of result for each entry. /// /// 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 CreateFolderBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task CreateFolderBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/create_folder_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.CreateFolderBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/create_folder_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.CreateFolderBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -1517,16 +1558,18 @@ public sys.IAsyncResult BeginCreateFolderBatchCheck(global::Dropbox.Api.Async.Po /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 CreateFolderBatchCheckAsync(string asyncJobId) + public t.Task CreateFolderBatchCheckAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.CreateFolderBatchCheckAsync(pollArg); + return this.CreateFolderBatchCheckAsync(pollArg, cancellationToken); } /// @@ -1578,13 +1621,14 @@ public CreateFolderBatchJobStatus EndCreateFolderBatchCheck(sys.IAsyncResult asy /// cref="DeletedMetadata" /> object. /// /// 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 DeleteV2Async(DeleteArg deleteArg) + public t.Task DeleteV2Async(DeleteArg deleteArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(deleteArg, "api", "/files/delete_v2", "user", global::Dropbox.Api.Files.DeleteArg.Encoder, global::Dropbox.Api.Files.DeleteResult.Decoder, global::Dropbox.Api.Files.DeleteError.Decoder); + return this.Transport.SendRpcRequestAsync(deleteArg, "api", "/files/delete_v2", "user", global::Dropbox.Api.Files.DeleteArg.Encoder, global::Dropbox.Api.Files.DeleteResult.Decoder, global::Dropbox.Api.Files.DeleteError.Decoder, cancellationToken); } /// @@ -1614,17 +1658,19 @@ public sys.IAsyncResult BeginDeleteV2(DeleteArg deleteArg, sys.AsyncCallback cal /// Path in the user's Dropbox to delete. /// Perform delete if given "rev" matches the existing file's /// latest "rev". This field does not support deleting a 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 DeleteV2Async(string path, - string parentRev = null) + string parentRev = null, + tr.CancellationToken cancellationToken = default) { var deleteArg = new DeleteArg(path, parentRev); - return this.DeleteV2Async(deleteArg); + return this.DeleteV2Async(deleteArg, cancellationToken); } /// @@ -1678,14 +1724,15 @@ public DeleteResult EndDeleteV2(sys.IAsyncResult asyncResult) /// cref="DeletedMetadata" /> object. /// /// 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 DeleteV2Async instead.")] - public t.Task DeleteAsync(DeleteArg deleteArg) + public t.Task DeleteAsync(DeleteArg deleteArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(deleteArg, "api", "/files/delete", "user", global::Dropbox.Api.Files.DeleteArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.DeleteError.Decoder); + return this.Transport.SendRpcRequestAsync(deleteArg, "api", "/files/delete", "user", global::Dropbox.Api.Files.DeleteArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.DeleteError.Decoder, cancellationToken); } /// @@ -1716,18 +1763,20 @@ public sys.IAsyncResult BeginDelete(DeleteArg deleteArg, sys.AsyncCallback callb /// Path in the user's Dropbox to delete. /// Perform delete if given "rev" matches the existing file's /// latest "rev". This field does not support deleting a 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 . [sys.Obsolete("This function is deprecated, please use DeleteV2Async instead.")] public t.Task DeleteAsync(string path, - string parentRev = null) + string parentRev = null, + tr.CancellationToken cancellationToken = default) { var deleteArg = new DeleteArg(path, parentRev); - return this.DeleteAsync(deleteArg); + return this.DeleteAsync(deleteArg, cancellationToken); } /// @@ -1782,11 +1831,12 @@ public Metadata EndDelete(sys.IAsyncResult asyncResult) /// the job status. /// /// 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 DeleteBatchAsync(DeleteBatchArg deleteBatchArg) + public t.Task DeleteBatchAsync(DeleteBatchArg deleteBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(deleteBatchArg, "api", "/files/delete_batch", "user", global::Dropbox.Api.Files.DeleteBatchArg.Encoder, global::Dropbox.Api.Files.DeleteBatchLaunch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(deleteBatchArg, "api", "/files/delete_batch", "user", global::Dropbox.Api.Files.DeleteBatchArg.Encoder, global::Dropbox.Api.Files.DeleteBatchLaunch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -1813,13 +1863,15 @@ public sys.IAsyncResult BeginDeleteBatch(DeleteBatchArg deleteBatchArg, sys.Asyn /// the job status. /// /// The entries + /// 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 DeleteBatchAsync(col.IEnumerable entries) + public t.Task DeleteBatchAsync(col.IEnumerable entries, + tr.CancellationToken cancellationToken = default) { var deleteBatchArg = new DeleteBatchArg(entries); - return this.DeleteBatchAsync(deleteBatchArg); + return this.DeleteBatchAsync(deleteBatchArg, cancellationToken); } /// @@ -1864,14 +1916,15 @@ public DeleteBatchLaunch EndDeleteBatch(sys.IAsyncResult asyncResult) /// returns list of result for each entry. /// /// 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 DeleteBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task DeleteBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/delete_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.DeleteBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/delete_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.DeleteBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -1897,16 +1950,18 @@ public sys.IAsyncResult BeginDeleteBatchCheck(global::Dropbox.Api.Async.PollArg /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 DeleteBatchCheckAsync(string asyncJobId) + public t.Task DeleteBatchCheckAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.DeleteBatchCheckAsync(pollArg); + return this.DeleteBatchCheckAsync(pollArg, cancellationToken); } /// @@ -1953,14 +2008,15 @@ public DeleteBatchJobStatus EndDeleteBatchCheck(sys.IAsyncResult asyncResult) /// Download a file from a user's Dropbox. /// /// 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> DownloadAsync(DownloadArg downloadArg) + public t.Task> DownloadAsync(DownloadArg downloadArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendDownloadRequestAsync(downloadArg, "content", "/files/download", "user", global::Dropbox.Api.Files.DownloadArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.DownloadError.Decoder); + return this.Transport.SendDownloadRequestAsync(downloadArg, "content", "/files/download", "user", global::Dropbox.Api.Files.DownloadArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.DownloadError.Decoder, cancellationToken); } /// @@ -1985,18 +2041,20 @@ public sys.IAsyncResult BeginDownload(DownloadArg downloadArg, sys.AsyncCallback /// The path of the file to download. /// Please specify revision in /// instead. + /// 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> DownloadAsync(string path, - string rev = null) + string rev = null, + tr.CancellationToken cancellationToken = default) { var downloadArg = new DownloadArg(path, rev); - return this.DownloadAsync(downloadArg); + return this.DownloadAsync(downloadArg, cancellationToken); } /// @@ -2048,14 +2106,15 @@ public enc.IDownloadResponse EndDownload(sys.IAsyncResult asyncRes /// a single file. Any single file must be less than 4GB in size. /// /// 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> DownloadZipAsync(DownloadZipArg downloadZipArg) + public t.Task> DownloadZipAsync(DownloadZipArg downloadZipArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendDownloadRequestAsync(downloadZipArg, "content", "/files/download_zip", "user", global::Dropbox.Api.Files.DownloadZipArg.Encoder, global::Dropbox.Api.Files.DownloadZipResult.Decoder, global::Dropbox.Api.Files.DownloadZipError.Decoder); + return this.Transport.SendDownloadRequestAsync(downloadZipArg, "content", "/files/download_zip", "user", global::Dropbox.Api.Files.DownloadZipArg.Encoder, global::Dropbox.Api.Files.DownloadZipResult.Decoder, global::Dropbox.Api.Files.DownloadZipError.Decoder, cancellationToken); } /// @@ -2080,16 +2139,18 @@ public sys.IAsyncResult BeginDownloadZip(DownloadZipArg downloadZipArg, sys.Asyn /// a single file. Any single file must be less than 4GB in size. /// /// The path of the folder to download. + /// 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> DownloadZipAsync(string path) + public t.Task> DownloadZipAsync(string path, + tr.CancellationToken cancellationToken = default) { var downloadZipArg = new DownloadZipArg(path); - return this.DownloadZipAsync(downloadZipArg); + return this.DownloadZipAsync(downloadZipArg, cancellationToken); } /// @@ -2138,13 +2199,14 @@ public enc.IDownloadResponse EndDownloadZip(sys.IAsyncResult /// cref="Dropbox.Api.Files.ExportInfo.ExportAs" /> populated. /// /// 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> ExportAsync(ExportArg exportArg) + public t.Task> ExportAsync(ExportArg exportArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendDownloadRequestAsync(exportArg, "content", "/files/export", "user", global::Dropbox.Api.Files.ExportArg.Encoder, global::Dropbox.Api.Files.ExportResult.Decoder, global::Dropbox.Api.Files.ExportError.Decoder); + return this.Transport.SendDownloadRequestAsync(exportArg, "content", "/files/export", "user", global::Dropbox.Api.Files.ExportArg.Encoder, global::Dropbox.Api.Files.ExportResult.Decoder, global::Dropbox.Api.Files.ExportError.Decoder, cancellationToken); } /// @@ -2170,15 +2232,17 @@ public sys.IAsyncResult BeginExport(ExportArg exportArg, sys.AsyncCallback callb /// cref="Dropbox.Api.Files.ExportInfo.ExportAs" /> populated. /// /// The path of the file to be exported. + /// 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> ExportAsync(string path) + public t.Task> ExportAsync(string path, + tr.CancellationToken cancellationToken = default) { var exportArg = new ExportArg(path); - return this.ExportAsync(exportArg); + return this.ExportAsync(exportArg, cancellationToken); } /// @@ -2223,14 +2287,15 @@ public enc.IDownloadResponse EndExport(sys.IAsyncResult asyncResul /// Return the lock metadata for the given list of paths. /// /// 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 GetFileLockBatchAsync(LockFileBatchArg lockFileBatchArg) + public t.Task GetFileLockBatchAsync(LockFileBatchArg lockFileBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(lockFileBatchArg, "api", "/files/get_file_lock_batch", "user", global::Dropbox.Api.Files.LockFileBatchArg.Encoder, global::Dropbox.Api.Files.LockFileBatchResult.Decoder, global::Dropbox.Api.Files.LockFileError.Decoder); + return this.Transport.SendRpcRequestAsync(lockFileBatchArg, "api", "/files/get_file_lock_batch", "user", global::Dropbox.Api.Files.LockFileBatchArg.Encoder, global::Dropbox.Api.Files.LockFileBatchResult.Decoder, global::Dropbox.Api.Files.LockFileError.Decoder, cancellationToken); } /// @@ -2255,16 +2320,18 @@ public sys.IAsyncResult BeginGetFileLockBatch(LockFileBatchArg lockFileBatchArg, /// List of 'entries'. Each 'entry' contains a path of the file /// which will be locked or queried. Duplicate path arguments in the batch are /// considered only once. + /// 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 GetFileLockBatchAsync(col.IEnumerable entries) + public t.Task GetFileLockBatchAsync(col.IEnumerable entries, + tr.CancellationToken cancellationToken = default) { var lockFileBatchArg = new LockFileBatchArg(entries); - return this.GetFileLockBatchAsync(lockFileBatchArg); + return this.GetFileLockBatchAsync(lockFileBatchArg, cancellationToken); } /// @@ -2313,14 +2380,15 @@ public LockFileBatchResult EndGetFileLockBatch(sys.IAsyncResult asyncResult) /// 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 . - public t.Task GetMetadataAsync(GetMetadataArg getMetadataArg) + public t.Task GetMetadataAsync(GetMetadataArg getMetadataArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getMetadataArg, "api", "/files/get_metadata", "user", global::Dropbox.Api.Files.GetMetadataArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.GetMetadataError.Decoder); + return this.Transport.SendRpcRequestAsync(getMetadataArg, "api", "/files/get_metadata", "user", global::Dropbox.Api.Files.GetMetadataArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.GetMetadataError.Decoder, cancellationToken); } /// @@ -2356,6 +2424,7 @@ public sys.IAsyncResult BeginGetMetadata(GetMetadataArg getMetadataArg, sys.Asyn /// If set to a valid list of template IDs, is set if there exists /// property data associated with the file and each of the listed templates. + /// 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 @@ -2365,7 +2434,8 @@ public t.Task GetMetadataAsync(string path, bool includeMediaInfo = false, bool includeDeleted = false, bool includeHasExplicitSharedMembers = false, - global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null) + global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null, + tr.CancellationToken cancellationToken = default) { var getMetadataArg = new GetMetadataArg(path, includeMediaInfo, @@ -2373,7 +2443,7 @@ public t.Task GetMetadataAsync(string path, includeHasExplicitSharedMembers, includePropertyGroups); - return this.GetMetadataAsync(getMetadataArg); + return this.GetMetadataAsync(getMetadataArg, cancellationToken); } /// @@ -2445,13 +2515,14 @@ public Metadata EndGetMetadata(sys.IAsyncResult asyncResult) /// Other formats will return an unsupported extension error. /// /// 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> GetPreviewAsync(PreviewArg previewArg) + public t.Task> GetPreviewAsync(PreviewArg previewArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendDownloadRequestAsync(previewArg, "content", "/files/get_preview", "user", global::Dropbox.Api.Files.PreviewArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.PreviewError.Decoder); + return this.Transport.SendDownloadRequestAsync(previewArg, "content", "/files/get_preview", "user", global::Dropbox.Api.Files.PreviewArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.PreviewError.Decoder, cancellationToken); } /// @@ -2482,17 +2553,19 @@ public sys.IAsyncResult BeginGetPreview(PreviewArg previewArg, sys.AsyncCallback /// The path of the file to preview. /// Please specify revision in /// instead. + /// 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> GetPreviewAsync(string path, - string rev = null) + string rev = null, + tr.CancellationToken cancellationToken = default) { var previewArg = new PreviewArg(path, rev); - return this.GetPreviewAsync(previewArg); + return this.GetPreviewAsync(previewArg, cancellationToken); } /// @@ -2544,14 +2617,15 @@ public enc.IDownloadResponse EndGetPreview(sys.IAsyncResult asyncR /// automatically by the file's mime type. /// /// 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 GetTemporaryLinkAsync(GetTemporaryLinkArg getTemporaryLinkArg) + public t.Task GetTemporaryLinkAsync(GetTemporaryLinkArg getTemporaryLinkArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getTemporaryLinkArg, "api", "/files/get_temporary_link", "user", global::Dropbox.Api.Files.GetTemporaryLinkArg.Encoder, global::Dropbox.Api.Files.GetTemporaryLinkResult.Decoder, global::Dropbox.Api.Files.GetTemporaryLinkError.Decoder); + return this.Transport.SendRpcRequestAsync(getTemporaryLinkArg, "api", "/files/get_temporary_link", "user", global::Dropbox.Api.Files.GetTemporaryLinkArg.Encoder, global::Dropbox.Api.Files.GetTemporaryLinkResult.Decoder, global::Dropbox.Api.Files.GetTemporaryLinkError.Decoder, cancellationToken); } /// @@ -2577,16 +2651,18 @@ public sys.IAsyncResult BeginGetTemporaryLink(GetTemporaryLinkArg getTemporaryLi /// automatically by the file's mime type. /// /// The path to the file you want a temporary link to. + /// 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 GetTemporaryLinkAsync(string path) + public t.Task GetTemporaryLinkAsync(string path, + tr.CancellationToken cancellationToken = default) { var getTemporaryLinkArg = new GetTemporaryLinkArg(path); - return this.GetTemporaryLinkAsync(getTemporaryLinkArg); + return this.GetTemporaryLinkAsync(getTemporaryLinkArg, cancellationToken); } /// @@ -2674,11 +2750,12 @@ public GetTemporaryLinkResult EndGetTemporaryLink(sys.IAsyncResult asyncResult) /// Temporary upload link has been recently consumed. /// /// 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 GetTemporaryUploadLinkAsync(GetTemporaryUploadLinkArg getTemporaryUploadLinkArg) + public t.Task GetTemporaryUploadLinkAsync(GetTemporaryUploadLinkArg getTemporaryUploadLinkArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getTemporaryUploadLinkArg, "api", "/files/get_temporary_upload_link", "user", global::Dropbox.Api.Files.GetTemporaryUploadLinkArg.Encoder, global::Dropbox.Api.Files.GetTemporaryUploadLinkResult.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(getTemporaryUploadLinkArg, "api", "/files/get_temporary_upload_link", "user", global::Dropbox.Api.Files.GetTemporaryUploadLinkArg.Encoder, global::Dropbox.Api.Files.GetTemporaryUploadLinkResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -2748,15 +2825,17 @@ public sys.IAsyncResult BeginGetTemporaryUploadLink(GetTemporaryUploadLinkArg ge /// How long before this link expires, in seconds. Attempting /// to start an upload with this link longer than this period of time after link /// creation will result in an error. + /// 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 GetTemporaryUploadLinkAsync(CommitInfo commitInfo, - double duration = 14400.0) + double duration = 14400.0, + tr.CancellationToken cancellationToken = default) { var getTemporaryUploadLinkArg = new GetTemporaryUploadLinkArg(commitInfo, duration); - return this.GetTemporaryUploadLinkAsync(getTemporaryUploadLinkArg); + return this.GetTemporaryUploadLinkAsync(getTemporaryUploadLinkArg, cancellationToken); } /// @@ -2809,14 +2888,15 @@ public GetTemporaryUploadLinkResult EndGetTemporaryUploadLink(sys.IAsyncResult a /// be converted to a thumbnail. /// /// 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> GetThumbnailAsync(ThumbnailArg thumbnailArg) + public t.Task> GetThumbnailAsync(ThumbnailArg thumbnailArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendDownloadRequestAsync(thumbnailArg, "content", "/files/get_thumbnail", "user", global::Dropbox.Api.Files.ThumbnailArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.ThumbnailError.Decoder); + return this.Transport.SendDownloadRequestAsync(thumbnailArg, "content", "/files/get_thumbnail", "user", global::Dropbox.Api.Files.ThumbnailArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.ThumbnailError.Decoder, cancellationToken); } /// @@ -2848,6 +2928,7 @@ public sys.IAsyncResult BeginGetThumbnail(ThumbnailArg thumbnailArg, sys.AsyncCa /// 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 @@ -2856,14 +2937,15 @@ public sys.IAsyncResult BeginGetThumbnail(ThumbnailArg thumbnailArg, sys.AsyncCa public t.Task> GetThumbnailAsync(string path, ThumbnailFormat format = null, ThumbnailSize size = null, - ThumbnailMode mode = null) + ThumbnailMode mode = null, + tr.CancellationToken cancellationToken = default) { var thumbnailArg = new ThumbnailArg(path, format, size, mode); - return this.GetThumbnailAsync(thumbnailArg); + return this.GetThumbnailAsync(thumbnailArg, cancellationToken); } /// @@ -2921,14 +3003,15 @@ public enc.IDownloadResponse EndGetThumbnail(sys.IAsyncResult asyn /// 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", "user", 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", "user", global::Dropbox.Api.Files.ThumbnailV2Arg.Encoder, global::Dropbox.Api.Files.PreviewResult.Decoder, global::Dropbox.Api.Files.ThumbnailV2Error.Decoder, cancellationToken); } /// @@ -2959,6 +3042,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 @@ -2967,14 +3051,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); } /// @@ -3038,14 +3123,15 @@ public enc.IDownloadResponse EndGetThumbnailV2(sys.IAsyncResult a /// be converted to a thumbnail. /// /// 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 GetThumbnailBatchAsync(GetThumbnailBatchArg getThumbnailBatchArg) + public t.Task GetThumbnailBatchAsync(GetThumbnailBatchArg getThumbnailBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getThumbnailBatchArg, "content", "/files/get_thumbnail_batch", "user", global::Dropbox.Api.Files.GetThumbnailBatchArg.Encoder, global::Dropbox.Api.Files.GetThumbnailBatchResult.Decoder, global::Dropbox.Api.Files.GetThumbnailBatchError.Decoder); + return this.Transport.SendRpcRequestAsync(getThumbnailBatchArg, "content", "/files/get_thumbnail_batch", "user", global::Dropbox.Api.Files.GetThumbnailBatchArg.Encoder, global::Dropbox.Api.Files.GetThumbnailBatchResult.Decoder, global::Dropbox.Api.Files.GetThumbnailBatchError.Decoder, cancellationToken); } /// @@ -3072,16 +3158,18 @@ public sys.IAsyncResult BeginGetThumbnailBatch(GetThumbnailBatchArg getThumbnail /// be converted to a thumbnail. /// /// List of files to get thumbnails. + /// 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 GetThumbnailBatchAsync(col.IEnumerable entries) + public t.Task GetThumbnailBatchAsync(col.IEnumerable entries, + tr.CancellationToken cancellationToken = default) { var getThumbnailBatchArg = new GetThumbnailBatchArg(entries); - return this.GetThumbnailBatchAsync(getThumbnailBatchArg); + return this.GetThumbnailBatchAsync(getThumbnailBatchArg, cancellationToken); } /// @@ -3154,14 +3242,15 @@ public GetThumbnailBatchResult EndGetThumbnailBatch(sys.IAsyncResult asyncResult /// finishes. /// /// 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 ListFolderAsync(ListFolderArg listFolderArg) + public t.Task ListFolderAsync(ListFolderArg listFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFolderArg, "api", "/files/list_folder", "user", global::Dropbox.Api.Files.ListFolderArg.Encoder, global::Dropbox.Api.Files.ListFolderResult.Decoder, global::Dropbox.Api.Files.ListFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(listFolderArg, "api", "/files/list_folder", "user", global::Dropbox.Api.Files.ListFolderArg.Encoder, global::Dropbox.Api.Files.ListFolderResult.Decoder, global::Dropbox.Api.Files.ListFolderError.Decoder, cancellationToken); } /// @@ -3236,6 +3325,7 @@ public sys.IAsyncResult BeginListFolder(ListFolderArg listFolderArg, sys.AsyncCa /// property data associated with the file and each of the listed templates. /// If true, include files that are not /// downloadable, i.e. Google Docs. + /// 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 @@ -3250,7 +3340,8 @@ public t.Task ListFolderAsync(string path, uint? limit = null, SharedLink sharedLink = null, global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null, - bool includeNonDownloadableFiles = true) + bool includeNonDownloadableFiles = true, + tr.CancellationToken cancellationToken = default) { var listFolderArg = new ListFolderArg(path, recursive, @@ -3263,7 +3354,7 @@ public t.Task ListFolderAsync(string path, includePropertyGroups, includeNonDownloadableFiles); - return this.ListFolderAsync(listFolderArg); + return this.ListFolderAsync(listFolderArg, cancellationToken); } /// @@ -3356,14 +3447,15 @@ public ListFolderResult EndListFolder(sys.IAsyncResult asyncResult) /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.ListFolderAsync" />. /// /// 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 ListFolderContinueAsync(ListFolderContinueArg listFolderContinueArg) + public t.Task ListFolderContinueAsync(ListFolderContinueArg listFolderContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFolderContinueArg, "api", "/files/list_folder/continue", "user", global::Dropbox.Api.Files.ListFolderContinueArg.Encoder, global::Dropbox.Api.Files.ListFolderResult.Decoder, global::Dropbox.Api.Files.ListFolderContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(listFolderContinueArg, "api", "/files/list_folder/continue", "user", global::Dropbox.Api.Files.ListFolderContinueArg.Encoder, global::Dropbox.Api.Files.ListFolderResult.Decoder, global::Dropbox.Api.Files.ListFolderContinueError.Decoder, cancellationToken); } /// @@ -3392,16 +3484,18 @@ public sys.IAsyncResult BeginListFolderContinue(ListFolderContinueArg listFolder /// The cursor returned by your last call to 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 ListFolderContinueAsync(string cursor) + public t.Task ListFolderContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var listFolderContinueArg = new ListFolderContinueArg(cursor); - return this.ListFolderContinueAsync(listFolderContinueArg); + return this.ListFolderContinueAsync(listFolderContinueArg, cancellationToken); } /// @@ -3454,14 +3548,15 @@ public ListFolderResult EndListFolderContinue(sys.IAsyncResult asyncResult) /// in Dropbox. /// /// 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 ListFolderGetLatestCursorAsync(ListFolderArg listFolderArg) + public t.Task ListFolderGetLatestCursorAsync(ListFolderArg listFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFolderArg, "api", "/files/list_folder/get_latest_cursor", "user", global::Dropbox.Api.Files.ListFolderArg.Encoder, global::Dropbox.Api.Files.ListFolderGetLatestCursorResult.Decoder, global::Dropbox.Api.Files.ListFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(listFolderArg, "api", "/files/list_folder/get_latest_cursor", "user", global::Dropbox.Api.Files.ListFolderArg.Encoder, global::Dropbox.Api.Files.ListFolderGetLatestCursorResult.Decoder, global::Dropbox.Api.Files.ListFolderError.Decoder, cancellationToken); } /// @@ -3515,6 +3610,7 @@ public sys.IAsyncResult BeginListFolderGetLatestCursor(ListFolderArg listFolderA /// property data associated with the file and each of the listed templates. /// If true, include files that are not /// downloadable, i.e. Google Docs. + /// 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 @@ -3529,7 +3625,8 @@ public t.Task ListFolderGetLatestCursorAsync(st uint? limit = null, SharedLink sharedLink = null, global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null, - bool includeNonDownloadableFiles = true) + bool includeNonDownloadableFiles = true, + tr.CancellationToken cancellationToken = default) { var listFolderArg = new ListFolderArg(path, recursive, @@ -3542,7 +3639,7 @@ public t.Task ListFolderGetLatestCursorAsync(st includePropertyGroups, includeNonDownloadableFiles); - return this.ListFolderGetLatestCursorAsync(listFolderArg); + return this.ListFolderGetLatestCursorAsync(listFolderArg, cancellationToken); } /// @@ -3639,14 +3736,15 @@ public ListFolderGetLatestCursorResult EndListFolderGetLatestCursor(sys.IAsyncRe /// documentation. /// /// 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 ListFolderLongpollAsync(ListFolderLongpollArg listFolderLongpollArg) + public t.Task ListFolderLongpollAsync(ListFolderLongpollArg listFolderLongpollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFolderLongpollArg, "notify", "/files/list_folder/longpoll", "noauth", global::Dropbox.Api.Files.ListFolderLongpollArg.Encoder, global::Dropbox.Api.Files.ListFolderLongpollResult.Decoder, global::Dropbox.Api.Files.ListFolderLongpollError.Decoder); + return this.Transport.SendRpcRequestAsync(listFolderLongpollArg, "notify", "/files/list_folder/longpoll", "noauth", global::Dropbox.Api.Files.ListFolderLongpollArg.Encoder, global::Dropbox.Api.Files.ListFolderLongpollResult.Decoder, global::Dropbox.Api.Files.ListFolderLongpollError.Decoder, cancellationToken); } /// @@ -3684,18 +3782,20 @@ public sys.IAsyncResult BeginListFolderLongpoll(ListFolderLongpollArg listFolder /// length of time, plus up to 90 seconds of random jitter added to avoid the /// thundering herd problem. Care should be taken when using this parameter, as some /// network infrastructure does not support long timeouts. + /// 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 ListFolderLongpollAsync(string cursor, - ulong timeout = 30) + ulong timeout = 30, + tr.CancellationToken cancellationToken = default) { var listFolderLongpollArg = new ListFolderLongpollArg(cursor, timeout); - return this.ListFolderLongpollAsync(listFolderLongpollArg); + return this.ListFolderLongpollAsync(listFolderLongpollArg, cancellationToken); } /// @@ -3760,14 +3860,15 @@ public ListFolderLongpollResult EndListFolderLongpoll(sys.IAsyncResult asyncResu /// revisions for a given file across moves or renames. /// /// 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 ListRevisionsAsync(ListRevisionsArg listRevisionsArg) + public t.Task ListRevisionsAsync(ListRevisionsArg listRevisionsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listRevisionsArg, "api", "/files/list_revisions", "user", global::Dropbox.Api.Files.ListRevisionsArg.Encoder, global::Dropbox.Api.Files.ListRevisionsResult.Decoder, global::Dropbox.Api.Files.ListRevisionsError.Decoder); + return this.Transport.SendRpcRequestAsync(listRevisionsArg, "api", "/files/list_revisions", "user", global::Dropbox.Api.Files.ListRevisionsArg.Encoder, global::Dropbox.Api.Files.ListRevisionsResult.Decoder, global::Dropbox.Api.Files.ListRevisionsError.Decoder, cancellationToken); } /// @@ -3802,6 +3903,7 @@ public sys.IAsyncResult BeginListRevisions(ListRevisionsArg listRevisionsArg, sy /// Determines the behavior of the API in listing the revisions for /// a given file path or id. /// The maximum number of revision entries returned. + /// 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 @@ -3809,13 +3911,14 @@ public sys.IAsyncResult BeginListRevisions(ListRevisionsArg listRevisionsArg, sy /// cref="ListRevisionsError"/>. public t.Task ListRevisionsAsync(string path, ListRevisionsMode mode = null, - ulong limit = 10) + ulong limit = 10, + tr.CancellationToken cancellationToken = default) { var listRevisionsArg = new ListRevisionsArg(path, mode, limit); - return this.ListRevisionsAsync(listRevisionsArg); + return this.ListRevisionsAsync(listRevisionsArg, cancellationToken); } /// @@ -3870,14 +3973,15 @@ public ListRevisionsResult EndListRevisions(sys.IAsyncResult asyncResult) /// a list of the locked file paths and their metadata after this operation. /// /// 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 LockFileBatchAsync(LockFileBatchArg lockFileBatchArg) + public t.Task LockFileBatchAsync(LockFileBatchArg lockFileBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(lockFileBatchArg, "api", "/files/lock_file_batch", "user", global::Dropbox.Api.Files.LockFileBatchArg.Encoder, global::Dropbox.Api.Files.LockFileBatchResult.Decoder, global::Dropbox.Api.Files.LockFileError.Decoder); + return this.Transport.SendRpcRequestAsync(lockFileBatchArg, "api", "/files/lock_file_batch", "user", global::Dropbox.Api.Files.LockFileBatchArg.Encoder, global::Dropbox.Api.Files.LockFileBatchResult.Decoder, global::Dropbox.Api.Files.LockFileError.Decoder, cancellationToken); } /// @@ -3904,16 +4008,18 @@ public sys.IAsyncResult BeginLockFileBatch(LockFileBatchArg lockFileBatchArg, sy /// List of 'entries'. Each 'entry' contains a path of the file /// which will be locked or queried. Duplicate path arguments in the batch are /// considered only once. + /// 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 LockFileBatchAsync(col.IEnumerable entries) + public t.Task LockFileBatchAsync(col.IEnumerable entries, + tr.CancellationToken cancellationToken = default) { var lockFileBatchArg = new LockFileBatchArg(entries); - return this.LockFileBatchAsync(lockFileBatchArg); + return this.LockFileBatchAsync(lockFileBatchArg, cancellationToken); } /// @@ -3963,14 +4069,15 @@ public LockFileBatchResult EndLockFileBatch(sys.IAsyncResult asyncResult) /// Note that we do not currently support case-only renaming. /// /// 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 MoveV2Async(RelocationArg relocationArg) + public t.Task MoveV2Async(RelocationArg relocationArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/move_v2", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.RelocationResult.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder); + return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/move_v2", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.RelocationResult.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder, cancellationToken); } /// @@ -4002,6 +4109,7 @@ public sys.IAsyncResult BeginMoveV2(RelocationArg relocationArg, sys.AsyncCallba /// Allow moves by owner even if it would result /// in an ownership transfer for the content being moved. This does not apply to /// copies. + /// 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 @@ -4011,7 +4119,8 @@ public t.Task MoveV2Async(string fromPath, string toPath, bool allowSharedFolder = false, bool autorename = false, - bool allowOwnershipTransfer = false) + bool allowOwnershipTransfer = false, + tr.CancellationToken cancellationToken = default) { var relocationArg = new RelocationArg(fromPath, toPath, @@ -4019,7 +4128,7 @@ public t.Task MoveV2Async(string fromPath, autorename, allowOwnershipTransfer); - return this.MoveV2Async(relocationArg); + return this.MoveV2Async(relocationArg, cancellationToken); } /// @@ -4080,15 +4189,16 @@ public RelocationResult EndMoveV2(sys.IAsyncResult asyncResult) /// If the source path is a folder all its contents will be moved. /// /// 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 MoveV2Async instead.")] - public t.Task MoveAsync(RelocationArg relocationArg) + public t.Task MoveAsync(RelocationArg relocationArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/move", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder); + return this.Transport.SendRpcRequestAsync(relocationArg, "api", "/files/move", "user", global::Dropbox.Api.Files.RelocationArg.Encoder, global::Dropbox.Api.Files.Metadata.Decoder, global::Dropbox.Api.Files.RelocationError.Decoder, cancellationToken); } /// @@ -4120,6 +4230,7 @@ public sys.IAsyncResult BeginMove(RelocationArg relocationArg, sys.AsyncCallback /// Allow moves by owner even if it would result /// in an ownership transfer for the content being moved. This does not apply to /// copies. + /// 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 @@ -4130,7 +4241,8 @@ public t.Task MoveAsync(string fromPath, string toPath, bool allowSharedFolder = false, bool autorename = false, - bool allowOwnershipTransfer = false) + bool allowOwnershipTransfer = false, + tr.CancellationToken cancellationToken = default) { var relocationArg = new RelocationArg(fromPath, toPath, @@ -4138,7 +4250,7 @@ public t.Task MoveAsync(string fromPath, autorename, allowOwnershipTransfer); - return this.MoveAsync(relocationArg); + return this.MoveAsync(relocationArg, cancellationToken); } /// @@ -4210,11 +4322,12 @@ public Metadata EndMove(sys.IAsyncResult asyncResult) /// the job status. /// /// 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 MoveBatchV2Async(MoveBatchArg moveBatchArg) + public t.Task MoveBatchV2Async(MoveBatchArg moveBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(moveBatchArg, "api", "/files/move_batch_v2", "user", global::Dropbox.Api.Files.MoveBatchArg.Encoder, global::Dropbox.Api.Files.RelocationBatchV2Launch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(moveBatchArg, "api", "/files/move_batch_v2", "user", global::Dropbox.Api.Files.MoveBatchArg.Encoder, global::Dropbox.Api.Files.RelocationBatchV2Launch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -4253,17 +4366,19 @@ public sys.IAsyncResult BeginMoveBatchV2(MoveBatchArg moveBatchArg, sys.AsyncCal /// Allow moves by owner even if it would result /// in an ownership transfer for the content being moved. This does not apply to /// copies. + /// 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 MoveBatchV2Async(col.IEnumerable entries, bool autorename = false, - bool allowOwnershipTransfer = false) + bool allowOwnershipTransfer = false, + tr.CancellationToken cancellationToken = default) { var moveBatchArg = new MoveBatchArg(entries, autorename, allowOwnershipTransfer); - return this.MoveBatchV2Async(moveBatchArg); + return this.MoveBatchV2Async(moveBatchArg, cancellationToken); } /// @@ -4321,12 +4436,13 @@ public RelocationBatchV2Launch EndMoveBatchV2(sys.IAsyncResult asyncResult) /// job status. /// /// 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. [sys.Obsolete("This function is deprecated, please use MoveBatchV2Async instead.")] - public t.Task MoveBatchAsync(RelocationBatchArg relocationBatchArg) + public t.Task MoveBatchAsync(RelocationBatchArg relocationBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relocationBatchArg, "api", "/files/move_batch", "user", global::Dropbox.Api.Files.RelocationBatchArg.Encoder, global::Dropbox.Api.Files.RelocationBatchLaunch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(relocationBatchArg, "api", "/files/move_batch", "user", global::Dropbox.Api.Files.RelocationBatchArg.Encoder, global::Dropbox.Api.Files.RelocationBatchLaunch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -4362,20 +4478,22 @@ public sys.IAsyncResult BeginMoveBatch(RelocationBatchArg relocationBatchArg, sy /// Allow moves by owner even if it would result /// in an ownership transfer for the content being moved. This does not apply to /// copies. + /// The cancellation token to cancel operation. /// The task that represents the asynchronous send operation. The TResult /// parameter contains the response from the server. [sys.Obsolete("This function is deprecated, please use MoveBatchV2Async instead.")] public t.Task MoveBatchAsync(col.IEnumerable entries, bool autorename = false, bool allowSharedFolder = false, - bool allowOwnershipTransfer = false) + bool allowOwnershipTransfer = false, + tr.CancellationToken cancellationToken = default) { var relocationBatchArg = new RelocationBatchArg(entries, autorename, allowSharedFolder, allowOwnershipTransfer); - return this.MoveBatchAsync(relocationBatchArg); + return this.MoveBatchAsync(relocationBatchArg, cancellationToken); } /// @@ -4435,14 +4553,15 @@ public RelocationBatchLaunch EndMoveBatch(sys.IAsyncResult asyncResult) /// list of results for each entry. /// /// 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 MoveBatchCheckV2Async(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task MoveBatchCheckV2Async(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/move_batch/check_v2", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchV2JobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/move_batch/check_v2", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchV2JobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -4468,16 +4587,18 @@ public sys.IAsyncResult BeginMoveBatchCheckV2(global::Dropbox.Api.Async.PollArg /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 MoveBatchCheckV2Async(string asyncJobId) + public t.Task MoveBatchCheckV2Async(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.MoveBatchCheckV2Async(pollArg); + return this.MoveBatchCheckV2Async(pollArg, cancellationToken); } /// @@ -4526,15 +4647,16 @@ public RelocationBatchV2JobStatus EndMoveBatchCheckV2(sys.IAsyncResult asyncResu /// returns list of results for each entry. /// /// 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 MoveBatchCheckV2Async instead.")] - public t.Task MoveBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task MoveBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/move_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/move_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.RelocationBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -4561,17 +4683,19 @@ public sys.IAsyncResult BeginMoveBatchCheck(global::Dropbox.Api.Async.PollArg po /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 MoveBatchCheckV2Async instead.")] - public t.Task MoveBatchCheckAsync(string asyncJobId) + public t.Task MoveBatchCheckAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.MoveBatchCheckAsync(pollArg); + return this.MoveBatchCheckAsync(pollArg, cancellationToken); } /// @@ -4625,12 +4749,13 @@ public RelocationBatchJobStatus EndMoveBatchCheck(sys.IAsyncResult asyncResult) /// Note: This endpoint is only available for Dropbox Business apps. /// /// 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 PermanentlyDeleteAsync(DeleteArg deleteArg) + public t.Task PermanentlyDeleteAsync(DeleteArg deleteArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(deleteArg, "api", "/files/permanently_delete", "user", global::Dropbox.Api.Files.DeleteArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Files.DeleteError.Decoder); + return this.Transport.SendRpcRequestAsync(deleteArg, "api", "/files/permanently_delete", "user", global::Dropbox.Api.Files.DeleteArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Files.DeleteError.Decoder, cancellationToken); } /// @@ -4660,16 +4785,18 @@ public sys.IAsyncResult BeginPermanentlyDelete(DeleteArg deleteArg, sys.AsyncCal /// Path in the user's Dropbox to delete. /// Perform delete if given "rev" matches the existing file's /// latest "rev". This field does not support deleting a folder. + /// 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 PermanentlyDeleteAsync(string path, - string parentRev = null) + string parentRev = null, + tr.CancellationToken cancellationToken = default) { var deleteArg = new DeleteArg(path, parentRev); - return this.PermanentlyDeleteAsync(deleteArg); + return this.PermanentlyDeleteAsync(deleteArg, cancellationToken); } /// @@ -4715,14 +4842,15 @@ public void EndPermanentlyDelete(sys.IAsyncResult asyncResult) /// The properties add route /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task PropertiesAddAsync(global::Dropbox.Api.FileProperties.AddPropertiesArg addPropertiesArg) + public t.Task PropertiesAddAsync(global::Dropbox.Api.FileProperties.AddPropertiesArg addPropertiesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(addPropertiesArg, "api", "/files/properties/add", "user", global::Dropbox.Api.FileProperties.AddPropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.AddPropertiesError.Decoder); + return this.Transport.SendRpcRequestAsync(addPropertiesArg, "api", "/files/properties/add", "user", global::Dropbox.Api.FileProperties.AddPropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.AddPropertiesError.Decoder, cancellationToken); } /// @@ -4748,18 +4876,20 @@ public sys.IAsyncResult BeginPropertiesAdd(global::Dropbox.Api.FileProperties.Ad /// 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 . [sys.Obsolete("This function is deprecated")] public t.Task PropertiesAddAsync(string path, - col.IEnumerable propertyGroups) + col.IEnumerable propertyGroups, + tr.CancellationToken cancellationToken = default) { var addPropertiesArg = new global::Dropbox.Api.FileProperties.AddPropertiesArg(path, propertyGroups); - return this.PropertiesAddAsync(addPropertiesArg); + return this.PropertiesAddAsync(addPropertiesArg, cancellationToken); } /// @@ -4808,14 +4938,15 @@ public void EndPropertiesAdd(sys.IAsyncResult asyncResult) /// The properties overwrite route /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task PropertiesOverwriteAsync(global::Dropbox.Api.FileProperties.OverwritePropertyGroupArg overwritePropertyGroupArg) + public t.Task PropertiesOverwriteAsync(global::Dropbox.Api.FileProperties.OverwritePropertyGroupArg overwritePropertyGroupArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(overwritePropertyGroupArg, "api", "/files/properties/overwrite", "user", global::Dropbox.Api.FileProperties.OverwritePropertyGroupArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.InvalidPropertyGroupError.Decoder); + return this.Transport.SendRpcRequestAsync(overwritePropertyGroupArg, "api", "/files/properties/overwrite", "user", global::Dropbox.Api.FileProperties.OverwritePropertyGroupArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.InvalidPropertyGroupError.Decoder, cancellationToken); } /// @@ -4841,18 +4972,20 @@ public sys.IAsyncResult BeginPropertiesOverwrite(global::Dropbox.Api.FilePropert /// 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 . [sys.Obsolete("This function is deprecated")] public t.Task PropertiesOverwriteAsync(string path, - col.IEnumerable propertyGroups) + col.IEnumerable propertyGroups, + tr.CancellationToken cancellationToken = default) { var overwritePropertyGroupArg = new global::Dropbox.Api.FileProperties.OverwritePropertyGroupArg(path, propertyGroups); - return this.PropertiesOverwriteAsync(overwritePropertyGroupArg); + return this.PropertiesOverwriteAsync(overwritePropertyGroupArg, cancellationToken); } /// @@ -4901,14 +5034,15 @@ public void EndPropertiesOverwrite(sys.IAsyncResult asyncResult) /// The properties remove route /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task PropertiesRemoveAsync(global::Dropbox.Api.FileProperties.RemovePropertiesArg removePropertiesArg) + public t.Task PropertiesRemoveAsync(global::Dropbox.Api.FileProperties.RemovePropertiesArg removePropertiesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(removePropertiesArg, "api", "/files/properties/remove", "user", global::Dropbox.Api.FileProperties.RemovePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.RemovePropertiesError.Decoder); + return this.Transport.SendRpcRequestAsync(removePropertiesArg, "api", "/files/properties/remove", "user", global::Dropbox.Api.FileProperties.RemovePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.RemovePropertiesError.Decoder, cancellationToken); } /// @@ -4938,18 +5072,20 @@ public sys.IAsyncResult BeginPropertiesRemove(global::Dropbox.Api.FileProperties /// /> 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 . [sys.Obsolete("This function is deprecated")] public t.Task PropertiesRemoveAsync(string path, - col.IEnumerable propertyTemplateIds) + col.IEnumerable propertyTemplateIds, + tr.CancellationToken cancellationToken = default) { var removePropertiesArg = new global::Dropbox.Api.FileProperties.RemovePropertiesArg(path, propertyTemplateIds); - return this.PropertiesRemoveAsync(removePropertiesArg); + return this.PropertiesRemoveAsync(removePropertiesArg, cancellationToken); } /// @@ -5002,15 +5138,16 @@ public void EndPropertiesRemove(sys.IAsyncResult asyncResult) /// The properties template get route /// /// 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")] - public t.Task PropertiesTemplateGetAsync(global::Dropbox.Api.FileProperties.GetTemplateArg getTemplateArg) + public t.Task PropertiesTemplateGetAsync(global::Dropbox.Api.FileProperties.GetTemplateArg getTemplateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getTemplateArg, "api", "/files/properties/template/get", "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", "/files/properties/template/get", "user", global::Dropbox.Api.FileProperties.GetTemplateArg.Encoder, global::Dropbox.Api.FileProperties.GetTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken); } /// @@ -5038,17 +5175,19 @@ public sys.IAsyncResult BeginPropertiesTemplateGet(global::Dropbox.Api.FilePrope /// /> 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 . [sys.Obsolete("This function is deprecated")] - public t.Task PropertiesTemplateGetAsync(string templateId) + public t.Task PropertiesTemplateGetAsync(string templateId, + tr.CancellationToken cancellationToken = default) { var getTemplateArg = new global::Dropbox.Api.FileProperties.GetTemplateArg(templateId); - return this.PropertiesTemplateGetAsync(getTemplateArg); + return this.PropertiesTemplateGetAsync(getTemplateArg, cancellationToken); } /// @@ -5099,15 +5238,16 @@ public sys.IAsyncResult BeginPropertiesTemplateGet(string templateId, /// /// The properties template list route /// + /// 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")] - public t.Task PropertiesTemplateListAsync() + public t.Task PropertiesTemplateListAsync(tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/files/properties/template/list", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder); + return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/files/properties/template/list", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken); } /// @@ -5152,14 +5292,15 @@ public sys.IAsyncResult BeginPropertiesTemplateList(sys.AsyncCallback callback, /// The properties update route /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task PropertiesUpdateAsync(global::Dropbox.Api.FileProperties.UpdatePropertiesArg updatePropertiesArg) + public t.Task PropertiesUpdateAsync(global::Dropbox.Api.FileProperties.UpdatePropertiesArg updatePropertiesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(updatePropertiesArg, "api", "/files/properties/update", "user", global::Dropbox.Api.FileProperties.UpdatePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.UpdatePropertiesError.Decoder); + return this.Transport.SendRpcRequestAsync(updatePropertiesArg, "api", "/files/properties/update", "user", global::Dropbox.Api.FileProperties.UpdatePropertiesArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.FileProperties.UpdatePropertiesError.Decoder, cancellationToken); } /// @@ -5185,18 +5326,20 @@ public sys.IAsyncResult BeginPropertiesUpdate(global::Dropbox.Api.FileProperties /// 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 . [sys.Obsolete("This function is deprecated")] public t.Task PropertiesUpdateAsync(string path, - col.IEnumerable updatePropertyGroups) + col.IEnumerable updatePropertyGroups, + tr.CancellationToken cancellationToken = default) { var updatePropertiesArg = new global::Dropbox.Api.FileProperties.UpdatePropertiesArg(path, updatePropertyGroups); - return this.PropertiesUpdateAsync(updatePropertiesArg); + return this.PropertiesUpdateAsync(updatePropertiesArg, cancellationToken); } /// @@ -5245,13 +5388,14 @@ public void EndPropertiesUpdate(sys.IAsyncResult asyncResult) /// Restore a specific revision of a file to the given path. /// /// 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 RestoreAsync(RestoreArg restoreArg) + public t.Task RestoreAsync(RestoreArg restoreArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(restoreArg, "api", "/files/restore", "user", global::Dropbox.Api.Files.RestoreArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.RestoreError.Decoder); + return this.Transport.SendRpcRequestAsync(restoreArg, "api", "/files/restore", "user", global::Dropbox.Api.Files.RestoreArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.RestoreError.Decoder, cancellationToken); } /// @@ -5275,17 +5419,19 @@ public sys.IAsyncResult BeginRestore(RestoreArg restoreArg, sys.AsyncCallback ca /// /// The path to save the restored file. /// The revision to restore. + /// 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 RestoreAsync(string path, - string rev) + string rev, + tr.CancellationToken cancellationToken = default) { var restoreArg = new RestoreArg(path, rev); - return this.RestoreAsync(restoreArg); + return this.RestoreAsync(restoreArg, cancellationToken); } /// @@ -5337,13 +5483,14 @@ public FileMetadata EndRestore(sys.IAsyncResult asyncResult) /// conflict (e.g. myfile (1).txt). /// /// 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 SaveUrlAsync(SaveUrlArg saveUrlArg) + public t.Task SaveUrlAsync(SaveUrlArg saveUrlArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(saveUrlArg, "api", "/files/save_url", "user", global::Dropbox.Api.Files.SaveUrlArg.Encoder, global::Dropbox.Api.Files.SaveUrlResult.Decoder, global::Dropbox.Api.Files.SaveUrlError.Decoder); + return this.Transport.SendRpcRequestAsync(saveUrlArg, "api", "/files/save_url", "user", global::Dropbox.Api.Files.SaveUrlArg.Encoder, global::Dropbox.Api.Files.SaveUrlResult.Decoder, global::Dropbox.Api.Files.SaveUrlError.Decoder, cancellationToken); } /// @@ -5371,17 +5518,19 @@ public sys.IAsyncResult BeginSaveUrl(SaveUrlArg saveUrlArg, sys.AsyncCallback ca /// /// The path in Dropbox where the URL will be saved to. /// The URL to be saved. + /// 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 SaveUrlAsync(string path, - string url) + string url, + tr.CancellationToken cancellationToken = default) { var saveUrlArg = new SaveUrlArg(path, url); - return this.SaveUrlAsync(saveUrlArg); + return this.SaveUrlAsync(saveUrlArg, cancellationToken); } /// @@ -5430,14 +5579,15 @@ public SaveUrlResult EndSaveUrl(sys.IAsyncResult asyncResult) /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.SaveUrlAsync" /> job. /// /// 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 SaveUrlCheckJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task SaveUrlCheckJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/save_url/check_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.SaveUrlJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/save_url/check_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.SaveUrlJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -5462,16 +5612,18 @@ public sys.IAsyncResult BeginSaveUrlCheckJobStatus(global::Dropbox.Api.Async.Pol /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 SaveUrlCheckJobStatusAsync(string asyncJobId) + public t.Task SaveUrlCheckJobStatusAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.SaveUrlCheckJobStatusAsync(pollArg); + return this.SaveUrlCheckJobStatusAsync(pollArg, cancellationToken); } /// @@ -5521,14 +5673,15 @@ public SaveUrlJobStatus EndSaveUrlCheckJobStatus(sys.IAsyncResult asyncResult) /// days. /// /// 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 SearchV2Async instead.")] - public t.Task SearchAsync(SearchArg searchArg) + public t.Task SearchAsync(SearchArg searchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(searchArg, "api", "/files/search", "user", global::Dropbox.Api.Files.SearchArg.Encoder, global::Dropbox.Api.Files.SearchResult.Decoder, global::Dropbox.Api.Files.SearchError.Decoder); + return this.Transport.SendRpcRequestAsync(searchArg, "api", "/files/search", "user", global::Dropbox.Api.Files.SearchArg.Encoder, global::Dropbox.Api.Files.SearchResult.Decoder, global::Dropbox.Api.Files.SearchError.Decoder, cancellationToken); } /// @@ -5566,6 +5719,7 @@ public sys.IAsyncResult BeginSearch(SearchArg searchArg, sys.AsyncCallback callb /// The search mode (filename, filename_and_content, or /// deleted_filename). Note that searching file content is only available for Dropbox /// Business accounts. + /// 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 @@ -5575,7 +5729,8 @@ public t.Task SearchAsync(string path, string query, ulong start = 0, ulong maxResults = 100, - SearchMode mode = null) + SearchMode mode = null, + tr.CancellationToken cancellationToken = default) { var searchArg = new SearchArg(path, query, @@ -5583,7 +5738,7 @@ public t.Task SearchAsync(string path, maxResults, mode); - return this.SearchAsync(searchArg); + return this.SearchAsync(searchArg, cancellationToken); } /// @@ -5656,13 +5811,14 @@ public SearchResult EndSearch(sys.IAsyncResult asyncResult) /// results may not be returned. /// /// 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 SearchV2Async(SearchV2Arg searchV2Arg) + public t.Task SearchV2Async(SearchV2Arg searchV2Arg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(searchV2Arg, "api", "/files/search_v2", "user", global::Dropbox.Api.Files.SearchV2Arg.Encoder, global::Dropbox.Api.Files.SearchV2Result.Decoder, global::Dropbox.Api.Files.SearchError.Decoder); + return this.Transport.SendRpcRequestAsync(searchV2Arg, "api", "/files/search_v2", "user", global::Dropbox.Api.Files.SearchV2Arg.Encoder, global::Dropbox.Api.Files.SearchV2Result.Decoder, global::Dropbox.Api.Files.SearchError.Decoder, cancellationToken); } /// @@ -5698,6 +5854,7 @@ public sys.IAsyncResult BeginSearchV2(SearchV2Arg searchV2Arg, sys.AsyncCallback /// Options for search results match fields. /// Deprecated and moved this option to /// SearchMatchFieldOptions. + /// 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 @@ -5705,14 +5862,15 @@ public sys.IAsyncResult BeginSearchV2(SearchV2Arg searchV2Arg, sys.AsyncCallback public t.Task SearchV2Async(string query, SearchOptions options = null, SearchMatchFieldOptions matchFieldOptions = null, - bool? includeHighlights = null) + bool? includeHighlights = null, + tr.CancellationToken cancellationToken = default) { var searchV2Arg = new SearchV2Arg(query, options, matchFieldOptions, includeHighlights); - return this.SearchV2Async(searchV2Arg); + return this.SearchV2Async(searchV2Arg, cancellationToken); } /// @@ -5777,13 +5935,14 @@ public SearchV2Result EndSearchV2(sys.IAsyncResult asyncResult) /// results may not be returned. /// /// 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 SearchContinueV2Async(SearchV2ContinueArg searchV2ContinueArg) + public t.Task SearchContinueV2Async(SearchV2ContinueArg searchV2ContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(searchV2ContinueArg, "api", "/files/search/continue_v2", "user", global::Dropbox.Api.Files.SearchV2ContinueArg.Encoder, global::Dropbox.Api.Files.SearchV2Result.Decoder, global::Dropbox.Api.Files.SearchError.Decoder); + return this.Transport.SendRpcRequestAsync(searchV2ContinueArg, "api", "/files/search/continue_v2", "user", global::Dropbox.Api.Files.SearchV2ContinueArg.Encoder, global::Dropbox.Api.Files.SearchV2Result.Decoder, global::Dropbox.Api.Files.SearchError.Decoder, cancellationToken); } /// @@ -5816,15 +5975,17 @@ public sys.IAsyncResult BeginSearchContinueV2(SearchV2ContinueArg searchV2Contin /// The cursor returned by your last call to . Used to fetch the /// next page of results. + /// 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 SearchContinueV2Async(string cursor) + public t.Task SearchContinueV2Async(string cursor, + tr.CancellationToken cancellationToken = default) { var searchV2ContinueArg = new SearchV2ContinueArg(cursor); - return this.SearchContinueV2Async(searchV2ContinueArg); + return this.SearchContinueV2Async(searchV2ContinueArg, cancellationToken); } /// @@ -5874,14 +6035,15 @@ public SearchV2Result EndSearchContinueV2(sys.IAsyncResult asyncResult) /// paths and their metadata after this operation. /// /// 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 UnlockFileBatchAsync(UnlockFileBatchArg unlockFileBatchArg) + public t.Task UnlockFileBatchAsync(UnlockFileBatchArg unlockFileBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(unlockFileBatchArg, "api", "/files/unlock_file_batch", "user", global::Dropbox.Api.Files.UnlockFileBatchArg.Encoder, global::Dropbox.Api.Files.LockFileBatchResult.Decoder, global::Dropbox.Api.Files.LockFileError.Decoder); + return this.Transport.SendRpcRequestAsync(unlockFileBatchArg, "api", "/files/unlock_file_batch", "user", global::Dropbox.Api.Files.UnlockFileBatchArg.Encoder, global::Dropbox.Api.Files.LockFileBatchResult.Decoder, global::Dropbox.Api.Files.LockFileError.Decoder, cancellationToken); } /// @@ -5909,16 +6071,18 @@ public sys.IAsyncResult BeginUnlockFileBatch(UnlockFileBatchArg unlockFileBatchA /// List of 'entries'. Each 'entry' contains a path of the file /// which will be unlocked. Duplicate path arguments in the batch are considered only /// once. + /// 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 UnlockFileBatchAsync(col.IEnumerable entries) + public t.Task UnlockFileBatchAsync(col.IEnumerable entries, + tr.CancellationToken cancellationToken = default) { var unlockFileBatchArg = new UnlockFileBatchArg(entries); - return this.UnlockFileBatchAsync(unlockFileBatchArg); + return this.UnlockFileBatchAsync(unlockFileBatchArg, cancellationToken); } /// @@ -5975,13 +6139,14 @@ public LockFileBatchResult EndUnlockFileBatch(sys.IAsyncResult asyncResult) /// /// The request parameters /// The content to upload. + /// 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 UploadAsync(CommitInfo commitInfo, io.Stream body) + public t.Task UploadAsync(CommitInfo commitInfo, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(commitInfo, body, "content", "/files/upload", "user", global::Dropbox.Api.Files.CommitInfo.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.UploadError.Decoder); + return this.Transport.SendUploadRequestAsync(commitInfo, body, "content", "/files/upload", "user", global::Dropbox.Api.Files.CommitInfo.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.UploadError.Decoder, cancellationToken); } /// @@ -6034,6 +6199,7 @@ public sys.IAsyncResult BeginUpload(CommitInfo commitInfo, io.Stream body, sys.A /// deleted. This also forces a conflict even when the target path refers to a file /// with identical contents. /// The document to upload + /// 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 @@ -6045,7 +6211,8 @@ public t.Task UploadAsync(string path, bool mute = false, col.IEnumerable propertyGroups = null, bool strictConflict = false, - io.Stream body = null) + io.Stream body = null, + tr.CancellationToken cancellationToken = default) { var commitInfo = new CommitInfo(path, mode, @@ -6055,7 +6222,7 @@ public t.Task UploadAsync(string path, propertyGroups, strictConflict); - return this.UploadAsync(commitInfo, body); + return this.UploadAsync(commitInfo, body, cancellationToken); } /// @@ -6143,13 +6310,14 @@ public FileMetadata EndUpload(sys.IAsyncResult asyncResult) /// /// The request parameters /// The content to upload. + /// 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 UploadSessionAppendV2Async(UploadSessionAppendArg uploadSessionAppendArg, io.Stream body) + public t.Task UploadSessionAppendV2Async(UploadSessionAppendArg uploadSessionAppendArg, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(uploadSessionAppendArg, body, "content", "/files/upload_session/append_v2", "user", global::Dropbox.Api.Files.UploadSessionAppendArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Files.UploadSessionLookupError.Decoder); + return this.Transport.SendUploadRequestAsync(uploadSessionAppendArg, body, "content", "/files/upload_session/append_v2", "user", global::Dropbox.Api.Files.UploadSessionAppendArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Files.UploadSessionLookupError.Decoder, cancellationToken); } /// @@ -6186,18 +6354,20 @@ public sys.IAsyncResult BeginUploadSessionAppendV2(UploadSessionAppendArg upload /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.UploadSessionAppendV2Async" /> /// anymore with the current session. /// The document to upload + /// 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 UploadSessionAppendV2Async(UploadSessionCursor cursor, bool close = false, - io.Stream body = null) + io.Stream body = null, + tr.CancellationToken cancellationToken = default) { var uploadSessionAppendArg = new UploadSessionAppendArg(cursor, close); - return this.UploadSessionAppendV2Async(uploadSessionAppendArg, body); + return this.UploadSessionAppendV2Async(uploadSessionAppendArg, body, cancellationToken); } /// @@ -6256,14 +6426,15 @@ public void EndUploadSessionAppendV2(sys.IAsyncResult asyncResult) /// /// The request parameters /// The content to upload. + /// 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 . [sys.Obsolete("This function is deprecated, please use UploadSessionAppendV2Async instead.")] - public t.Task UploadSessionAppendAsync(UploadSessionCursor uploadSessionCursor, io.Stream body) + public t.Task UploadSessionAppendAsync(UploadSessionCursor uploadSessionCursor, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(uploadSessionCursor, body, "content", "/files/upload_session/append", "user", global::Dropbox.Api.Files.UploadSessionCursor.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Files.UploadSessionLookupError.Decoder); + return this.Transport.SendUploadRequestAsync(uploadSessionCursor, body, "content", "/files/upload_session/append", "user", global::Dropbox.Api.Files.UploadSessionCursor.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Files.UploadSessionLookupError.Decoder, cancellationToken); } /// @@ -6301,6 +6472,7 @@ public sys.IAsyncResult BeginUploadSessionAppend(UploadSessionCursor uploadSessi /// to make sure upload data isn't lost or duplicated in the event of a network /// error. /// The document to upload + /// 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 @@ -6376,14 +6549,15 @@ public void EndUploadSessionAppend(sys.IAsyncResult asyncResult) /// /// The request parameters /// The content to upload. + /// 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 UploadSessionFinishAsync(UploadSessionFinishArg uploadSessionFinishArg, io.Stream body) + public t.Task UploadSessionFinishAsync(UploadSessionFinishArg uploadSessionFinishArg, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(uploadSessionFinishArg, body, "content", "/files/upload_session/finish", "user", global::Dropbox.Api.Files.UploadSessionFinishArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.UploadSessionFinishError.Decoder); + return this.Transport.SendUploadRequestAsync(uploadSessionFinishArg, body, "content", "/files/upload_session/finish", "user", global::Dropbox.Api.Files.UploadSessionFinishArg.Encoder, global::Dropbox.Api.Files.FileMetadata.Decoder, global::Dropbox.Api.Files.UploadSessionFinishError.Decoder, cancellationToken); } /// @@ -6418,6 +6592,7 @@ public sys.IAsyncResult BeginUploadSessionFinish(UploadSessionFinishArg uploadSe /// Contains the path and other optional modifiers for the /// commit. /// The document to upload + /// 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 @@ -6425,12 +6600,13 @@ public sys.IAsyncResult BeginUploadSessionFinish(UploadSessionFinishArg uploadSe /// cref="UploadSessionFinishError"/>. public t.Task UploadSessionFinishAsync(UploadSessionCursor cursor, CommitInfo commit, - io.Stream body) + io.Stream body, + tr.CancellationToken cancellationToken = default) { var uploadSessionFinishArg = new UploadSessionFinishArg(cursor, commit); - return this.UploadSessionFinishAsync(uploadSessionFinishArg, body); + return this.UploadSessionFinishAsync(uploadSessionFinishArg, body, cancellationToken); } /// @@ -6506,11 +6682,12 @@ public FileMetadata EndUploadSessionFinish(sys.IAsyncResult asyncResult) /// transport limit page. /// /// 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 UploadSessionFinishBatchAsync(UploadSessionFinishBatchArg uploadSessionFinishBatchArg) + public t.Task UploadSessionFinishBatchAsync(UploadSessionFinishBatchArg uploadSessionFinishBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(uploadSessionFinishBatchArg, "api", "/files/upload_session/finish_batch", "user", global::Dropbox.Api.Files.UploadSessionFinishBatchArg.Encoder, global::Dropbox.Api.Files.UploadSessionFinishBatchLaunch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(uploadSessionFinishBatchArg, "api", "/files/upload_session/finish_batch", "user", global::Dropbox.Api.Files.UploadSessionFinishBatchArg.Encoder, global::Dropbox.Api.Files.UploadSessionFinishBatchLaunch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -6557,13 +6734,15 @@ public sys.IAsyncResult BeginUploadSessionFinishBatch(UploadSessionFinishBatchAr /// transport limit page. /// /// Commit information for each file in the batch. + /// 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 UploadSessionFinishBatchAsync(col.IEnumerable entries) + public t.Task UploadSessionFinishBatchAsync(col.IEnumerable entries, + tr.CancellationToken cancellationToken = default) { var uploadSessionFinishBatchArg = new UploadSessionFinishBatchArg(entries); - return this.UploadSessionFinishBatchAsync(uploadSessionFinishBatchArg); + return this.UploadSessionFinishBatchAsync(uploadSessionFinishBatchArg, cancellationToken); } /// @@ -6608,14 +6787,15 @@ public UploadSessionFinishBatchLaunch EndUploadSessionFinishBatch(sys.IAsyncResu /// If success, it returns list of result for each entry. /// /// 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 UploadSessionFinishBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task UploadSessionFinishBatchCheckAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/upload_session/finish_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.UploadSessionFinishBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/files/upload_session/finish_batch/check", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Files.UploadSessionFinishBatchJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -6642,16 +6822,18 @@ public sys.IAsyncResult BeginUploadSessionFinishBatchCheck(global::Dropbox.Api.A /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 UploadSessionFinishBatchCheckAsync(string asyncJobId) + public t.Task UploadSessionFinishBatchCheckAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.UploadSessionFinishBatchCheckAsync(pollArg); + return this.UploadSessionFinishBatchCheckAsync(pollArg, cancellationToken); } /// @@ -6745,14 +6927,15 @@ public UploadSessionFinishBatchJobStatus EndUploadSessionFinishBatchCheck(sys.IA /// /// The request parameters /// The content to upload. + /// 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 UploadSessionStartAsync(UploadSessionStartArg uploadSessionStartArg, io.Stream body) + public t.Task UploadSessionStartAsync(UploadSessionStartArg uploadSessionStartArg, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(uploadSessionStartArg, body, "content", "/files/upload_session/start", "user", global::Dropbox.Api.Files.UploadSessionStartArg.Encoder, global::Dropbox.Api.Files.UploadSessionStartResult.Decoder, global::Dropbox.Api.Files.UploadSessionStartError.Decoder); + return this.Transport.SendUploadRequestAsync(uploadSessionStartArg, body, "content", "/files/upload_session/start", "user", global::Dropbox.Api.Files.UploadSessionStartArg.Encoder, global::Dropbox.Api.Files.UploadSessionStartResult.Decoder, global::Dropbox.Api.Files.UploadSessionStartError.Decoder, cancellationToken); } /// @@ -6828,6 +7011,7 @@ public sys.IAsyncResult BeginUploadSessionStart(UploadSessionStartArg uploadSess /// specified, default is . /// The document to upload + /// 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 @@ -6835,12 +7019,13 @@ public sys.IAsyncResult BeginUploadSessionStart(UploadSessionStartArg uploadSess /// cref="UploadSessionStartError"/>. public t.Task UploadSessionStartAsync(bool close = false, UploadSessionType sessionType = null, - io.Stream body = null) + io.Stream body = null, + tr.CancellationToken cancellationToken = default) { var uploadSessionStartArg = new UploadSessionStartArg(close, sessionType); - return this.UploadSessionStartAsync(uploadSessionStartArg, body); + return this.UploadSessionStartAsync(uploadSessionStartArg, body, cancellationToken); } /// diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Paper/PaperUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Paper/PaperUserRoutes.cs index 5263bcc91c..dce4eed154 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Paper/PaperUserRoutes.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Paper/PaperUserRoutes.cs @@ -8,6 +8,7 @@ namespace Dropbox.Api.Paper.Routes using io = System.IO; using col = System.Collections.Generic; using t = System.Threading.Tasks; + using tr = System.Threading; using enc = Dropbox.Api.Stone; /// @@ -43,14 +44,15 @@ internal PaperUserRoutes(enc.ITransport transport) /// Migration Guide for more information. /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task DocsArchiveAsync(RefPaperDoc refPaperDoc) + public t.Task DocsArchiveAsync(RefPaperDoc refPaperDoc, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/archive", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/archive", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -83,16 +85,18 @@ public sys.IAsyncResult BeginDocsArchive(RefPaperDoc refPaperDoc, sys.AsyncCallb /// Migration Guide for more information. /// /// The Paper doc ID. + /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task DocsArchiveAsync(string docId) + public t.Task DocsArchiveAsync(string docId, + tr.CancellationToken cancellationToken = default) { var refPaperDoc = new RefPaperDoc(docId); - return this.DocsArchiveAsync(refPaperDoc); + return this.DocsArchiveAsync(refPaperDoc, cancellationToken); } /// @@ -145,15 +149,16 @@ public void EndDocsArchive(sys.IAsyncResult asyncResult) /// /// The request parameters /// The content to upload. + /// 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")] - public t.Task DocsCreateAsync(PaperDocCreateArgs paperDocCreateArgs, io.Stream body) + public t.Task DocsCreateAsync(PaperDocCreateArgs paperDocCreateArgs, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(paperDocCreateArgs, body, "api", "/paper/docs/create", "user", global::Dropbox.Api.Paper.PaperDocCreateArgs.Encoder, global::Dropbox.Api.Paper.PaperDocCreateUpdateResult.Decoder, global::Dropbox.Api.Paper.PaperDocCreateError.Decoder); + return this.Transport.SendUploadRequestAsync(paperDocCreateArgs, body, "api", "/paper/docs/create", "user", global::Dropbox.Api.Paper.PaperDocCreateArgs.Encoder, global::Dropbox.Api.Paper.PaperDocCreateUpdateResult.Decoder, global::Dropbox.Api.Paper.PaperDocCreateError.Decoder, cancellationToken); } /// @@ -189,6 +194,7 @@ public sys.IAsyncResult BeginDocsCreate(PaperDocCreateArgs paperDocCreateArgs, i /// created. The API user has to have write access to this folder or error is /// thrown. /// The document to upload + /// 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 @@ -197,12 +203,13 @@ public sys.IAsyncResult BeginDocsCreate(PaperDocCreateArgs paperDocCreateArgs, i [sys.Obsolete("This function is deprecated")] public t.Task DocsCreateAsync(ImportFormat importFormat, string parentFolderId = null, - io.Stream body = null) + io.Stream body = null, + tr.CancellationToken cancellationToken = default) { var paperDocCreateArgs = new PaperDocCreateArgs(importFormat, parentFolderId); - return this.DocsCreateAsync(paperDocCreateArgs, body); + return this.DocsCreateAsync(paperDocCreateArgs, body, cancellationToken); } /// @@ -264,15 +271,16 @@ public PaperDocCreateUpdateResult EndDocsCreate(sys.IAsyncResult asyncResult) /// Migration Guide for migration information. /// /// 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")] - public t.Task> DocsDownloadAsync(PaperDocExport paperDocExport) + public t.Task> DocsDownloadAsync(PaperDocExport paperDocExport, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendDownloadRequestAsync(paperDocExport, "api", "/paper/docs/download", "user", global::Dropbox.Api.Paper.PaperDocExport.Encoder, global::Dropbox.Api.Paper.PaperDocExportResult.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendDownloadRequestAsync(paperDocExport, "api", "/paper/docs/download", "user", global::Dropbox.Api.Paper.PaperDocExport.Encoder, global::Dropbox.Api.Paper.PaperDocExportResult.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -304,6 +312,7 @@ public sys.IAsyncResult BeginDocsDownload(PaperDocExport paperDocExport, sys.Asy /// /// The Paper doc ID. /// The export format + /// 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 @@ -311,12 +320,13 @@ public sys.IAsyncResult BeginDocsDownload(PaperDocExport paperDocExport, sys.Asy /// cref="DocLookupError"/>. [sys.Obsolete("This function is deprecated")] public t.Task> DocsDownloadAsync(string docId, - ExportFormat exportFormat) + ExportFormat exportFormat, + tr.CancellationToken cancellationToken = default) { var paperDocExport = new PaperDocExport(docId, exportFormat); - return this.DocsDownloadAsync(paperDocExport); + return this.DocsDownloadAsync(paperDocExport, cancellationToken); } /// @@ -377,15 +387,16 @@ public enc.IDownloadResponse EndDocsDownload(sys.IAsyncRes /// Migration Guide for migration information. /// /// 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")] - public t.Task DocsFolderUsersListAsync(ListUsersOnFolderArgs listUsersOnFolderArgs) + public t.Task DocsFolderUsersListAsync(ListUsersOnFolderArgs listUsersOnFolderArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listUsersOnFolderArgs, "api", "/paper/docs/folder_users/list", "user", global::Dropbox.Api.Paper.ListUsersOnFolderArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnFolderResponse.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(listUsersOnFolderArgs, "api", "/paper/docs/folder_users/list", "user", global::Dropbox.Api.Paper.ListUsersOnFolderArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnFolderResponse.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -422,6 +433,7 @@ public sys.IAsyncResult BeginDocsFolderUsersList(ListUsersOnFolderArgs listUsers /// Size limit per batch. The maximum number of users that can be /// retrieved per batch is 1000. Higher value results in invalid arguments /// error. + /// 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 @@ -429,12 +441,13 @@ public sys.IAsyncResult BeginDocsFolderUsersList(ListUsersOnFolderArgs listUsers /// cref="DocLookupError"/>. [sys.Obsolete("This function is deprecated")] public t.Task DocsFolderUsersListAsync(string docId, - int limit = 1000) + int limit = 1000, + tr.CancellationToken cancellationToken = default) { var listUsersOnFolderArgs = new ListUsersOnFolderArgs(docId, limit); - return this.DocsFolderUsersListAsync(listUsersOnFolderArgs); + return this.DocsFolderUsersListAsync(listUsersOnFolderArgs, cancellationToken); } /// @@ -496,15 +509,16 @@ public ListUsersOnFolderResponse EndDocsFolderUsersList(sys.IAsyncResult asyncRe /// Migration Guide for migration information. /// /// 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")] - public t.Task DocsFolderUsersListContinueAsync(ListUsersOnFolderContinueArgs listUsersOnFolderContinueArgs) + public t.Task DocsFolderUsersListContinueAsync(ListUsersOnFolderContinueArgs listUsersOnFolderContinueArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listUsersOnFolderContinueArgs, "api", "/paper/docs/folder_users/list/continue", "user", global::Dropbox.Api.Paper.ListUsersOnFolderContinueArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnFolderResponse.Decoder, global::Dropbox.Api.Paper.ListUsersCursorError.Decoder); + return this.Transport.SendRpcRequestAsync(listUsersOnFolderContinueArgs, "api", "/paper/docs/folder_users/list/continue", "user", global::Dropbox.Api.Paper.ListUsersOnFolderContinueArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnFolderResponse.Decoder, global::Dropbox.Api.Paper.ListUsersCursorError.Decoder, cancellationToken); } /// @@ -542,6 +556,7 @@ public sys.IAsyncResult BeginDocsFolderUsersListContinue(ListUsersOnFolderContin /// cref="Dropbox.Api.Paper.Routes.PaperUserRoutes.DocsFolderUsersListAsync" /> or . Allows for pagination. + /// 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 @@ -549,12 +564,13 @@ public sys.IAsyncResult BeginDocsFolderUsersListContinue(ListUsersOnFolderContin /// cref="ListUsersCursorError"/>. [sys.Obsolete("This function is deprecated")] public t.Task DocsFolderUsersListContinueAsync(string docId, - string cursor) + string cursor, + tr.CancellationToken cancellationToken = default) { var listUsersOnFolderContinueArgs = new ListUsersOnFolderContinueArgs(docId, cursor); - return this.DocsFolderUsersListContinueAsync(listUsersOnFolderContinueArgs); + return this.DocsFolderUsersListContinueAsync(listUsersOnFolderContinueArgs, cancellationToken); } /// @@ -623,15 +639,16 @@ public ListUsersOnFolderResponse EndDocsFolderUsersListContinue(sys.IAsyncResult /// Migration Guide for migration information. /// /// 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")] - public t.Task DocsGetFolderInfoAsync(RefPaperDoc refPaperDoc) + public t.Task DocsGetFolderInfoAsync(RefPaperDoc refPaperDoc, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/get_folder_info", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, global::Dropbox.Api.Paper.FoldersContainingPaperDoc.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/get_folder_info", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, global::Dropbox.Api.Paper.FoldersContainingPaperDoc.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -669,17 +686,19 @@ public sys.IAsyncResult BeginDocsGetFolderInfo(RefPaperDoc refPaperDoc, sys.Asyn /// Migration Guide for migration information. /// /// The Paper doc ID. + /// 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")] - public t.Task DocsGetFolderInfoAsync(string docId) + public t.Task DocsGetFolderInfoAsync(string docId, + tr.CancellationToken cancellationToken = default) { var refPaperDoc = new RefPaperDoc(docId); - return this.DocsGetFolderInfoAsync(refPaperDoc); + return this.DocsGetFolderInfoAsync(refPaperDoc, cancellationToken); } /// @@ -736,12 +755,13 @@ public FoldersContainingPaperDoc EndDocsGetFolderInfo(sys.IAsyncResult asyncResu /// Migration Guide for migration information. /// /// 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. [sys.Obsolete("This function is deprecated")] - public t.Task DocsListAsync(ListPaperDocsArgs listPaperDocsArgs) + public t.Task DocsListAsync(ListPaperDocsArgs listPaperDocsArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listPaperDocsArgs, "api", "/paper/docs/list", "user", global::Dropbox.Api.Paper.ListPaperDocsArgs.Encoder, global::Dropbox.Api.Paper.ListPaperDocsResponse.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(listPaperDocsArgs, "api", "/paper/docs/list", "user", global::Dropbox.Api.Paper.ListPaperDocsArgs.Encoder, global::Dropbox.Api.Paper.ListPaperDocsResponse.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -782,20 +802,22 @@ public sys.IAsyncResult BeginDocsList(ListPaperDocsArgs listPaperDocsArgs, sys.A /// Size limit per batch. The maximum number of docs that can be /// retrieved per batch is 1000. Higher value results in invalid arguments /// error. + /// The cancellation token to cancel operation. /// The task that represents the asynchronous send operation. The TResult /// parameter contains the response from the server. [sys.Obsolete("This function is deprecated")] public t.Task DocsListAsync(ListPaperDocsFilterBy filterBy = null, ListPaperDocsSortBy sortBy = null, ListPaperDocsSortOrder sortOrder = null, - int limit = 1000) + int limit = 1000, + tr.CancellationToken cancellationToken = default) { var listPaperDocsArgs = new ListPaperDocsArgs(filterBy, sortBy, sortOrder, limit); - return this.DocsListAsync(listPaperDocsArgs); + return this.DocsListAsync(listPaperDocsArgs, cancellationToken); } /// @@ -863,15 +885,16 @@ public ListPaperDocsResponse EndDocsList(sys.IAsyncResult asyncResult) /// Migration Guide for migration information. /// /// 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")] - public t.Task DocsListContinueAsync(ListPaperDocsContinueArgs listPaperDocsContinueArgs) + public t.Task DocsListContinueAsync(ListPaperDocsContinueArgs listPaperDocsContinueArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listPaperDocsContinueArgs, "api", "/paper/docs/list/continue", "user", global::Dropbox.Api.Paper.ListPaperDocsContinueArgs.Encoder, global::Dropbox.Api.Paper.ListPaperDocsResponse.Decoder, global::Dropbox.Api.Paper.ListDocsCursorError.Decoder); + return this.Transport.SendRpcRequestAsync(listPaperDocsContinueArgs, "api", "/paper/docs/list/continue", "user", global::Dropbox.Api.Paper.ListPaperDocsContinueArgs.Encoder, global::Dropbox.Api.Paper.ListPaperDocsResponse.Decoder, global::Dropbox.Api.Paper.ListDocsCursorError.Decoder, cancellationToken); } /// @@ -907,17 +930,19 @@ public sys.IAsyncResult BeginDocsListContinue(ListPaperDocsContinueArgs listPape /// cref="Dropbox.Api.Paper.Routes.PaperUserRoutes.DocsListAsync" /> or . Allows /// for pagination. + /// 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")] - public t.Task DocsListContinueAsync(string cursor) + public t.Task DocsListContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var listPaperDocsContinueArgs = new ListPaperDocsContinueArgs(cursor); - return this.DocsListContinueAsync(listPaperDocsContinueArgs); + return this.DocsListContinueAsync(listPaperDocsContinueArgs, cancellationToken); } /// @@ -977,14 +1002,15 @@ public ListPaperDocsResponse EndDocsListContinue(sys.IAsyncResult asyncResult) /// Migration Guide for migration information. /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task DocsPermanentlyDeleteAsync(RefPaperDoc refPaperDoc) + public t.Task DocsPermanentlyDeleteAsync(RefPaperDoc refPaperDoc, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/permanently_delete", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/permanently_delete", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -1017,16 +1043,18 @@ public sys.IAsyncResult BeginDocsPermanentlyDelete(RefPaperDoc refPaperDoc, sys. /// Migration Guide for migration information. /// /// The Paper doc ID. + /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task DocsPermanentlyDeleteAsync(string docId) + public t.Task DocsPermanentlyDeleteAsync(string docId, + tr.CancellationToken cancellationToken = default) { var refPaperDoc = new RefPaperDoc(docId); - return this.DocsPermanentlyDeleteAsync(refPaperDoc); + return this.DocsPermanentlyDeleteAsync(refPaperDoc, cancellationToken); } /// @@ -1078,15 +1106,16 @@ public void EndDocsPermanentlyDelete(sys.IAsyncResult asyncResult) /// Migration Guide for migration information. /// /// 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")] - public t.Task DocsSharingPolicyGetAsync(RefPaperDoc refPaperDoc) + public t.Task DocsSharingPolicyGetAsync(RefPaperDoc refPaperDoc, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/sharing_policy/get", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, global::Dropbox.Api.Paper.SharingPolicy.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(refPaperDoc, "api", "/paper/docs/sharing_policy/get", "user", global::Dropbox.Api.Paper.RefPaperDoc.Encoder, global::Dropbox.Api.Paper.SharingPolicy.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -1117,17 +1146,19 @@ public sys.IAsyncResult BeginDocsSharingPolicyGet(RefPaperDoc refPaperDoc, sys.A /// Migration Guide for migration information. /// /// The Paper doc ID. + /// 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")] - public t.Task DocsSharingPolicyGetAsync(string docId) + public t.Task DocsSharingPolicyGetAsync(string docId, + tr.CancellationToken cancellationToken = default) { var refPaperDoc = new RefPaperDoc(docId); - return this.DocsSharingPolicyGetAsync(refPaperDoc); + return this.DocsSharingPolicyGetAsync(refPaperDoc, cancellationToken); } /// @@ -1186,14 +1217,15 @@ public SharingPolicy EndDocsSharingPolicyGet(sys.IAsyncResult asyncResult) /// Migration Guide for migration information. /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task DocsSharingPolicySetAsync(PaperDocSharingPolicy paperDocSharingPolicy) + public t.Task DocsSharingPolicySetAsync(PaperDocSharingPolicy paperDocSharingPolicy, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(paperDocSharingPolicy, "api", "/paper/docs/sharing_policy/set", "user", global::Dropbox.Api.Paper.PaperDocSharingPolicy.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(paperDocSharingPolicy, "api", "/paper/docs/sharing_policy/set", "user", global::Dropbox.Api.Paper.PaperDocSharingPolicy.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -1230,18 +1262,20 @@ public sys.IAsyncResult BeginDocsSharingPolicySet(PaperDocSharingPolicy paperDoc /// The Paper doc ID. /// The default sharing policy to be set for the Paper /// doc. + /// 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 . [sys.Obsolete("This function is deprecated")] public t.Task DocsSharingPolicySetAsync(string docId, - SharingPolicy sharingPolicy) + SharingPolicy sharingPolicy, + tr.CancellationToken cancellationToken = default) { var paperDocSharingPolicy = new PaperDocSharingPolicy(docId, sharingPolicy); - return this.DocsSharingPolicySetAsync(paperDocSharingPolicy); + return this.DocsSharingPolicySetAsync(paperDocSharingPolicy, cancellationToken); } /// @@ -1298,15 +1332,16 @@ public void EndDocsSharingPolicySet(sys.IAsyncResult asyncResult) /// /// The request parameters /// The content to upload. + /// 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")] - public t.Task DocsUpdateAsync(PaperDocUpdateArgs paperDocUpdateArgs, io.Stream body) + public t.Task DocsUpdateAsync(PaperDocUpdateArgs paperDocUpdateArgs, io.Stream body, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendUploadRequestAsync(paperDocUpdateArgs, body, "api", "/paper/docs/update", "user", global::Dropbox.Api.Paper.PaperDocUpdateArgs.Encoder, global::Dropbox.Api.Paper.PaperDocCreateUpdateResult.Decoder, global::Dropbox.Api.Paper.PaperDocUpdateError.Decoder); + return this.Transport.SendUploadRequestAsync(paperDocUpdateArgs, body, "api", "/paper/docs/update", "user", global::Dropbox.Api.Paper.PaperDocUpdateArgs.Encoder, global::Dropbox.Api.Paper.PaperDocCreateUpdateResult.Decoder, global::Dropbox.Api.Paper.PaperDocUpdateError.Decoder, cancellationToken); } /// @@ -1344,6 +1379,7 @@ public sys.IAsyncResult BeginDocsUpdate(PaperDocUpdateArgs paperDocUpdateArgs, i /// writes. /// The format of provided data. /// The document to upload + /// 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 @@ -1354,14 +1390,15 @@ public t.Task DocsUpdateAsync(string docId, PaperDocUpdatePolicy docUpdatePolicy, long revision, ImportFormat importFormat, - io.Stream body) + io.Stream body, + tr.CancellationToken cancellationToken = default) { var paperDocUpdateArgs = new PaperDocUpdateArgs(docId, docUpdatePolicy, revision, importFormat); - return this.DocsUpdateAsync(paperDocUpdateArgs, body); + return this.DocsUpdateAsync(paperDocUpdateArgs, body, cancellationToken); } /// @@ -1431,15 +1468,16 @@ public PaperDocCreateUpdateResult EndDocsUpdate(sys.IAsyncResult asyncResult) /// Migration Guide for migration information. /// /// 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")] - public t.Task> DocsUsersAddAsync(AddPaperDocUser addPaperDocUser) + public t.Task> DocsUsersAddAsync(AddPaperDocUser addPaperDocUser, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, DocLookupError>(addPaperDocUser, "api", "/paper/docs/users/add", "user", global::Dropbox.Api.Paper.AddPaperDocUser.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Paper.AddPaperDocUserMemberResult.Decoder), global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync, DocLookupError>(addPaperDocUser, "api", "/paper/docs/users/add", "user", global::Dropbox.Api.Paper.AddPaperDocUser.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Paper.AddPaperDocUserMemberResult.Decoder), global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -1478,6 +1516,7 @@ public sys.IAsyncResult BeginDocsUsersAdd(AddPaperDocUser addPaperDocUser, sys.A /// successfully added member. /// Clients should set this to true if no email message shall be /// sent to added users. + /// 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 @@ -1487,14 +1526,15 @@ public sys.IAsyncResult BeginDocsUsersAdd(AddPaperDocUser addPaperDocUser, sys.A public t.Task> DocsUsersAddAsync(string docId, col.IEnumerable members, string customMessage = null, - bool quiet = false) + bool quiet = false, + tr.CancellationToken cancellationToken = default) { var addPaperDocUser = new AddPaperDocUser(docId, members, customMessage, quiet); - return this.DocsUsersAddAsync(addPaperDocUser); + return this.DocsUsersAddAsync(addPaperDocUser, cancellationToken); } /// @@ -1565,15 +1605,16 @@ public col.List EndDocsUsersAdd(sys.IAsyncResult as /// Migration Guide for migration information. /// /// 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")] - public t.Task DocsUsersListAsync(ListUsersOnPaperDocArgs listUsersOnPaperDocArgs) + public t.Task DocsUsersListAsync(ListUsersOnPaperDocArgs listUsersOnPaperDocArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listUsersOnPaperDocArgs, "api", "/paper/docs/users/list", "user", global::Dropbox.Api.Paper.ListUsersOnPaperDocArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnPaperDocResponse.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(listUsersOnPaperDocArgs, "api", "/paper/docs/users/list", "user", global::Dropbox.Api.Paper.ListUsersOnPaperDocArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnPaperDocResponse.Decoder, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -1613,6 +1654,7 @@ public sys.IAsyncResult BeginDocsUsersList(ListUsersOnPaperDocArgs listUsersOnPa /// error. /// Specify this attribute if you want to obtain users that have /// already accessed the Paper doc. + /// 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 @@ -1621,13 +1663,14 @@ public sys.IAsyncResult BeginDocsUsersList(ListUsersOnPaperDocArgs listUsersOnPa [sys.Obsolete("This function is deprecated")] public t.Task DocsUsersListAsync(string docId, int limit = 1000, - UserOnPaperDocFilter filterBy = null) + UserOnPaperDocFilter filterBy = null, + tr.CancellationToken cancellationToken = default) { var listUsersOnPaperDocArgs = new ListUsersOnPaperDocArgs(docId, limit, filterBy); - return this.DocsUsersListAsync(listUsersOnPaperDocArgs); + return this.DocsUsersListAsync(listUsersOnPaperDocArgs, cancellationToken); } /// @@ -1693,15 +1736,16 @@ public ListUsersOnPaperDocResponse EndDocsUsersList(sys.IAsyncResult asyncResult /// Migration Guide for migration information. /// /// 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")] - public t.Task DocsUsersListContinueAsync(ListUsersOnPaperDocContinueArgs listUsersOnPaperDocContinueArgs) + public t.Task DocsUsersListContinueAsync(ListUsersOnPaperDocContinueArgs listUsersOnPaperDocContinueArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listUsersOnPaperDocContinueArgs, "api", "/paper/docs/users/list/continue", "user", global::Dropbox.Api.Paper.ListUsersOnPaperDocContinueArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnPaperDocResponse.Decoder, global::Dropbox.Api.Paper.ListUsersCursorError.Decoder); + return this.Transport.SendRpcRequestAsync(listUsersOnPaperDocContinueArgs, "api", "/paper/docs/users/list/continue", "user", global::Dropbox.Api.Paper.ListUsersOnPaperDocContinueArgs.Encoder, global::Dropbox.Api.Paper.ListUsersOnPaperDocResponse.Decoder, global::Dropbox.Api.Paper.ListUsersCursorError.Decoder, cancellationToken); } /// @@ -1738,6 +1782,7 @@ public sys.IAsyncResult BeginDocsUsersListContinue(ListUsersOnPaperDocContinueAr /// cref="Dropbox.Api.Paper.Routes.PaperUserRoutes.DocsUsersListAsync" /> or . /// Allows for pagination. + /// 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 @@ -1745,12 +1790,13 @@ public sys.IAsyncResult BeginDocsUsersListContinue(ListUsersOnPaperDocContinueAr /// cref="ListUsersCursorError"/>. [sys.Obsolete("This function is deprecated")] public t.Task DocsUsersListContinueAsync(string docId, - string cursor) + string cursor, + tr.CancellationToken cancellationToken = default) { var listUsersOnPaperDocContinueArgs = new ListUsersOnPaperDocContinueArgs(docId, cursor); - return this.DocsUsersListContinueAsync(listUsersOnPaperDocContinueArgs); + return this.DocsUsersListContinueAsync(listUsersOnPaperDocContinueArgs, cancellationToken); } /// @@ -1813,14 +1859,15 @@ public ListUsersOnPaperDocResponse EndDocsUsersListContinue(sys.IAsyncResult asy /// Migration Guide for migration information. /// /// 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 . [sys.Obsolete("This function is deprecated")] - public t.Task DocsUsersRemoveAsync(RemovePaperDocUser removePaperDocUser) + public t.Task DocsUsersRemoveAsync(RemovePaperDocUser removePaperDocUser, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(removePaperDocUser, "api", "/paper/docs/users/remove", "user", global::Dropbox.Api.Paper.RemovePaperDocUser.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder); + return this.Transport.SendRpcRequestAsync(removePaperDocUser, "api", "/paper/docs/users/remove", "user", global::Dropbox.Api.Paper.RemovePaperDocUser.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Paper.DocLookupError.Decoder, cancellationToken); } /// @@ -1855,18 +1902,20 @@ public sys.IAsyncResult BeginDocsUsersRemove(RemovePaperDocUser removePaperDocUs /// The Paper doc ID. /// User which should be removed from the Paper doc. Specify only /// email address or Dropbox account ID. + /// 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 . [sys.Obsolete("This function is deprecated")] public t.Task DocsUsersRemoveAsync(string docId, - global::Dropbox.Api.Sharing.MemberSelector member) + global::Dropbox.Api.Sharing.MemberSelector member, + tr.CancellationToken cancellationToken = default) { var removePaperDocUser = new RemovePaperDocUser(docId, member); - return this.DocsUsersRemoveAsync(removePaperDocUser); + return this.DocsUsersRemoveAsync(removePaperDocUser, cancellationToken); } /// @@ -1922,15 +1971,16 @@ public void EndDocsUsersRemove(sys.IAsyncResult asyncResult) /// Migration Guide for migration information. /// /// 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")] - public t.Task FoldersCreateAsync(PaperFolderCreateArg paperFolderCreateArg) + public t.Task FoldersCreateAsync(PaperFolderCreateArg paperFolderCreateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(paperFolderCreateArg, "api", "/paper/folders/create", "user", global::Dropbox.Api.Paper.PaperFolderCreateArg.Encoder, global::Dropbox.Api.Paper.PaperFolderCreateResult.Decoder, global::Dropbox.Api.Paper.PaperFolderCreateError.Decoder); + return this.Transport.SendRpcRequestAsync(paperFolderCreateArg, "api", "/paper/folders/create", "user", global::Dropbox.Api.Paper.PaperFolderCreateArg.Encoder, global::Dropbox.Api.Paper.PaperFolderCreateResult.Decoder, global::Dropbox.Api.Paper.PaperFolderCreateError.Decoder, cancellationToken); } /// @@ -1970,6 +2020,7 @@ public sys.IAsyncResult BeginFoldersCreate(PaperFolderCreateArg paperFolderCreat /// folder will inherit the type (private or team folder) from its parent. We will by /// default create a top-level private folder if both parent_folder_id and /// is_team_folder are not supplied. + /// 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 @@ -1978,13 +2029,14 @@ public sys.IAsyncResult BeginFoldersCreate(PaperFolderCreateArg paperFolderCreat [sys.Obsolete("This function is deprecated")] public t.Task FoldersCreateAsync(string name, string parentFolderId = null, - bool? isTeamFolder = null) + bool? isTeamFolder = null, + tr.CancellationToken cancellationToken = default) { var paperFolderCreateArg = new PaperFolderCreateArg(name, parentFolderId, isTeamFolder); - return this.FoldersCreateAsync(paperFolderCreateArg); + return this.FoldersCreateAsync(paperFolderCreateArg, cancellationToken); } /// diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Sharing/SharingUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Sharing/SharingUserRoutes.cs index 5bfd648d7a..e42680bcb4 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Sharing/SharingUserRoutes.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Sharing/SharingUserRoutes.cs @@ -8,6 +8,7 @@ namespace Dropbox.Api.Sharing.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 SharingUserRoutes(enc.ITransport transport) /// Adds specified members to 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> AddFileMemberAsync(AddFileMemberArgs addFileMemberArgs) + public t.Task> AddFileMemberAsync(AddFileMemberArgs addFileMemberArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, AddFileMemberError>(addFileMemberArgs, "api", "/sharing/add_file_member", "user", global::Dropbox.Api.Sharing.AddFileMemberArgs.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Sharing.FileMemberActionResult.Decoder), global::Dropbox.Api.Sharing.AddFileMemberError.Decoder); + return this.Transport.SendRpcRequestAsync, AddFileMemberError>(addFileMemberArgs, "api", "/sharing/add_file_member", "user", global::Dropbox.Api.Sharing.AddFileMemberArgs.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Sharing.FileMemberActionResult.Decoder), global::Dropbox.Api.Sharing.AddFileMemberError.Decoder, cancellationToken); } /// @@ -75,6 +77,7 @@ public sys.IAsyncResult BeginAddFileMember(AddFileMemberArgs addFileMemberArgs, /// want to give new members. /// If the custom message should be added as a /// comment on the file. + /// 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 @@ -85,7 +88,8 @@ public sys.IAsyncResult BeginAddFileMember(AddFileMemberArgs addFileMemberArgs, string customMessage = null, bool quiet = false, AccessLevel accessLevel = null, - bool addMessageAsComment = false) + bool addMessageAsComment = false, + tr.CancellationToken cancellationToken = default) { var addFileMemberArgs = new AddFileMemberArgs(file, members, @@ -94,7 +98,7 @@ public sys.IAsyncResult BeginAddFileMember(AddFileMemberArgs addFileMemberArgs, accessLevel, addMessageAsComment); - return this.AddFileMemberAsync(addFileMemberArgs); + return this.AddFileMemberAsync(addFileMemberArgs, cancellationToken); } /// @@ -166,13 +170,14 @@ public col.List EndAddFileMember(sys.IAsyncResult asyncR /// behalf. /// /// 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 AddFolderMemberAsync(AddFolderMemberArg addFolderMemberArg) + public t.Task AddFolderMemberAsync(AddFolderMemberArg addFolderMemberArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(addFolderMemberArg, "api", "/sharing/add_folder_member", "user", global::Dropbox.Api.Sharing.AddFolderMemberArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.AddFolderMemberError.Decoder); + return this.Transport.SendRpcRequestAsync(addFolderMemberArg, "api", "/sharing/add_folder_member", "user", global::Dropbox.Api.Sharing.AddFolderMemberArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.AddFolderMemberError.Decoder, cancellationToken); } /// @@ -206,6 +211,7 @@ public sys.IAsyncResult BeginAddFolderMember(AddFolderMemberArg addFolderMemberA /// notifications of their invite. /// Optional message to display to added members in their /// invitation. + /// 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 members, bool quiet = false, - string customMessage = null) + string customMessage = null, + tr.CancellationToken cancellationToken = default) { var addFolderMemberArg = new AddFolderMemberArg(sharedFolderId, members, quiet, customMessage); - return this.AddFolderMemberAsync(addFolderMemberArg); + return this.AddFolderMemberAsync(addFolderMemberArg, cancellationToken); } /// @@ -275,15 +282,16 @@ public void EndAddFolderMember(sys.IAsyncResult asyncResult) /// Identical to update_file_member but with less information returned. /// /// 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 UpdateFileMemberAsync instead.")] - public t.Task ChangeFileMemberAccessAsync(ChangeFileMemberAccessArgs changeFileMemberAccessArgs) + public t.Task ChangeFileMemberAccessAsync(ChangeFileMemberAccessArgs changeFileMemberAccessArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(changeFileMemberAccessArgs, "api", "/sharing/change_file_member_access", "user", global::Dropbox.Api.Sharing.ChangeFileMemberAccessArgs.Encoder, global::Dropbox.Api.Sharing.FileMemberActionResult.Decoder, global::Dropbox.Api.Sharing.FileMemberActionError.Decoder); + return this.Transport.SendRpcRequestAsync(changeFileMemberAccessArgs, "api", "/sharing/change_file_member_access", "user", global::Dropbox.Api.Sharing.ChangeFileMemberAccessArgs.Encoder, global::Dropbox.Api.Sharing.FileMemberActionResult.Decoder, global::Dropbox.Api.Sharing.FileMemberActionError.Decoder, cancellationToken); } /// @@ -309,6 +317,7 @@ public sys.IAsyncResult BeginChangeFileMemberAccess(ChangeFileMemberAccessArgs c /// File for which we are changing a member's access. /// The member whose access we are changing. /// The new access level for the member. + /// 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 @@ -317,13 +326,14 @@ public sys.IAsyncResult BeginChangeFileMemberAccess(ChangeFileMemberAccessArgs c [sys.Obsolete("This function is deprecated, please use UpdateFileMemberAsync instead.")] public t.Task ChangeFileMemberAccessAsync(string file, MemberSelector member, - AccessLevel accessLevel) + AccessLevel accessLevel, + tr.CancellationToken cancellationToken = default) { var changeFileMemberAccessArgs = new ChangeFileMemberAccessArgs(file, member, accessLevel); - return this.ChangeFileMemberAccessAsync(changeFileMemberAccessArgs); + return this.ChangeFileMemberAccessAsync(changeFileMemberAccessArgs, cancellationToken); } /// @@ -377,14 +387,15 @@ public FileMemberActionResult EndChangeFileMemberAccess(sys.IAsyncResult asyncRe /// Returns the status of an asynchronous job. /// /// 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 CheckJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task CheckJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/sharing/check_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Sharing.JobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/sharing/check_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Sharing.JobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -408,16 +419,18 @@ public sys.IAsyncResult BeginCheckJobStatus(global::Dropbox.Api.Async.PollArg po /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 CheckJobStatusAsync(string asyncJobId) + public t.Task CheckJobStatusAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.CheckJobStatusAsync(pollArg); + return this.CheckJobStatusAsync(pollArg, cancellationToken); } /// @@ -464,14 +477,15 @@ public JobStatus EndCheckJobStatus(sys.IAsyncResult asyncResult) /// Returns the status of an asynchronous job for sharing a 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 CheckRemoveMemberJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task CheckRemoveMemberJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/sharing/check_remove_member_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Sharing.RemoveMemberJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/sharing/check_remove_member_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Sharing.RemoveMemberJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -496,16 +510,18 @@ public sys.IAsyncResult BeginCheckRemoveMemberJobStatus(global::Dropbox.Api.Asyn /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 CheckRemoveMemberJobStatusAsync(string asyncJobId) + public t.Task CheckRemoveMemberJobStatusAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.CheckRemoveMemberJobStatusAsync(pollArg); + return this.CheckRemoveMemberJobStatusAsync(pollArg, cancellationToken); } /// @@ -553,14 +569,15 @@ public RemoveMemberJobStatus EndCheckRemoveMemberJobStatus(sys.IAsyncResult asyn /// Returns the status of an asynchronous job for sharing a 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 CheckShareJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task CheckShareJobStatusAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/sharing/check_share_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Sharing.ShareFolderJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/sharing/check_share_job_status", "user", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Sharing.ShareFolderJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -584,16 +601,18 @@ public sys.IAsyncResult BeginCheckShareJobStatus(global::Dropbox.Api.Async.PollA /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 CheckShareJobStatusAsync(string asyncJobId) + public t.Task CheckShareJobStatusAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.CheckShareJobStatusAsync(pollArg); + return this.CheckShareJobStatusAsync(pollArg, cancellationToken); } /// @@ -652,15 +671,16 @@ public ShareFolderJobStatus EndCheckShareJobStatus(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 . [sys.Obsolete("This function is deprecated, please use CreateSharedLinkWithSettingsAsync instead.")] - public t.Task CreateSharedLinkAsync(CreateSharedLinkArg createSharedLinkArg) + public t.Task CreateSharedLinkAsync(CreateSharedLinkArg createSharedLinkArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(createSharedLinkArg, "api", "/sharing/create_shared_link", "user", global::Dropbox.Api.Sharing.CreateSharedLinkArg.Encoder, global::Dropbox.Api.Sharing.PathLinkMetadata.Decoder, global::Dropbox.Api.Sharing.CreateSharedLinkError.Decoder); + return this.Transport.SendRpcRequestAsync(createSharedLinkArg, "api", "/sharing/create_shared_link", "user", global::Dropbox.Api.Sharing.CreateSharedLinkArg.Encoder, global::Dropbox.Api.Sharing.PathLinkMetadata.Decoder, global::Dropbox.Api.Sharing.CreateSharedLinkError.Decoder, cancellationToken); } /// @@ -701,6 +721,7 @@ public sys.IAsyncResult BeginCreateSharedLink(CreateSharedLinkArg createSharedLi /// set this to either or /// to indicate whether to /// assume it's a file or 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 @@ -709,13 +730,14 @@ public sys.IAsyncResult BeginCreateSharedLink(CreateSharedLinkArg createSharedLi [sys.Obsolete("This function is deprecated, please use CreateSharedLinkWithSettingsAsync instead.")] public t.Task CreateSharedLinkAsync(string path, bool shortUrl = false, - PendingUploadMode pendingUpload = null) + PendingUploadMode pendingUpload = null, + tr.CancellationToken cancellationToken = default) { var createSharedLinkArg = new CreateSharedLinkArg(path, shortUrl, pendingUpload); - return this.CreateSharedLinkAsync(createSharedLinkArg); + return this.CreateSharedLinkAsync(createSharedLinkArg, cancellationToken); } /// @@ -775,14 +797,15 @@ public PathLinkMetadata EndCreateSharedLink(sys.IAsyncResult asyncResult) /// shared folder settings). /// /// 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 CreateSharedLinkWithSettingsAsync(CreateSharedLinkWithSettingsArg createSharedLinkWithSettingsArg) + public t.Task CreateSharedLinkWithSettingsAsync(CreateSharedLinkWithSettingsArg createSharedLinkWithSettingsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(createSharedLinkWithSettingsArg, "api", "/sharing/create_shared_link_with_settings", "user", global::Dropbox.Api.Sharing.CreateSharedLinkWithSettingsArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.CreateSharedLinkWithSettingsError.Decoder); + return this.Transport.SendRpcRequestAsync(createSharedLinkWithSettingsArg, "api", "/sharing/create_shared_link_with_settings", "user", global::Dropbox.Api.Sharing.CreateSharedLinkWithSettingsArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.CreateSharedLinkWithSettingsError.Decoder, cancellationToken); } /// @@ -811,18 +834,20 @@ public sys.IAsyncResult BeginCreateSharedLinkWithSettings(CreateSharedLinkWithSe /// The path to be shared by the shared link. /// The requested settings for the newly created shared /// link. + /// 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 CreateSharedLinkWithSettingsAsync(string path, - SharedLinkSettings settings = null) + SharedLinkSettings settings = null, + tr.CancellationToken cancellationToken = default) { var createSharedLinkWithSettingsArg = new CreateSharedLinkWithSettingsArg(path, settings); - return this.CreateSharedLinkWithSettingsAsync(createSharedLinkWithSettingsArg); + return this.CreateSharedLinkWithSettingsAsync(createSharedLinkWithSettingsArg, cancellationToken); } /// @@ -873,14 +898,15 @@ public SharedLinkMetadata EndCreateSharedLinkWithSettings(sys.IAsyncResult async /// Returns shared file metadata. /// /// 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 GetFileMetadataAsync(GetFileMetadataArg getFileMetadataArg) + public t.Task GetFileMetadataAsync(GetFileMetadataArg getFileMetadataArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getFileMetadataArg, "api", "/sharing/get_file_metadata", "user", global::Dropbox.Api.Sharing.GetFileMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedFileMetadata.Decoder, global::Dropbox.Api.Sharing.GetFileMetadataError.Decoder); + return this.Transport.SendRpcRequestAsync(getFileMetadataArg, "api", "/sharing/get_file_metadata", "user", global::Dropbox.Api.Sharing.GetFileMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedFileMetadata.Decoder, global::Dropbox.Api.Sharing.GetFileMetadataError.Decoder, cancellationToken); } /// @@ -907,18 +933,20 @@ public sys.IAsyncResult BeginGetFileMetadata(GetFileMetadataArg getFileMetadataA /// that should appear in the response's field describing the /// actions the authenticated user can perform on the file. + /// 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 GetFileMetadataAsync(string file, - col.IEnumerable actions = null) + col.IEnumerable actions = null, + tr.CancellationToken cancellationToken = default) { var getFileMetadataArg = new GetFileMetadataArg(file, actions); - return this.GetFileMetadataAsync(getFileMetadataArg); + return this.GetFileMetadataAsync(getFileMetadataArg, cancellationToken); } /// @@ -970,14 +998,15 @@ public SharedFileMetadata EndGetFileMetadata(sys.IAsyncResult asyncResult) /// Returns shared file metadata. /// /// 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> GetFileMetadataBatchAsync(GetFileMetadataBatchArg getFileMetadataBatchArg) + public t.Task> GetFileMetadataBatchAsync(GetFileMetadataBatchArg getFileMetadataBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, SharingUserError>(getFileMetadataBatchArg, "api", "/sharing/get_file_metadata/batch", "user", global::Dropbox.Api.Sharing.GetFileMetadataBatchArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Sharing.GetFileMetadataBatchResult.Decoder), global::Dropbox.Api.Sharing.SharingUserError.Decoder); + return this.Transport.SendRpcRequestAsync, SharingUserError>(getFileMetadataBatchArg, "api", "/sharing/get_file_metadata/batch", "user", global::Dropbox.Api.Sharing.GetFileMetadataBatchArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Sharing.GetFileMetadataBatchResult.Decoder), global::Dropbox.Api.Sharing.SharingUserError.Decoder, cancellationToken); } /// @@ -1004,18 +1033,20 @@ public sys.IAsyncResult BeginGetFileMetadataBatch(GetFileMetadataBatchArg getFil /// that should appear in the response's field describing the /// actions the authenticated user can perform on the file. + /// 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> GetFileMetadataBatchAsync(col.IEnumerable files, - col.IEnumerable actions = null) + col.IEnumerable actions = null, + tr.CancellationToken cancellationToken = default) { var getFileMetadataBatchArg = new GetFileMetadataBatchArg(files, actions); - return this.GetFileMetadataBatchAsync(getFileMetadataBatchArg); + return this.GetFileMetadataBatchAsync(getFileMetadataBatchArg, cancellationToken); } /// @@ -1067,14 +1098,15 @@ public col.List EndGetFileMetadataBatch(sys.IAsyncRe /// Returns shared folder metadata by its folder ID. /// /// 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 GetFolderMetadataAsync(GetMetadataArgs getMetadataArgs) + public t.Task GetFolderMetadataAsync(GetMetadataArgs getMetadataArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getMetadataArgs, "api", "/sharing/get_folder_metadata", "user", global::Dropbox.Api.Sharing.GetMetadataArgs.Encoder, global::Dropbox.Api.Sharing.SharedFolderMetadata.Decoder, global::Dropbox.Api.Sharing.SharedFolderAccessError.Decoder); + return this.Transport.SendRpcRequestAsync(getMetadataArgs, "api", "/sharing/get_folder_metadata", "user", global::Dropbox.Api.Sharing.GetMetadataArgs.Encoder, global::Dropbox.Api.Sharing.SharedFolderMetadata.Decoder, global::Dropbox.Api.Sharing.SharedFolderAccessError.Decoder, cancellationToken); } /// @@ -1101,18 +1133,20 @@ public sys.IAsyncResult BeginGetFolderMetadata(GetMetadataArgs getMetadataArgs, /// `FolderPermission`s that should appear in the response's field describing the /// actions the authenticated user can perform on the 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 GetFolderMetadataAsync(string sharedFolderId, - col.IEnumerable actions = null) + col.IEnumerable actions = null, + tr.CancellationToken cancellationToken = default) { var getMetadataArgs = new GetMetadataArgs(sharedFolderId, actions); - return this.GetFolderMetadataAsync(getMetadataArgs); + return this.GetFolderMetadataAsync(getMetadataArgs, cancellationToken); } /// @@ -1164,14 +1198,15 @@ public SharedFolderMetadata EndGetFolderMetadata(sys.IAsyncResult asyncResult) /// Download the shared link's file from a user's Dropbox. /// /// 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> GetSharedLinkFileAsync(GetSharedLinkMetadataArg getSharedLinkMetadataArg) + public t.Task> GetSharedLinkFileAsync(GetSharedLinkMetadataArg getSharedLinkMetadataArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendDownloadRequestAsync(getSharedLinkMetadataArg, "content", "/sharing/get_shared_link_file", "user", global::Dropbox.Api.Sharing.GetSharedLinkMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.GetSharedLinkFileError.Decoder); + return this.Transport.SendDownloadRequestAsync(getSharedLinkMetadataArg, "content", "/sharing/get_shared_link_file", "user", global::Dropbox.Api.Sharing.GetSharedLinkMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.GetSharedLinkFileError.Decoder, cancellationToken); } /// @@ -1199,6 +1234,7 @@ public sys.IAsyncResult BeginGetSharedLinkFile(GetSharedLinkMetadataArg getShare /// path should be used. /// If the shared link has a password, this parameter can be /// used. + /// 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 @@ -1206,13 +1242,14 @@ public sys.IAsyncResult BeginGetSharedLinkFile(GetSharedLinkMetadataArg getShare /// cref="GetSharedLinkFileError"/>. public t.Task> GetSharedLinkFileAsync(string url, string path = null, - string linkPassword = null) + string linkPassword = null, + tr.CancellationToken cancellationToken = default) { var getSharedLinkMetadataArg = new GetSharedLinkMetadataArg(url, path, linkPassword); - return this.GetSharedLinkFileAsync(getSharedLinkMetadataArg); + return this.GetSharedLinkFileAsync(getSharedLinkMetadataArg, cancellationToken); } /// @@ -1267,14 +1304,15 @@ public enc.IDownloadResponse EndGetSharedLinkFile(sys.IAsync /// Get the shared link's metadata. /// /// 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 GetSharedLinkMetadataAsync(GetSharedLinkMetadataArg getSharedLinkMetadataArg) + public t.Task GetSharedLinkMetadataAsync(GetSharedLinkMetadataArg getSharedLinkMetadataArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getSharedLinkMetadataArg, "api", "/sharing/get_shared_link_metadata", "user", global::Dropbox.Api.Sharing.GetSharedLinkMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.SharedLinkError.Decoder); + return this.Transport.SendRpcRequestAsync(getSharedLinkMetadataArg, "api", "/sharing/get_shared_link_metadata", "user", global::Dropbox.Api.Sharing.GetSharedLinkMetadataArg.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.SharedLinkError.Decoder, cancellationToken); } /// @@ -1302,6 +1340,7 @@ public sys.IAsyncResult BeginGetSharedLinkMetadata(GetSharedLinkMetadataArg getS /// path should be used. /// If the shared link has a password, this parameter can be /// used. + /// 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 @@ -1309,13 +1348,14 @@ public sys.IAsyncResult BeginGetSharedLinkMetadata(GetSharedLinkMetadataArg getS /// cref="SharedLinkError"/>. public t.Task GetSharedLinkMetadataAsync(string url, string path = null, - string linkPassword = null) + string linkPassword = null, + tr.CancellationToken cancellationToken = default) { var getSharedLinkMetadataArg = new GetSharedLinkMetadataArg(url, path, linkPassword); - return this.GetSharedLinkMetadataAsync(getSharedLinkMetadataArg); + return this.GetSharedLinkMetadataAsync(getSharedLinkMetadataArg, cancellationToken); } /// @@ -1376,15 +1416,16 @@ public SharedLinkMetadata EndGetSharedLinkMetadata(sys.IAsyncResult asyncResult) /// Note that the url field in the response is never the shortened URL. /// /// 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 ListSharedLinksAsync instead.")] - public t.Task GetSharedLinksAsync(GetSharedLinksArg getSharedLinksArg) + public t.Task GetSharedLinksAsync(GetSharedLinksArg getSharedLinksArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getSharedLinksArg, "api", "/sharing/get_shared_links", "user", global::Dropbox.Api.Sharing.GetSharedLinksArg.Encoder, global::Dropbox.Api.Sharing.GetSharedLinksResult.Decoder, global::Dropbox.Api.Sharing.GetSharedLinksError.Decoder); + return this.Transport.SendRpcRequestAsync(getSharedLinksArg, "api", "/sharing/get_shared_links", "user", global::Dropbox.Api.Sharing.GetSharedLinksArg.Encoder, global::Dropbox.Api.Sharing.GetSharedLinksResult.Decoder, global::Dropbox.Api.Sharing.GetSharedLinksError.Decoder, cancellationToken); } /// @@ -1416,17 +1457,19 @@ public sys.IAsyncResult BeginGetSharedLinks(GetSharedLinksArg getSharedLinksArg, /// See /// 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 . [sys.Obsolete("This function is deprecated, please use ListSharedLinksAsync instead.")] - public t.Task GetSharedLinksAsync(string path = null) + public t.Task GetSharedLinksAsync(string path = null, + tr.CancellationToken cancellationToken = default) { var getSharedLinksArg = new GetSharedLinksArg(path); - return this.GetSharedLinksAsync(getSharedLinksArg); + return this.GetSharedLinksAsync(getSharedLinksArg, cancellationToken); } /// @@ -1477,14 +1520,15 @@ public GetSharedLinksResult EndGetSharedLinks(sys.IAsyncResult asyncResult) /// uninherited members. /// /// 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 ListFileMembersAsync(ListFileMembersArg listFileMembersArg) + public t.Task ListFileMembersAsync(ListFileMembersArg listFileMembersArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFileMembersArg, "api", "/sharing/list_file_members", "user", global::Dropbox.Api.Sharing.ListFileMembersArg.Encoder, global::Dropbox.Api.Sharing.SharedFileMembers.Decoder, global::Dropbox.Api.Sharing.ListFileMembersError.Decoder); + return this.Transport.SendRpcRequestAsync(listFileMembersArg, "api", "/sharing/list_file_members", "user", global::Dropbox.Api.Sharing.ListFileMembersArg.Encoder, global::Dropbox.Api.Sharing.SharedFileMembers.Decoder, global::Dropbox.Api.Sharing.ListFileMembersError.Decoder, cancellationToken); } /// @@ -1514,6 +1558,7 @@ public sys.IAsyncResult BeginListFileMembers(ListFileMembersArg listFileMembersA /// a parent shared folder. /// Number of members to return max per query. Defaults to 100 if /// no limit is specified. + /// 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 @@ -1522,14 +1567,15 @@ public sys.IAsyncResult BeginListFileMembers(ListFileMembersArg listFileMembersA public t.Task ListFileMembersAsync(string file, col.IEnumerable actions = null, bool includeInherited = true, - uint limit = 100) + uint limit = 100, + tr.CancellationToken cancellationToken = default) { var listFileMembersArg = new ListFileMembersArg(file, actions, includeInherited, limit); - return this.ListFileMembersAsync(listFileMembersArg); + return this.ListFileMembersAsync(listFileMembersArg, cancellationToken); } /// @@ -1591,14 +1637,15 @@ public SharedFileMembers EndListFileMembers(sys.IAsyncResult asyncResult) /// are not returned for this endpoint. /// /// 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> ListFileMembersBatchAsync(ListFileMembersBatchArg listFileMembersBatchArg) + public t.Task> ListFileMembersBatchAsync(ListFileMembersBatchArg listFileMembersBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, SharingUserError>(listFileMembersBatchArg, "api", "/sharing/list_file_members/batch", "user", global::Dropbox.Api.Sharing.ListFileMembersBatchArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Sharing.ListFileMembersBatchResult.Decoder), global::Dropbox.Api.Sharing.SharingUserError.Decoder); + return this.Transport.SendRpcRequestAsync, SharingUserError>(listFileMembersBatchArg, "api", "/sharing/list_file_members/batch", "user", global::Dropbox.Api.Sharing.ListFileMembersBatchArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Sharing.ListFileMembersBatchResult.Decoder), global::Dropbox.Api.Sharing.SharingUserError.Decoder, cancellationToken); } /// @@ -1627,18 +1674,20 @@ public sys.IAsyncResult BeginListFileMembersBatch(ListFileMembersBatchArg listFi /// Files for which to return members. /// Number of members to return max per query. Defaults to 10 if no /// limit is specified. + /// 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> ListFileMembersBatchAsync(col.IEnumerable files, - uint limit = 10) + uint limit = 10, + tr.CancellationToken cancellationToken = default) { var listFileMembersBatchArg = new ListFileMembersBatchArg(files, limit); - return this.ListFileMembersBatchAsync(listFileMembersBatchArg); + return this.ListFileMembersBatchAsync(listFileMembersBatchArg, cancellationToken); } /// @@ -1691,14 +1740,15 @@ public col.List EndListFileMembersBatch(sys.IAsyncRe /// use this to paginate through all shared file members. /// /// 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 ListFileMembersContinueAsync(ListFileMembersContinueArg listFileMembersContinueArg) + public t.Task ListFileMembersContinueAsync(ListFileMembersContinueArg listFileMembersContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFileMembersContinueArg, "api", "/sharing/list_file_members/continue", "user", global::Dropbox.Api.Sharing.ListFileMembersContinueArg.Encoder, global::Dropbox.Api.Sharing.SharedFileMembers.Decoder, global::Dropbox.Api.Sharing.ListFileMembersContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(listFileMembersContinueArg, "api", "/sharing/list_file_members/continue", "user", global::Dropbox.Api.Sharing.ListFileMembersContinueArg.Encoder, global::Dropbox.Api.Sharing.SharedFileMembers.Decoder, global::Dropbox.Api.Sharing.ListFileMembersContinueError.Decoder, cancellationToken); } /// @@ -1729,16 +1779,18 @@ public sys.IAsyncResult BeginListFileMembersContinue(ListFileMembersContinueArg /// />, 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 ListFileMembersContinueAsync(string cursor) + public t.Task ListFileMembersContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var listFileMembersContinueArg = new ListFileMembersContinueArg(cursor); - return this.ListFileMembersContinueAsync(listFileMembersContinueArg); + return this.ListFileMembersContinueAsync(listFileMembersContinueArg, cancellationToken); } /// @@ -1789,14 +1841,15 @@ public SharedFileMembers EndListFileMembersContinue(sys.IAsyncResult asyncResult /// Returns shared folder membership by its folder ID. /// /// 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 ListFolderMembersAsync(ListFolderMembersArgs listFolderMembersArgs) + public t.Task ListFolderMembersAsync(ListFolderMembersArgs listFolderMembersArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFolderMembersArgs, "api", "/sharing/list_folder_members", "user", global::Dropbox.Api.Sharing.ListFolderMembersArgs.Encoder, global::Dropbox.Api.Sharing.SharedFolderMembers.Decoder, global::Dropbox.Api.Sharing.SharedFolderAccessError.Decoder); + return this.Transport.SendRpcRequestAsync(listFolderMembersArgs, "api", "/sharing/list_folder_members", "user", global::Dropbox.Api.Sharing.ListFolderMembersArgs.Encoder, global::Dropbox.Api.Sharing.SharedFolderMembers.Decoder, global::Dropbox.Api.Sharing.SharedFolderAccessError.Decoder, cancellationToken); } /// @@ -1825,6 +1878,7 @@ public sys.IAsyncResult BeginListFolderMembers(ListFolderMembersArgs listFolderM /// member. /// The maximum number of results that include members, groups and /// invitees to return 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 @@ -1832,13 +1886,14 @@ public sys.IAsyncResult BeginListFolderMembers(ListFolderMembersArgs listFolderM /// cref="SharedFolderAccessError"/>. public t.Task ListFolderMembersAsync(string sharedFolderId, col.IEnumerable actions = null, - uint limit = 1000) + uint limit = 1000, + tr.CancellationToken cancellationToken = default) { var listFolderMembersArgs = new ListFolderMembersArgs(sharedFolderId, actions, limit); - return this.ListFolderMembersAsync(listFolderMembersArgs); + return this.ListFolderMembersAsync(listFolderMembersArgs, cancellationToken); } /// @@ -1896,14 +1951,15 @@ public SharedFolderMembers EndListFolderMembers(sys.IAsyncResult asyncResult) /// this to paginate through all shared folder members. /// /// 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 ListFolderMembersContinueAsync(ListFolderMembersContinueArg listFolderMembersContinueArg) + public t.Task ListFolderMembersContinueAsync(ListFolderMembersContinueArg listFolderMembersContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFolderMembersContinueArg, "api", "/sharing/list_folder_members/continue", "user", global::Dropbox.Api.Sharing.ListFolderMembersContinueArg.Encoder, global::Dropbox.Api.Sharing.SharedFolderMembers.Decoder, global::Dropbox.Api.Sharing.ListFolderMembersContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(listFolderMembersContinueArg, "api", "/sharing/list_folder_members/continue", "user", global::Dropbox.Api.Sharing.ListFolderMembersContinueArg.Encoder, global::Dropbox.Api.Sharing.SharedFolderMembers.Decoder, global::Dropbox.Api.Sharing.ListFolderMembersContinueError.Decoder, cancellationToken); } /// @@ -1932,16 +1988,18 @@ public sys.IAsyncResult BeginListFolderMembersContinue(ListFolderMembersContinue /// . + /// 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 ListFolderMembersContinueAsync(string cursor) + public t.Task ListFolderMembersContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var listFolderMembersContinueArg = new ListFolderMembersContinueArg(cursor); - return this.ListFolderMembersContinueAsync(listFolderMembersContinueArg); + return this.ListFolderMembersContinueAsync(listFolderMembersContinueArg, cancellationToken); } /// @@ -1991,11 +2049,12 @@ public SharedFolderMembers EndListFolderMembersContinue(sys.IAsyncResult asyncRe /// Return the list of all shared folders the current user has access to. /// /// 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 ListFoldersAsync(ListFoldersArgs listFoldersArgs) + public t.Task ListFoldersAsync(ListFoldersArgs listFoldersArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFoldersArgs, "api", "/sharing/list_folders", "user", global::Dropbox.Api.Sharing.ListFoldersArgs.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(listFoldersArgs, "api", "/sharing/list_folders", "user", global::Dropbox.Api.Sharing.ListFoldersArgs.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -2022,15 +2081,17 @@ public sys.IAsyncResult BeginListFolders(ListFoldersArgs listFoldersArgs, sys.As /// `FolderPermission`s that should appear in the response's field describing the /// actions the authenticated user can perform on the folder. + /// 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 ListFoldersAsync(uint limit = 1000, - col.IEnumerable actions = null) + col.IEnumerable actions = null, + tr.CancellationToken cancellationToken = default) { var listFoldersArgs = new ListFoldersArgs(limit, actions); - return this.ListFoldersAsync(listFoldersArgs); + return this.ListFoldersAsync(listFoldersArgs, cancellationToken); } /// @@ -2084,14 +2145,15 @@ public ListFoldersResult EndListFolders(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 ListFoldersContinueAsync(ListFoldersContinueArg listFoldersContinueArg) + public t.Task ListFoldersContinueAsync(ListFoldersContinueArg listFoldersContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFoldersContinueArg, "api", "/sharing/list_folders/continue", "user", global::Dropbox.Api.Sharing.ListFoldersContinueArg.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, global::Dropbox.Api.Sharing.ListFoldersContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(listFoldersContinueArg, "api", "/sharing/list_folders/continue", "user", global::Dropbox.Api.Sharing.ListFoldersContinueArg.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, global::Dropbox.Api.Sharing.ListFoldersContinueError.Decoder, cancellationToken); } /// @@ -2120,16 +2182,18 @@ public sys.IAsyncResult BeginListFoldersContinue(ListFoldersContinueArg listFold /// /// 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 ListFoldersContinueAsync(string cursor) + public t.Task ListFoldersContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var listFoldersContinueArg = new ListFoldersContinueArg(cursor); - return this.ListFoldersContinueAsync(listFoldersContinueArg); + return this.ListFoldersContinueAsync(listFoldersContinueArg, cancellationToken); } /// @@ -2177,11 +2241,12 @@ public ListFoldersResult EndListFoldersContinue(sys.IAsyncResult asyncResult) /// unmount. /// /// 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 ListMountableFoldersAsync(ListFoldersArgs listFoldersArgs) + public t.Task ListMountableFoldersAsync(ListFoldersArgs listFoldersArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFoldersArgs, "api", "/sharing/list_mountable_folders", "user", global::Dropbox.Api.Sharing.ListFoldersArgs.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(listFoldersArgs, "api", "/sharing/list_mountable_folders", "user", global::Dropbox.Api.Sharing.ListFoldersArgs.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -2209,15 +2274,17 @@ public sys.IAsyncResult BeginListMountableFolders(ListFoldersArgs listFoldersArg /// `FolderPermission`s that should appear in the response's field describing the /// actions the authenticated user can perform on the folder. + /// 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 ListMountableFoldersAsync(uint limit = 1000, - col.IEnumerable actions = null) + col.IEnumerable actions = null, + tr.CancellationToken cancellationToken = default) { var listFoldersArgs = new ListFoldersArgs(limit, actions); - return this.ListMountableFoldersAsync(listFoldersArgs); + return this.ListMountableFoldersAsync(listFoldersArgs, cancellationToken); } /// @@ -2273,14 +2340,15 @@ public ListFoldersResult EndListMountableFolders(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 ListMountableFoldersContinueAsync(ListFoldersContinueArg listFoldersContinueArg) + public t.Task ListMountableFoldersContinueAsync(ListFoldersContinueArg listFoldersContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFoldersContinueArg, "api", "/sharing/list_mountable_folders/continue", "user", global::Dropbox.Api.Sharing.ListFoldersContinueArg.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, global::Dropbox.Api.Sharing.ListFoldersContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(listFoldersContinueArg, "api", "/sharing/list_mountable_folders/continue", "user", global::Dropbox.Api.Sharing.ListFoldersContinueArg.Encoder, global::Dropbox.Api.Sharing.ListFoldersResult.Decoder, global::Dropbox.Api.Sharing.ListFoldersContinueError.Decoder, cancellationToken); } /// @@ -2312,16 +2380,18 @@ public sys.IAsyncResult BeginListMountableFoldersContinue(ListFoldersContinueArg /// /// 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 ListMountableFoldersContinueAsync(string cursor) + public t.Task ListMountableFoldersContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var listFoldersContinueArg = new ListFoldersContinueArg(cursor); - return this.ListMountableFoldersContinueAsync(listFoldersContinueArg); + return this.ListMountableFoldersContinueAsync(listFoldersContinueArg, cancellationToken); } /// @@ -2371,14 +2441,15 @@ public ListFoldersResult EndListMountableFoldersContinue(sys.IAsyncResult asyncR /// not include unclaimed invitations. /// /// 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 ListReceivedFilesAsync(ListFilesArg listFilesArg) + public t.Task ListReceivedFilesAsync(ListFilesArg listFilesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFilesArg, "api", "/sharing/list_received_files", "user", global::Dropbox.Api.Sharing.ListFilesArg.Encoder, global::Dropbox.Api.Sharing.ListFilesResult.Decoder, global::Dropbox.Api.Sharing.SharingUserError.Decoder); + return this.Transport.SendRpcRequestAsync(listFilesArg, "api", "/sharing/list_received_files", "user", global::Dropbox.Api.Sharing.ListFilesArg.Encoder, global::Dropbox.Api.Sharing.ListFilesResult.Decoder, global::Dropbox.Api.Sharing.SharingUserError.Decoder, cancellationToken); } /// @@ -2408,18 +2479,20 @@ public sys.IAsyncResult BeginListReceivedFiles(ListFilesArg listFilesArg, sys.As /// that should appear in the response's field describing the /// actions the authenticated user can perform on the file. + /// 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 ListReceivedFilesAsync(uint limit = 100, - col.IEnumerable actions = null) + col.IEnumerable actions = null, + tr.CancellationToken cancellationToken = default) { var listFilesArg = new ListFilesArg(limit, actions); - return this.ListReceivedFilesAsync(listFilesArg); + return this.ListReceivedFilesAsync(listFilesArg, cancellationToken); } /// @@ -2474,14 +2547,15 @@ public ListFilesResult EndListReceivedFiles(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 ListReceivedFilesContinueAsync(ListFilesContinueArg listFilesContinueArg) + public t.Task ListReceivedFilesContinueAsync(ListFilesContinueArg listFilesContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listFilesContinueArg, "api", "/sharing/list_received_files/continue", "user", global::Dropbox.Api.Sharing.ListFilesContinueArg.Encoder, global::Dropbox.Api.Sharing.ListFilesResult.Decoder, global::Dropbox.Api.Sharing.ListFilesContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(listFilesContinueArg, "api", "/sharing/list_received_files/continue", "user", global::Dropbox.Api.Sharing.ListFilesContinueArg.Encoder, global::Dropbox.Api.Sharing.ListFilesResult.Decoder, global::Dropbox.Api.Sharing.ListFilesContinueError.Decoder, cancellationToken); } /// @@ -2507,16 +2581,18 @@ public sys.IAsyncResult BeginListReceivedFilesContinue(ListFilesContinueArg list /// /// Cursor in . + /// 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 ListReceivedFilesContinueAsync(string cursor) + public t.Task ListReceivedFilesContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var listFilesContinueArg = new ListFilesContinueArg(cursor); - return this.ListReceivedFilesContinueAsync(listFilesContinueArg); + return this.ListReceivedFilesContinueAsync(listFilesContinueArg, cancellationToken); } /// @@ -2573,14 +2649,15 @@ public ListFilesResult EndListReceivedFilesContinue(sys.IAsyncResult asyncResult /// direct_only to true. /// /// 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 ListSharedLinksAsync(ListSharedLinksArg listSharedLinksArg) + public t.Task ListSharedLinksAsync(ListSharedLinksArg listSharedLinksArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listSharedLinksArg, "api", "/sharing/list_shared_links", "user", global::Dropbox.Api.Sharing.ListSharedLinksArg.Encoder, global::Dropbox.Api.Sharing.ListSharedLinksResult.Decoder, global::Dropbox.Api.Sharing.ListSharedLinksError.Decoder); + return this.Transport.SendRpcRequestAsync(listSharedLinksArg, "api", "/sharing/list_shared_links", "user", global::Dropbox.Api.Sharing.ListSharedLinksArg.Encoder, global::Dropbox.Api.Sharing.ListSharedLinksResult.Decoder, global::Dropbox.Api.Sharing.ListSharedLinksError.Decoder, cancellationToken); } /// @@ -2621,6 +2698,7 @@ public sys.IAsyncResult BeginListSharedLinks(ListSharedLinksArg listSharedLinksA /// See /// 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 @@ -2628,13 +2706,14 @@ public sys.IAsyncResult BeginListSharedLinks(ListSharedLinksArg listSharedLinksA /// cref="ListSharedLinksError"/>. public t.Task ListSharedLinksAsync(string path = null, string cursor = null, - bool? directOnly = null) + bool? directOnly = null, + tr.CancellationToken cancellationToken = default) { var listSharedLinksArg = new ListSharedLinksArg(path, cursor, directOnly); - return this.ListSharedLinksAsync(listSharedLinksArg); + return this.ListSharedLinksAsync(listSharedLinksArg, cancellationToken); } /// @@ -2699,14 +2778,15 @@ public ListSharedLinksResult EndListSharedLinks(sys.IAsyncResult asyncResult) /// requested visibility. /// /// 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 ModifySharedLinkSettingsAsync(ModifySharedLinkSettingsArgs modifySharedLinkSettingsArgs) + public t.Task ModifySharedLinkSettingsAsync(ModifySharedLinkSettingsArgs modifySharedLinkSettingsArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(modifySharedLinkSettingsArgs, "api", "/sharing/modify_shared_link_settings", "user", global::Dropbox.Api.Sharing.ModifySharedLinkSettingsArgs.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.ModifySharedLinkSettingsError.Decoder); + return this.Transport.SendRpcRequestAsync(modifySharedLinkSettingsArgs, "api", "/sharing/modify_shared_link_settings", "user", global::Dropbox.Api.Sharing.ModifySharedLinkSettingsArgs.Encoder, global::Dropbox.Api.Sharing.SharedLinkMetadata.Decoder, global::Dropbox.Api.Sharing.ModifySharedLinkSettingsError.Decoder, cancellationToken); } /// @@ -2739,6 +2819,7 @@ public sys.IAsyncResult BeginModifySharedLinkSettings(ModifySharedLinkSettingsAr /// Set of settings for the shared link. /// If set to true, removes the expiration of the shared /// link. + /// 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 @@ -2746,13 +2827,14 @@ public sys.IAsyncResult BeginModifySharedLinkSettings(ModifySharedLinkSettingsAr /// cref="ModifySharedLinkSettingsError"/>. public t.Task ModifySharedLinkSettingsAsync(string url, SharedLinkSettings settings, - bool removeExpiration = false) + bool removeExpiration = false, + tr.CancellationToken cancellationToken = default) { var modifySharedLinkSettingsArgs = new ModifySharedLinkSettingsArgs(url, settings, removeExpiration); - return this.ModifySharedLinkSettingsAsync(modifySharedLinkSettingsArgs); + return this.ModifySharedLinkSettingsAsync(modifySharedLinkSettingsArgs, cancellationToken); } /// @@ -2807,14 +2889,15 @@ public SharedLinkMetadata EndModifySharedLinkSettings(sys.IAsyncResult asyncResu /// mounted, the shared folder will appear in their Dropbox. /// /// 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 MountFolderAsync(MountFolderArg mountFolderArg) + public t.Task MountFolderAsync(MountFolderArg mountFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(mountFolderArg, "api", "/sharing/mount_folder", "user", global::Dropbox.Api.Sharing.MountFolderArg.Encoder, global::Dropbox.Api.Sharing.SharedFolderMetadata.Decoder, global::Dropbox.Api.Sharing.MountFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(mountFolderArg, "api", "/sharing/mount_folder", "user", global::Dropbox.Api.Sharing.MountFolderArg.Encoder, global::Dropbox.Api.Sharing.SharedFolderMetadata.Decoder, global::Dropbox.Api.Sharing.MountFolderError.Decoder, cancellationToken); } /// @@ -2839,16 +2922,18 @@ public sys.IAsyncResult BeginMountFolder(MountFolderArg mountFolderArg, sys.Asyn /// mounted, the shared folder will appear in their Dropbox. /// /// The ID of the shared folder to mount. + /// 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 MountFolderAsync(string sharedFolderId) + public t.Task MountFolderAsync(string sharedFolderId, + tr.CancellationToken cancellationToken = default) { var mountFolderArg = new MountFolderArg(sharedFolderId); - return this.MountFolderAsync(mountFolderArg); + return this.MountFolderAsync(mountFolderArg, cancellationToken); } /// @@ -2896,13 +2981,14 @@ public SharedFolderMetadata EndMountFolder(sys.IAsyncResult asyncResult) /// parent folder. /// /// 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 RelinquishFileMembershipAsync(RelinquishFileMembershipArg relinquishFileMembershipArg) + public t.Task RelinquishFileMembershipAsync(RelinquishFileMembershipArg relinquishFileMembershipArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relinquishFileMembershipArg, "api", "/sharing/relinquish_file_membership", "user", global::Dropbox.Api.Sharing.RelinquishFileMembershipArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.RelinquishFileMembershipError.Decoder); + return this.Transport.SendRpcRequestAsync(relinquishFileMembershipArg, "api", "/sharing/relinquish_file_membership", "user", global::Dropbox.Api.Sharing.RelinquishFileMembershipArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.RelinquishFileMembershipError.Decoder, cancellationToken); } /// @@ -2927,15 +3013,17 @@ public sys.IAsyncResult BeginRelinquishFileMembership(RelinquishFileMembershipAr /// parent folder. /// /// The path or id for the file. + /// 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 RelinquishFileMembershipAsync(string file) + public t.Task RelinquishFileMembershipAsync(string file, + tr.CancellationToken cancellationToken = default) { var relinquishFileMembershipArg = new RelinquishFileMembershipArg(file); - return this.RelinquishFileMembershipAsync(relinquishFileMembershipArg); + return this.RelinquishFileMembershipAsync(relinquishFileMembershipArg, cancellationToken); } /// @@ -2982,14 +3070,15 @@ public void EndRelinquishFileMembership(sys.IAsyncResult asyncResult) /// leave_a_copy is true. /// /// 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 RelinquishFolderMembershipAsync(RelinquishFolderMembershipArg relinquishFolderMembershipArg) + public t.Task RelinquishFolderMembershipAsync(RelinquishFolderMembershipArg relinquishFolderMembershipArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(relinquishFolderMembershipArg, "api", "/sharing/relinquish_folder_membership", "user", global::Dropbox.Api.Sharing.RelinquishFolderMembershipArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Sharing.RelinquishFolderMembershipError.Decoder); + return this.Transport.SendRpcRequestAsync(relinquishFolderMembershipArg, "api", "/sharing/relinquish_folder_membership", "user", global::Dropbox.Api.Sharing.RelinquishFolderMembershipArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Sharing.RelinquishFolderMembershipError.Decoder, cancellationToken); } /// @@ -3018,18 +3107,20 @@ public sys.IAsyncResult BeginRelinquishFolderMembership(RelinquishFolderMembersh /// The ID for the shared folder. /// Keep a copy of the folder's contents upon relinquishing /// membership. + /// 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 RelinquishFolderMembershipAsync(string sharedFolderId, - bool leaveACopy = false) + bool leaveACopy = false, + tr.CancellationToken cancellationToken = default) { var relinquishFolderMembershipArg = new RelinquishFolderMembershipArg(sharedFolderId, leaveACopy); - return this.RelinquishFolderMembershipAsync(relinquishFolderMembershipArg); + return this.RelinquishFolderMembershipAsync(relinquishFolderMembershipArg, cancellationToken); } /// @@ -3079,15 +3170,16 @@ public sys.IAsyncResult BeginRelinquishFolderMembership(string sharedFolderId, /// Identical to remove_file_member_2 but with less information returned. /// /// 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 RemoveFileMember2Async instead.")] - public t.Task RemoveFileMemberAsync(RemoveFileMemberArg removeFileMemberArg) + public t.Task RemoveFileMemberAsync(RemoveFileMemberArg removeFileMemberArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(removeFileMemberArg, "api", "/sharing/remove_file_member", "user", global::Dropbox.Api.Sharing.RemoveFileMemberArg.Encoder, global::Dropbox.Api.Sharing.FileMemberActionIndividualResult.Decoder, global::Dropbox.Api.Sharing.RemoveFileMemberError.Decoder); + return this.Transport.SendRpcRequestAsync(removeFileMemberArg, "api", "/sharing/remove_file_member", "user", global::Dropbox.Api.Sharing.RemoveFileMemberArg.Encoder, global::Dropbox.Api.Sharing.FileMemberActionIndividualResult.Decoder, global::Dropbox.Api.Sharing.RemoveFileMemberError.Decoder, cancellationToken); } /// @@ -3114,6 +3206,7 @@ public sys.IAsyncResult BeginRemoveFileMember(RemoveFileMemberArg removeFileMemb /// Member to remove from this file. Note that even if an email is /// specified, it may result in the removal of a user (not an invitee) if the user's /// main account corresponds to that email address. + /// 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 @@ -3121,12 +3214,13 @@ public sys.IAsyncResult BeginRemoveFileMember(RemoveFileMemberArg removeFileMemb /// cref="RemoveFileMemberError"/>. [sys.Obsolete("This function is deprecated, please use RemoveFileMember2Async instead.")] public t.Task RemoveFileMemberAsync(string file, - MemberSelector member) + MemberSelector member, + tr.CancellationToken cancellationToken = default) { var removeFileMemberArg = new RemoveFileMemberArg(file, member); - return this.RemoveFileMemberAsync(removeFileMemberArg); + return this.RemoveFileMemberAsync(removeFileMemberArg, cancellationToken); } /// @@ -3179,14 +3273,15 @@ public FileMemberActionIndividualResult EndRemoveFileMember(sys.IAsyncResult asy /// Removes a specified member from the 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 RemoveFileMember2Async(RemoveFileMemberArg removeFileMemberArg) + public t.Task RemoveFileMember2Async(RemoveFileMemberArg removeFileMemberArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(removeFileMemberArg, "api", "/sharing/remove_file_member_2", "user", global::Dropbox.Api.Sharing.RemoveFileMemberArg.Encoder, global::Dropbox.Api.Sharing.FileMemberRemoveActionResult.Decoder, global::Dropbox.Api.Sharing.RemoveFileMemberError.Decoder); + return this.Transport.SendRpcRequestAsync(removeFileMemberArg, "api", "/sharing/remove_file_member_2", "user", global::Dropbox.Api.Sharing.RemoveFileMemberArg.Encoder, global::Dropbox.Api.Sharing.FileMemberRemoveActionResult.Decoder, global::Dropbox.Api.Sharing.RemoveFileMemberError.Decoder, cancellationToken); } /// @@ -3212,18 +3307,20 @@ public sys.IAsyncResult BeginRemoveFileMember2(RemoveFileMemberArg removeFileMem /// Member to remove from this file. Note that even if an email is /// specified, it may result in the removal of a user (not an invitee) if the user's /// main account corresponds to that email address. + /// 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 RemoveFileMember2Async(string file, - MemberSelector member) + MemberSelector member, + tr.CancellationToken cancellationToken = default) { var removeFileMemberArg = new RemoveFileMemberArg(file, member); - return this.RemoveFileMember2Async(removeFileMemberArg); + return this.RemoveFileMember2Async(removeFileMemberArg, cancellationToken); } /// @@ -3275,14 +3372,15 @@ public FileMemberRemoveActionResult EndRemoveFileMember2(sys.IAsyncResult asyncR /// folder to remove another member. /// /// 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 RemoveFolderMemberAsync(RemoveFolderMemberArg removeFolderMemberArg) + public t.Task RemoveFolderMemberAsync(RemoveFolderMemberArg removeFolderMemberArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(removeFolderMemberArg, "api", "/sharing/remove_folder_member", "user", global::Dropbox.Api.Sharing.RemoveFolderMemberArg.Encoder, global::Dropbox.Api.Async.LaunchResultBase.Decoder, global::Dropbox.Api.Sharing.RemoveFolderMemberError.Decoder); + return this.Transport.SendRpcRequestAsync(removeFolderMemberArg, "api", "/sharing/remove_folder_member", "user", global::Dropbox.Api.Sharing.RemoveFolderMemberArg.Encoder, global::Dropbox.Api.Async.LaunchResultBase.Decoder, global::Dropbox.Api.Sharing.RemoveFolderMemberError.Decoder, cancellationToken); } /// @@ -3310,6 +3408,7 @@ public sys.IAsyncResult BeginRemoveFolderMember(RemoveFolderMemberArg removeFold /// If true, the removed user will keep their copy of the /// folder after it's unshared, assuming it was mounted. Otherwise, it will be removed /// from their Dropbox. Also, this must be set to false when kicking a group. + /// 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 @@ -3317,13 +3416,14 @@ public sys.IAsyncResult BeginRemoveFolderMember(RemoveFolderMemberArg removeFold /// cref="RemoveFolderMemberError"/>. public t.Task RemoveFolderMemberAsync(string sharedFolderId, MemberSelector member, - bool leaveACopy) + bool leaveACopy, + tr.CancellationToken cancellationToken = default) { var removeFolderMemberArg = new RemoveFolderMemberArg(sharedFolderId, member, leaveACopy); - return this.RemoveFolderMemberAsync(removeFolderMemberArg); + return this.RemoveFolderMemberAsync(removeFolderMemberArg, cancellationToken); } /// @@ -3383,13 +3483,14 @@ public sys.IAsyncResult BeginRemoveFolderMember(string sharedFolderId, /// argument. /// /// 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 RevokeSharedLinkAsync(RevokeSharedLinkArg revokeSharedLinkArg) + public t.Task RevokeSharedLinkAsync(RevokeSharedLinkArg revokeSharedLinkArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(revokeSharedLinkArg, "api", "/sharing/revoke_shared_link", "user", global::Dropbox.Api.Sharing.RevokeSharedLinkArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.RevokeSharedLinkError.Decoder); + return this.Transport.SendRpcRequestAsync(revokeSharedLinkArg, "api", "/sharing/revoke_shared_link", "user", global::Dropbox.Api.Sharing.RevokeSharedLinkArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.RevokeSharedLinkError.Decoder, cancellationToken); } /// @@ -3418,15 +3519,17 @@ public sys.IAsyncResult BeginRevokeSharedLink(RevokeSharedLinkArg revokeSharedLi /// argument. /// /// URL of the shared link. + /// 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 RevokeSharedLinkAsync(string url) + public t.Task RevokeSharedLinkAsync(string url, + tr.CancellationToken cancellationToken = default) { var revokeSharedLinkArg = new RevokeSharedLinkArg(url); - return this.RevokeSharedLinkAsync(revokeSharedLinkArg); + return this.RevokeSharedLinkAsync(revokeSharedLinkArg, cancellationToken); } /// @@ -3474,14 +3577,15 @@ public void EndRevokeSharedLink(sys.IAsyncResult asyncResult) /// until the action completes to get the metadata for the 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 SetAccessInheritanceAsync(SetAccessInheritanceArg setAccessInheritanceArg) + public t.Task SetAccessInheritanceAsync(SetAccessInheritanceArg setAccessInheritanceArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(setAccessInheritanceArg, "api", "/sharing/set_access_inheritance", "user", global::Dropbox.Api.Sharing.SetAccessInheritanceArg.Encoder, global::Dropbox.Api.Sharing.ShareFolderLaunch.Decoder, global::Dropbox.Api.Sharing.SetAccessInheritanceError.Decoder); + return this.Transport.SendRpcRequestAsync(setAccessInheritanceArg, "api", "/sharing/set_access_inheritance", "user", global::Dropbox.Api.Sharing.SetAccessInheritanceArg.Encoder, global::Dropbox.Api.Sharing.ShareFolderLaunch.Decoder, global::Dropbox.Api.Sharing.SetAccessInheritanceError.Decoder, cancellationToken); } /// @@ -3511,18 +3615,20 @@ public sys.IAsyncResult BeginSetAccessInheritance(SetAccessInheritanceArg setAcc /// The ID for the shared folder. /// The access inheritance settings for the /// 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 SetAccessInheritanceAsync(string sharedFolderId, - AccessInheritance accessInheritance = null) + AccessInheritance accessInheritance = null, + tr.CancellationToken cancellationToken = default) { var setAccessInheritanceArg = new SetAccessInheritanceArg(sharedFolderId, accessInheritance); - return this.SetAccessInheritanceAsync(setAccessInheritanceArg); + return this.SetAccessInheritanceAsync(setAccessInheritanceArg, cancellationToken); } /// @@ -3579,14 +3685,15 @@ public ShareFolderLaunch EndSetAccessInheritance(sys.IAsyncResult asyncResult) /// until the action completes to get the metadata for the 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 ShareFolderAsync(ShareFolderArg shareFolderArg) + public t.Task ShareFolderAsync(ShareFolderArg shareFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(shareFolderArg, "api", "/sharing/share_folder", "user", global::Dropbox.Api.Sharing.ShareFolderArg.Encoder, global::Dropbox.Api.Sharing.ShareFolderLaunch.Decoder, global::Dropbox.Api.Sharing.ShareFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(shareFolderArg, "api", "/sharing/share_folder", "user", global::Dropbox.Api.Sharing.ShareFolderArg.Encoder, global::Dropbox.Api.Sharing.ShareFolderLaunch.Decoder, global::Dropbox.Api.Sharing.ShareFolderError.Decoder, cancellationToken); } /// @@ -3635,6 +3742,7 @@ public sys.IAsyncResult BeginShareFolder(ShareFolderArg shareFolderArg, sys.Asyn /// cref="Dropbox.Api.Sharing.SharedFolderMetadata.Permissions" /> field describing the /// actions the authenticated user can perform on the folder. /// Settings on the link for this 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 @@ -3648,7 +3756,8 @@ public t.Task ShareFolderAsync(string path, ViewerInfoPolicy viewerInfoPolicy = null, AccessInheritance accessInheritance = null, col.IEnumerable actions = null, - LinkSettings linkSettings = null) + LinkSettings linkSettings = null, + tr.CancellationToken cancellationToken = default) { var shareFolderArg = new ShareFolderArg(path, aclUpdatePolicy, @@ -3660,7 +3769,7 @@ public t.Task ShareFolderAsync(string path, actions, linkSettings); - return this.ShareFolderAsync(shareFolderArg); + return this.ShareFolderAsync(shareFolderArg, cancellationToken); } /// @@ -3744,13 +3853,14 @@ public ShareFolderLaunch EndShareFolder(sys.IAsyncResult asyncResult) /// the shared folder to perform a transfer. /// /// 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 TransferFolderAsync(TransferFolderArg transferFolderArg) + public t.Task TransferFolderAsync(TransferFolderArg transferFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(transferFolderArg, "api", "/sharing/transfer_folder", "user", global::Dropbox.Api.Sharing.TransferFolderArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.TransferFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(transferFolderArg, "api", "/sharing/transfer_folder", "user", global::Dropbox.Api.Sharing.TransferFolderArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.TransferFolderError.Decoder, cancellationToken); } /// @@ -3778,17 +3888,19 @@ public sys.IAsyncResult BeginTransferFolder(TransferFolderArg transferFolderArg, /// The ID for the shared folder. /// A account or team member ID to transfer ownership /// to. + /// 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 TransferFolderAsync(string sharedFolderId, - string toDropboxId) + string toDropboxId, + tr.CancellationToken cancellationToken = default) { var transferFolderArg = new TransferFolderArg(sharedFolderId, toDropboxId); - return this.TransferFolderAsync(transferFolderArg); + return this.TransferFolderAsync(transferFolderArg, cancellationToken); } /// @@ -3837,13 +3949,14 @@ public void EndTransferFolder(sys.IAsyncResult asyncResult) /// cref="Dropbox.Api.Sharing.Routes.SharingUserRoutes.MountFolderAsync" />. /// /// 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 UnmountFolderAsync(UnmountFolderArg unmountFolderArg) + public t.Task UnmountFolderAsync(UnmountFolderArg unmountFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(unmountFolderArg, "api", "/sharing/unmount_folder", "user", global::Dropbox.Api.Sharing.UnmountFolderArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.UnmountFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(unmountFolderArg, "api", "/sharing/unmount_folder", "user", global::Dropbox.Api.Sharing.UnmountFolderArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.UnmountFolderError.Decoder, cancellationToken); } /// @@ -3868,15 +3981,17 @@ public sys.IAsyncResult BeginUnmountFolder(UnmountFolderArg unmountFolderArg, sy /// cref="Dropbox.Api.Sharing.Routes.SharingUserRoutes.MountFolderAsync" />. /// /// The ID for the shared folder. + /// 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 UnmountFolderAsync(string sharedFolderId) + public t.Task UnmountFolderAsync(string sharedFolderId, + tr.CancellationToken cancellationToken = default) { var unmountFolderArg = new UnmountFolderArg(sharedFolderId); - return this.UnmountFolderAsync(unmountFolderArg); + return this.UnmountFolderAsync(unmountFolderArg, cancellationToken); } /// @@ -3919,13 +4034,14 @@ public void EndUnmountFolder(sys.IAsyncResult asyncResult) /// Remove all members from this file. Does not remove inherited members. /// /// 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 UnshareFileAsync(UnshareFileArg unshareFileArg) + public t.Task UnshareFileAsync(UnshareFileArg unshareFileArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(unshareFileArg, "api", "/sharing/unshare_file", "user", global::Dropbox.Api.Sharing.UnshareFileArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.UnshareFileError.Decoder); + return this.Transport.SendRpcRequestAsync(unshareFileArg, "api", "/sharing/unshare_file", "user", global::Dropbox.Api.Sharing.UnshareFileArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Sharing.UnshareFileError.Decoder, cancellationToken); } /// @@ -3948,15 +4064,17 @@ public sys.IAsyncResult BeginUnshareFile(UnshareFileArg unshareFileArg, sys.Asyn /// Remove all members from this file. Does not remove inherited members. /// /// The file to unshare. + /// 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 UnshareFileAsync(string file) + public t.Task UnshareFileAsync(string file, + tr.CancellationToken cancellationToken = default) { var unshareFileArg = new UnshareFileArg(file); - return this.UnshareFileAsync(unshareFileArg); + return this.UnshareFileAsync(unshareFileArg, cancellationToken); } /// @@ -4002,14 +4120,15 @@ public void EndUnshareFile(sys.IAsyncResult asyncResult) /// determine if the action has completed successfully. /// /// 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 UnshareFolderAsync(UnshareFolderArg unshareFolderArg) + public t.Task UnshareFolderAsync(UnshareFolderArg unshareFolderArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(unshareFolderArg, "api", "/sharing/unshare_folder", "user", global::Dropbox.Api.Sharing.UnshareFolderArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Sharing.UnshareFolderError.Decoder); + return this.Transport.SendRpcRequestAsync(unshareFolderArg, "api", "/sharing/unshare_folder", "user", global::Dropbox.Api.Sharing.UnshareFolderArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Sharing.UnshareFolderError.Decoder, cancellationToken); } /// @@ -4038,18 +4157,20 @@ public sys.IAsyncResult BeginUnshareFolder(UnshareFolderArg unshareFolderArg, sy /// If true, members of this shared folder will get a copy of /// this folder after it's unshared. Otherwise, it will be removed from their Dropbox. /// The current user, who is an owner, will always retain their copy. + /// 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 UnshareFolderAsync(string sharedFolderId, - bool leaveACopy = false) + bool leaveACopy = false, + tr.CancellationToken cancellationToken = default) { var unshareFolderArg = new UnshareFolderArg(sharedFolderId, leaveACopy); - return this.UnshareFolderAsync(unshareFolderArg); + return this.UnshareFolderAsync(unshareFolderArg, cancellationToken); } /// @@ -4100,14 +4221,15 @@ public sys.IAsyncResult BeginUnshareFolder(string sharedFolderId, /// Changes a member's access on a shared 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 UpdateFileMemberAsync(UpdateFileMemberArgs updateFileMemberArgs) + public t.Task UpdateFileMemberAsync(UpdateFileMemberArgs updateFileMemberArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(updateFileMemberArgs, "api", "/sharing/update_file_member", "user", global::Dropbox.Api.Sharing.UpdateFileMemberArgs.Encoder, global::Dropbox.Api.Sharing.MemberAccessLevelResult.Decoder, global::Dropbox.Api.Sharing.FileMemberActionError.Decoder); + return this.Transport.SendRpcRequestAsync(updateFileMemberArgs, "api", "/sharing/update_file_member", "user", global::Dropbox.Api.Sharing.UpdateFileMemberArgs.Encoder, global::Dropbox.Api.Sharing.MemberAccessLevelResult.Decoder, global::Dropbox.Api.Sharing.FileMemberActionError.Decoder, cancellationToken); } /// @@ -4132,6 +4254,7 @@ public sys.IAsyncResult BeginUpdateFileMember(UpdateFileMemberArgs updateFileMem /// File for which we are changing a member's access. /// The member whose access we are changing. /// The new access level for the member. + /// 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 @@ -4139,13 +4262,14 @@ public sys.IAsyncResult BeginUpdateFileMember(UpdateFileMemberArgs updateFileMem /// cref="FileMemberActionError"/>. public t.Task UpdateFileMemberAsync(string file, MemberSelector member, - AccessLevel accessLevel) + AccessLevel accessLevel, + tr.CancellationToken cancellationToken = default) { var updateFileMemberArgs = new UpdateFileMemberArgs(file, member, accessLevel); - return this.UpdateFileMemberAsync(updateFileMemberArgs); + return this.UpdateFileMemberAsync(updateFileMemberArgs, cancellationToken); } /// @@ -4198,14 +4322,15 @@ public MemberAccessLevelResult EndUpdateFileMember(sys.IAsyncResult asyncResult) /// permissions. /// /// 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 UpdateFolderMemberAsync(UpdateFolderMemberArg updateFolderMemberArg) + public t.Task UpdateFolderMemberAsync(UpdateFolderMemberArg updateFolderMemberArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(updateFolderMemberArg, "api", "/sharing/update_folder_member", "user", global::Dropbox.Api.Sharing.UpdateFolderMemberArg.Encoder, global::Dropbox.Api.Sharing.MemberAccessLevelResult.Decoder, global::Dropbox.Api.Sharing.UpdateFolderMemberError.Decoder); + return this.Transport.SendRpcRequestAsync(updateFolderMemberArg, "api", "/sharing/update_folder_member", "user", global::Dropbox.Api.Sharing.UpdateFolderMemberArg.Encoder, global::Dropbox.Api.Sharing.MemberAccessLevelResult.Decoder, global::Dropbox.Api.Sharing.UpdateFolderMemberError.Decoder, cancellationToken); } /// @@ -4234,6 +4359,7 @@ public sys.IAsyncResult BeginUpdateFolderMember(UpdateFolderMemberArg updateFold /// time. /// The new access level for . is disallowed. + /// 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 @@ -4241,13 +4367,14 @@ public sys.IAsyncResult BeginUpdateFolderMember(UpdateFolderMemberArg updateFold /// cref="UpdateFolderMemberError"/>. public t.Task UpdateFolderMemberAsync(string sharedFolderId, MemberSelector member, - AccessLevel accessLevel) + AccessLevel accessLevel, + tr.CancellationToken cancellationToken = default) { var updateFolderMemberArg = new UpdateFolderMemberArg(sharedFolderId, member, accessLevel); - return this.UpdateFolderMemberAsync(updateFolderMemberArg); + return this.UpdateFolderMemberAsync(updateFolderMemberArg, cancellationToken); } /// @@ -4304,14 +4431,15 @@ public MemberAccessLevelResult EndUpdateFolderMember(sys.IAsyncResult asyncResul /// the shared folder to update its policies. /// /// 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 UpdateFolderPolicyAsync(UpdateFolderPolicyArg updateFolderPolicyArg) + public t.Task UpdateFolderPolicyAsync(UpdateFolderPolicyArg updateFolderPolicyArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(updateFolderPolicyArg, "api", "/sharing/update_folder_policy", "user", global::Dropbox.Api.Sharing.UpdateFolderPolicyArg.Encoder, global::Dropbox.Api.Sharing.SharedFolderMetadata.Decoder, global::Dropbox.Api.Sharing.UpdateFolderPolicyError.Decoder); + return this.Transport.SendRpcRequestAsync(updateFolderPolicyArg, "api", "/sharing/update_folder_policy", "user", global::Dropbox.Api.Sharing.UpdateFolderPolicyArg.Encoder, global::Dropbox.Api.Sharing.SharedFolderMetadata.Decoder, global::Dropbox.Api.Sharing.UpdateFolderPolicyError.Decoder, cancellationToken); } /// @@ -4350,6 +4478,7 @@ public sys.IAsyncResult BeginUpdateFolderPolicy(UpdateFolderPolicyArg updateFold /// `FolderPermission`s that should appear in the response's field describing the /// actions the authenticated user can perform on the 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 @@ -4361,7 +4490,8 @@ public t.Task UpdateFolderPolicyAsync(string sharedFolderI ViewerInfoPolicy viewerInfoPolicy = null, SharedLinkPolicy sharedLinkPolicy = null, LinkSettings linkSettings = null, - col.IEnumerable actions = null) + col.IEnumerable actions = null, + tr.CancellationToken cancellationToken = default) { var updateFolderPolicyArg = new UpdateFolderPolicyArg(sharedFolderId, memberPolicy, @@ -4371,7 +4501,7 @@ public t.Task UpdateFolderPolicyAsync(string sharedFolderI linkSettings, actions); - return this.UpdateFolderPolicyAsync(updateFolderPolicyArg); + return this.UpdateFolderPolicyAsync(updateFolderPolicyArg, cancellationToken); } /// diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Team/TeamTeamRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Team/TeamTeamRoutes.cs index 2c92159592..b9daa69642 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Team/TeamTeamRoutes.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Team/TeamTeamRoutes.cs @@ -8,6 +8,7 @@ namespace Dropbox.Api.Team.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 TeamTeamRoutes(enc.ITransport transport) /// List all device sessions of a team's member. /// /// 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 DevicesListMemberDevicesAsync(ListMemberDevicesArg listMemberDevicesArg) + public t.Task DevicesListMemberDevicesAsync(ListMemberDevicesArg listMemberDevicesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listMemberDevicesArg, "api", "/team/devices/list_member_devices", "team", global::Dropbox.Api.Team.ListMemberDevicesArg.Encoder, global::Dropbox.Api.Team.ListMemberDevicesResult.Decoder, global::Dropbox.Api.Team.ListMemberDevicesError.Decoder); + return this.Transport.SendRpcRequestAsync(listMemberDevicesArg, "api", "/team/devices/list_member_devices", "team", global::Dropbox.Api.Team.ListMemberDevicesArg.Encoder, global::Dropbox.Api.Team.ListMemberDevicesResult.Decoder, global::Dropbox.Api.Team.ListMemberDevicesError.Decoder, cancellationToken); } /// @@ -69,6 +71,7 @@ public sys.IAsyncResult BeginDevicesListMemberDevices(ListMemberDevicesArg listM /// team's member. /// Whether to list linked mobile devices of the /// team's member. + /// 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 @@ -77,14 +80,15 @@ public sys.IAsyncResult BeginDevicesListMemberDevices(ListMemberDevicesArg listM public t.Task DevicesListMemberDevicesAsync(string teamMemberId, bool includeWebSessions = true, bool includeDesktopClients = true, - bool includeMobileClients = true) + bool includeMobileClients = true, + tr.CancellationToken cancellationToken = default) { var listMemberDevicesArg = new ListMemberDevicesArg(teamMemberId, includeWebSessions, includeDesktopClients, includeMobileClients); - return this.DevicesListMemberDevicesAsync(listMemberDevicesArg); + return this.DevicesListMemberDevicesAsync(listMemberDevicesArg, cancellationToken); } /// @@ -143,14 +147,15 @@ public ListMemberDevicesResult EndDevicesListMemberDevices(sys.IAsyncResult asyn /// Permission : Team member file access. /// /// 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 DevicesListMembersDevicesAsync(ListMembersDevicesArg listMembersDevicesArg) + public t.Task DevicesListMembersDevicesAsync(ListMembersDevicesArg listMembersDevicesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listMembersDevicesArg, "api", "/team/devices/list_members_devices", "team", global::Dropbox.Api.Team.ListMembersDevicesArg.Encoder, global::Dropbox.Api.Team.ListMembersDevicesResult.Decoder, global::Dropbox.Api.Team.ListMembersDevicesError.Decoder); + return this.Transport.SendRpcRequestAsync(listMembersDevicesArg, "api", "/team/devices/list_members_devices", "team", global::Dropbox.Api.Team.ListMembersDevicesArg.Encoder, global::Dropbox.Api.Team.ListMembersDevicesResult.Decoder, global::Dropbox.Api.Team.ListMembersDevicesError.Decoder, cancellationToken); } /// @@ -184,6 +189,7 @@ public sys.IAsyncResult BeginDevicesListMembersDevices(ListMembersDevicesArg lis /// members. /// Whether to list mobile clients of the team /// members. + /// 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 @@ -192,14 +198,15 @@ public sys.IAsyncResult BeginDevicesListMembersDevices(ListMembersDevicesArg lis public t.Task DevicesListMembersDevicesAsync(string cursor = null, bool includeWebSessions = true, bool includeDesktopClients = true, - bool includeMobileClients = true) + bool includeMobileClients = true, + tr.CancellationToken cancellationToken = default) { var listMembersDevicesArg = new ListMembersDevicesArg(cursor, includeWebSessions, includeDesktopClients, includeMobileClients); - return this.DevicesListMembersDevicesAsync(listMembersDevicesArg); + return this.DevicesListMembersDevicesAsync(listMembersDevicesArg, cancellationToken); } /// @@ -262,15 +269,16 @@ public ListMembersDevicesResult EndDevicesListMembersDevices(sys.IAsyncResult as /// Permission : Team member file access. /// /// 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 DevicesListMembersDevicesAsync instead.")] - public t.Task DevicesListTeamDevicesAsync(ListTeamDevicesArg listTeamDevicesArg) + public t.Task DevicesListTeamDevicesAsync(ListTeamDevicesArg listTeamDevicesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listTeamDevicesArg, "api", "/team/devices/list_team_devices", "team", global::Dropbox.Api.Team.ListTeamDevicesArg.Encoder, global::Dropbox.Api.Team.ListTeamDevicesResult.Decoder, global::Dropbox.Api.Team.ListTeamDevicesError.Decoder); + return this.Transport.SendRpcRequestAsync(listTeamDevicesArg, "api", "/team/devices/list_team_devices", "team", global::Dropbox.Api.Team.ListTeamDevicesArg.Encoder, global::Dropbox.Api.Team.ListTeamDevicesResult.Decoder, global::Dropbox.Api.Team.ListTeamDevicesError.Decoder, cancellationToken); } /// @@ -305,6 +313,7 @@ public sys.IAsyncResult BeginDevicesListTeamDevices(ListTeamDevicesArg listTeamD /// members. /// Whether to list mobile clients of the team /// members. + /// 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 @@ -314,14 +323,15 @@ public sys.IAsyncResult BeginDevicesListTeamDevices(ListTeamDevicesArg listTeamD public t.Task DevicesListTeamDevicesAsync(string cursor = null, bool includeWebSessions = true, bool includeDesktopClients = true, - bool includeMobileClients = true) + bool includeMobileClients = true, + tr.CancellationToken cancellationToken = default) { var listTeamDevicesArg = new ListTeamDevicesArg(cursor, includeWebSessions, includeDesktopClients, includeMobileClients); - return this.DevicesListTeamDevicesAsync(listTeamDevicesArg); + return this.DevicesListTeamDevicesAsync(listTeamDevicesArg, cancellationToken); } /// @@ -385,13 +395,14 @@ public ListTeamDevicesResult EndDevicesListTeamDevices(sys.IAsyncResult asyncRes /// Revoke a device session of a team's member. /// /// 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 DevicesRevokeDeviceSessionAsync(RevokeDeviceSessionArg revokeDeviceSessionArg) + public t.Task DevicesRevokeDeviceSessionAsync(RevokeDeviceSessionArg revokeDeviceSessionArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(revokeDeviceSessionArg, "api", "/team/devices/revoke_device_session", "team", global::Dropbox.Api.Team.RevokeDeviceSessionArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.RevokeDeviceSessionError.Decoder); + return this.Transport.SendRpcRequestAsync(revokeDeviceSessionArg, "api", "/team/devices/revoke_device_session", "team", global::Dropbox.Api.Team.RevokeDeviceSessionArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.RevokeDeviceSessionError.Decoder, cancellationToken); } /// @@ -433,14 +444,15 @@ public void EndDevicesRevokeDeviceSession(sys.IAsyncResult asyncResult) /// Revoke a list of device sessions of team members. /// /// 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 DevicesRevokeDeviceSessionBatchAsync(RevokeDeviceSessionBatchArg revokeDeviceSessionBatchArg) + public t.Task DevicesRevokeDeviceSessionBatchAsync(RevokeDeviceSessionBatchArg revokeDeviceSessionBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(revokeDeviceSessionBatchArg, "api", "/team/devices/revoke_device_session_batch", "team", global::Dropbox.Api.Team.RevokeDeviceSessionBatchArg.Encoder, global::Dropbox.Api.Team.RevokeDeviceSessionBatchResult.Decoder, global::Dropbox.Api.Team.RevokeDeviceSessionBatchError.Decoder); + return this.Transport.SendRpcRequestAsync(revokeDeviceSessionBatchArg, "api", "/team/devices/revoke_device_session_batch", "team", global::Dropbox.Api.Team.RevokeDeviceSessionBatchArg.Encoder, global::Dropbox.Api.Team.RevokeDeviceSessionBatchResult.Decoder, global::Dropbox.Api.Team.RevokeDeviceSessionBatchError.Decoder, cancellationToken); } /// @@ -464,16 +476,18 @@ public sys.IAsyncResult BeginDevicesRevokeDeviceSessionBatch(RevokeDeviceSession /// Revoke a list of device sessions of team members. /// /// The revoke devices + /// 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 DevicesRevokeDeviceSessionBatchAsync(col.IEnumerable revokeDevices) + public t.Task DevicesRevokeDeviceSessionBatchAsync(col.IEnumerable revokeDevices, + tr.CancellationToken cancellationToken = default) { var revokeDeviceSessionBatchArg = new RevokeDeviceSessionBatchArg(revokeDevices); - return this.DevicesRevokeDeviceSessionBatchAsync(revokeDeviceSessionBatchArg); + return this.DevicesRevokeDeviceSessionBatchAsync(revokeDeviceSessionBatchArg, cancellationToken); } /// @@ -523,14 +537,15 @@ public RevokeDeviceSessionBatchResult EndDevicesRevokeDeviceSessionBatch(sys.IAs /// Permission : Team information. /// /// 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 FeaturesGetValuesAsync(FeaturesGetValuesBatchArg featuresGetValuesBatchArg) + public t.Task FeaturesGetValuesAsync(FeaturesGetValuesBatchArg featuresGetValuesBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(featuresGetValuesBatchArg, "api", "/team/features/get_values", "team", global::Dropbox.Api.Team.FeaturesGetValuesBatchArg.Encoder, global::Dropbox.Api.Team.FeaturesGetValuesBatchResult.Decoder, global::Dropbox.Api.Team.FeaturesGetValuesBatchError.Decoder); + return this.Transport.SendRpcRequestAsync(featuresGetValuesBatchArg, "api", "/team/features/get_values", "team", global::Dropbox.Api.Team.FeaturesGetValuesBatchArg.Encoder, global::Dropbox.Api.Team.FeaturesGetValuesBatchResult.Decoder, global::Dropbox.Api.Team.FeaturesGetValuesBatchError.Decoder, cancellationToken); } /// @@ -557,16 +572,18 @@ public sys.IAsyncResult BeginFeaturesGetValues(FeaturesGetValuesBatchArg feature /// /// A list of features in . If the list is /// empty, this route will return . + /// 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 FeaturesGetValuesAsync(col.IEnumerable features) + public t.Task FeaturesGetValuesAsync(col.IEnumerable features, + tr.CancellationToken cancellationToken = default) { var featuresGetValuesBatchArg = new FeaturesGetValuesBatchArg(features); - return this.FeaturesGetValuesAsync(featuresGetValuesBatchArg); + return this.FeaturesGetValuesAsync(featuresGetValuesBatchArg, cancellationToken); } /// @@ -612,11 +629,12 @@ public FeaturesGetValuesBatchResult EndFeaturesGetValues(sys.IAsyncResult asyncR /// /// Retrieves information about a team. /// + /// 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 GetInfoAsync() + public t.Task GetInfoAsync(tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/team/get_info", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.Team.TeamGetInfoResult.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/team/get_info", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.Team.TeamGetInfoResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -657,14 +675,15 @@ public TeamGetInfoResult EndGetInfo(sys.IAsyncResult asyncResult) /// Permission : Team member management. /// /// 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 GroupsCreateAsync(GroupCreateArg groupCreateArg) + public t.Task GroupsCreateAsync(GroupCreateArg groupCreateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupCreateArg, "api", "/team/groups/create", "team", global::Dropbox.Api.Team.GroupCreateArg.Encoder, global::Dropbox.Api.Team.GroupFullInfo.Decoder, global::Dropbox.Api.Team.GroupCreateError.Decoder); + return this.Transport.SendRpcRequestAsync(groupCreateArg, "api", "/team/groups/create", "team", global::Dropbox.Api.Team.GroupCreateArg.Encoder, global::Dropbox.Api.Team.GroupFullInfo.Decoder, global::Dropbox.Api.Team.GroupCreateError.Decoder, cancellationToken); } /// @@ -693,6 +712,7 @@ public sys.IAsyncResult BeginGroupsCreate(GroupCreateArg groupCreateArg, sys.Asy /// external ID to the group. /// Whether the team can be managed by selected /// users, or only by team admins. + /// 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 @@ -701,14 +721,15 @@ public sys.IAsyncResult BeginGroupsCreate(GroupCreateArg groupCreateArg, sys.Asy public t.Task GroupsCreateAsync(string groupName, bool addCreatorAsOwner = false, string groupExternalId = null, - global::Dropbox.Api.TeamCommon.GroupManagementType groupManagementType = null) + global::Dropbox.Api.TeamCommon.GroupManagementType groupManagementType = null, + tr.CancellationToken cancellationToken = default) { var groupCreateArg = new GroupCreateArg(groupName, addCreatorAsOwner, groupExternalId, groupManagementType); - return this.GroupsCreateAsync(groupCreateArg); + return this.GroupsCreateAsync(groupCreateArg, cancellationToken); } /// @@ -770,14 +791,15 @@ public GroupFullInfo EndGroupsCreate(sys.IAsyncResult asyncResult) /// Permission : Team member management. /// /// 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 GroupsDeleteAsync(GroupSelector groupSelector) + public t.Task GroupsDeleteAsync(GroupSelector groupSelector, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupSelector, "api", "/team/groups/delete", "team", global::Dropbox.Api.Team.GroupSelector.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Team.GroupDeleteError.Decoder); + return this.Transport.SendRpcRequestAsync(groupSelector, "api", "/team/groups/delete", "team", global::Dropbox.Api.Team.GroupSelector.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Team.GroupDeleteError.Decoder, cancellationToken); } /// @@ -824,14 +846,15 @@ public sys.IAsyncResult BeginGroupsDelete(GroupSelector groupSelector, sys.Async /// Permission : Team Information. /// /// 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> GroupsGetInfoAsync(GroupsSelector groupsSelector) + public t.Task> GroupsGetInfoAsync(GroupsSelector groupsSelector, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, GroupsGetInfoError>(groupsSelector, "api", "/team/groups/get_info", "team", global::Dropbox.Api.Team.GroupsSelector.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.GroupsGetInfoItem.Decoder), global::Dropbox.Api.Team.GroupsGetInfoError.Decoder); + return this.Transport.SendRpcRequestAsync, GroupsGetInfoError>(groupsSelector, "api", "/team/groups/get_info", "team", global::Dropbox.Api.Team.GroupsSelector.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.GroupsGetInfoItem.Decoder), global::Dropbox.Api.Team.GroupsGetInfoError.Decoder, cancellationToken); } /// @@ -881,14 +904,15 @@ public col.List EndGroupsGetInfo(sys.IAsyncResult asyncResult /// Permission : Team member management. /// /// 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 GroupsJobStatusGetAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task GroupsJobStatusGetAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/groups/job_status/get", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Async.PollEmptyResult.Decoder, global::Dropbox.Api.Team.GroupsPollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/groups/job_status/get", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Async.PollEmptyResult.Decoder, global::Dropbox.Api.Team.GroupsPollError.Decoder, cancellationToken); } /// @@ -918,16 +942,18 @@ public sys.IAsyncResult BeginGroupsJobStatusGet(global::Dropbox.Api.Async.PollAr /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 GroupsJobStatusGetAsync(string asyncJobId) + public t.Task GroupsJobStatusGetAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.GroupsJobStatusGetAsync(pollArg); + return this.GroupsJobStatusGetAsync(pollArg, cancellationToken); } /// @@ -975,11 +1001,12 @@ public sys.IAsyncResult BeginGroupsJobStatusGet(string asyncJobId, /// Permission : Team Information. /// /// 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 GroupsListAsync(GroupsListArg groupsListArg) + public t.Task GroupsListAsync(GroupsListArg groupsListArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupsListArg, "api", "/team/groups/list", "team", global::Dropbox.Api.Team.GroupsListArg.Encoder, global::Dropbox.Api.Team.GroupsListResult.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(groupsListArg, "api", "/team/groups/list", "team", global::Dropbox.Api.Team.GroupsListArg.Encoder, global::Dropbox.Api.Team.GroupsListResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -1003,13 +1030,15 @@ public sys.IAsyncResult BeginGroupsList(GroupsListArg groupsListArg, sys.AsyncCa /// Permission : Team Information. /// /// Number of results to return per call. + /// 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 GroupsListAsync(uint limit = 1000) + public t.Task GroupsListAsync(uint limit = 1000, + tr.CancellationToken cancellationToken = default) { var groupsListArg = new GroupsListArg(limit); - return this.GroupsListAsync(groupsListArg); + return this.GroupsListAsync(groupsListArg, cancellationToken); } /// @@ -1055,14 +1084,15 @@ public GroupsListResult EndGroupsList(sys.IAsyncResult asyncResult) /// Permission : Team Information. /// /// 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 GroupsListContinueAsync(GroupsListContinueArg groupsListContinueArg) + public t.Task GroupsListContinueAsync(GroupsListContinueArg groupsListContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupsListContinueArg, "api", "/team/groups/list/continue", "team", global::Dropbox.Api.Team.GroupsListContinueArg.Encoder, global::Dropbox.Api.Team.GroupsListResult.Decoder, global::Dropbox.Api.Team.GroupsListContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(groupsListContinueArg, "api", "/team/groups/list/continue", "team", global::Dropbox.Api.Team.GroupsListContinueArg.Encoder, global::Dropbox.Api.Team.GroupsListResult.Decoder, global::Dropbox.Api.Team.GroupsListContinueError.Decoder, cancellationToken); } /// @@ -1089,16 +1119,18 @@ public sys.IAsyncResult BeginGroupsListContinue(GroupsListContinueArg groupsList /// /// Indicates from what point to get the next set of /// groups. + /// 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 GroupsListContinueAsync(string cursor) + public t.Task GroupsListContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var groupsListContinueArg = new GroupsListContinueArg(cursor); - return this.GroupsListContinueAsync(groupsListContinueArg); + return this.GroupsListContinueAsync(groupsListContinueArg, cancellationToken); } /// @@ -1150,14 +1182,15 @@ public GroupsListResult EndGroupsListContinue(sys.IAsyncResult asyncResult) /// Permission : Team member management. /// /// 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 GroupsMembersAddAsync(GroupMembersAddArg groupMembersAddArg) + public t.Task GroupsMembersAddAsync(GroupMembersAddArg groupMembersAddArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupMembersAddArg, "api", "/team/groups/members/add", "team", global::Dropbox.Api.Team.GroupMembersAddArg.Encoder, global::Dropbox.Api.Team.GroupMembersChangeResult.Decoder, global::Dropbox.Api.Team.GroupMembersAddError.Decoder); + return this.Transport.SendRpcRequestAsync(groupMembersAddArg, "api", "/team/groups/members/add", "team", global::Dropbox.Api.Team.GroupMembersAddArg.Encoder, global::Dropbox.Api.Team.GroupMembersChangeResult.Decoder, global::Dropbox.Api.Team.GroupMembersAddError.Decoder, cancellationToken); } /// @@ -1189,6 +1222,7 @@ public sys.IAsyncResult BeginGroupsMembersAdd(GroupMembersAddArg groupMembersAdd /// Whether to return the list of members in the group. /// Note that the default value will cause all the group members to be returned in the /// response. This may take a long time for large groups. + /// 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 @@ -1196,13 +1230,14 @@ public sys.IAsyncResult BeginGroupsMembersAdd(GroupMembersAddArg groupMembersAdd /// cref="GroupMembersAddError"/>. public t.Task GroupsMembersAddAsync(GroupSelector @group, col.IEnumerable members, - bool returnMembers = true) + bool returnMembers = true, + tr.CancellationToken cancellationToken = default) { var groupMembersAddArg = new GroupMembersAddArg(@group, members, returnMembers); - return this.GroupsMembersAddAsync(groupMembersAddArg); + return this.GroupsMembersAddAsync(groupMembersAddArg, cancellationToken); } /// @@ -1257,14 +1292,15 @@ public GroupMembersChangeResult EndGroupsMembersAdd(sys.IAsyncResult asyncResult /// Permission : Team Information. /// /// 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 GroupsMembersListAsync(GroupsMembersListArg groupsMembersListArg) + public t.Task GroupsMembersListAsync(GroupsMembersListArg groupsMembersListArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupsMembersListArg, "api", "/team/groups/members/list", "team", global::Dropbox.Api.Team.GroupsMembersListArg.Encoder, global::Dropbox.Api.Team.GroupsMembersListResult.Decoder, global::Dropbox.Api.Team.GroupSelectorError.Decoder); + return this.Transport.SendRpcRequestAsync(groupsMembersListArg, "api", "/team/groups/members/list", "team", global::Dropbox.Api.Team.GroupsMembersListArg.Encoder, global::Dropbox.Api.Team.GroupsMembersListResult.Decoder, global::Dropbox.Api.Team.GroupSelectorError.Decoder, cancellationToken); } /// @@ -1289,18 +1325,20 @@ public sys.IAsyncResult BeginGroupsMembersList(GroupsMembersListArg groupsMember /// /// The group whose members are to be listed. /// Number of results to return per call. + /// 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 GroupsMembersListAsync(GroupSelector @group, - uint limit = 1000) + uint limit = 1000, + tr.CancellationToken cancellationToken = default) { var groupsMembersListArg = new GroupsMembersListArg(@group, limit); - return this.GroupsMembersListAsync(groupsMembersListArg); + return this.GroupsMembersListAsync(groupsMembersListArg, cancellationToken); } /// @@ -1352,14 +1390,15 @@ public GroupsMembersListResult EndGroupsMembersList(sys.IAsyncResult asyncResult /// Permission : Team information. /// /// 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 GroupsMembersListContinueAsync(GroupsMembersListContinueArg groupsMembersListContinueArg) + public t.Task GroupsMembersListContinueAsync(GroupsMembersListContinueArg groupsMembersListContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupsMembersListContinueArg, "api", "/team/groups/members/list/continue", "team", global::Dropbox.Api.Team.GroupsMembersListContinueArg.Encoder, global::Dropbox.Api.Team.GroupsMembersListResult.Decoder, global::Dropbox.Api.Team.GroupsMembersListContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(groupsMembersListContinueArg, "api", "/team/groups/members/list/continue", "team", global::Dropbox.Api.Team.GroupsMembersListContinueArg.Encoder, global::Dropbox.Api.Team.GroupsMembersListResult.Decoder, global::Dropbox.Api.Team.GroupsMembersListContinueError.Decoder, cancellationToken); } /// @@ -1386,16 +1425,18 @@ public sys.IAsyncResult BeginGroupsMembersListContinue(GroupsMembersListContinue /// /// Indicates from what point to get the next set of /// groups. + /// 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 GroupsMembersListContinueAsync(string cursor) + public t.Task GroupsMembersListContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var groupsMembersListContinueArg = new GroupsMembersListContinueArg(cursor); - return this.GroupsMembersListContinueAsync(groupsMembersListContinueArg); + return this.GroupsMembersListContinueAsync(groupsMembersListContinueArg, cancellationToken); } /// @@ -1449,14 +1490,15 @@ public GroupsMembersListResult EndGroupsMembersListContinue(sys.IAsyncResult asy /// Permission : Team member management. /// /// 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 GroupsMembersRemoveAsync(GroupMembersRemoveArg groupMembersRemoveArg) + public t.Task GroupsMembersRemoveAsync(GroupMembersRemoveArg groupMembersRemoveArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupMembersRemoveArg, "api", "/team/groups/members/remove", "team", global::Dropbox.Api.Team.GroupMembersRemoveArg.Encoder, global::Dropbox.Api.Team.GroupMembersChangeResult.Decoder, global::Dropbox.Api.Team.GroupMembersRemoveError.Decoder); + return this.Transport.SendRpcRequestAsync(groupMembersRemoveArg, "api", "/team/groups/members/remove", "team", global::Dropbox.Api.Team.GroupMembersRemoveArg.Encoder, global::Dropbox.Api.Team.GroupMembersChangeResult.Decoder, global::Dropbox.Api.Team.GroupMembersRemoveError.Decoder, cancellationToken); } /// @@ -1490,6 +1532,7 @@ public sys.IAsyncResult BeginGroupsMembersRemove(GroupMembersRemoveArg groupMemb /// Whether to return the list of members in the group. /// Note that the default value will cause all the group members to be returned in the /// response. This may take a long time for large groups. + /// 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 @@ -1497,13 +1540,14 @@ public sys.IAsyncResult BeginGroupsMembersRemove(GroupMembersRemoveArg groupMemb /// cref="GroupMembersRemoveError"/>. public t.Task GroupsMembersRemoveAsync(GroupSelector @group, col.IEnumerable users, - bool returnMembers = true) + bool returnMembers = true, + tr.CancellationToken cancellationToken = default) { var groupMembersRemoveArg = new GroupMembersRemoveArg(@group, users, returnMembers); - return this.GroupsMembersRemoveAsync(groupMembersRemoveArg); + return this.GroupsMembersRemoveAsync(groupMembersRemoveArg, cancellationToken); } /// @@ -1558,14 +1602,15 @@ public GroupMembersChangeResult EndGroupsMembersRemove(sys.IAsyncResult asyncRes /// Permission : Team member management. /// /// 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> GroupsMembersSetAccessTypeAsync(GroupMembersSetAccessTypeArg groupMembersSetAccessTypeArg) + public t.Task> GroupsMembersSetAccessTypeAsync(GroupMembersSetAccessTypeArg groupMembersSetAccessTypeArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, GroupMemberSetAccessTypeError>(groupMembersSetAccessTypeArg, "api", "/team/groups/members/set_access_type", "team", global::Dropbox.Api.Team.GroupMembersSetAccessTypeArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.GroupsGetInfoItem.Decoder), global::Dropbox.Api.Team.GroupMemberSetAccessTypeError.Decoder); + return this.Transport.SendRpcRequestAsync, GroupMemberSetAccessTypeError>(groupMembersSetAccessTypeArg, "api", "/team/groups/members/set_access_type", "team", global::Dropbox.Api.Team.GroupMembersSetAccessTypeArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.GroupsGetInfoItem.Decoder), global::Dropbox.Api.Team.GroupMemberSetAccessTypeError.Decoder, cancellationToken); } /// @@ -1596,6 +1641,7 @@ public sys.IAsyncResult BeginGroupsMembersSetAccessType(GroupMembersSetAccessTyp /// Whether to return the list of members in the group. /// Note that the default value will cause all the group members to be returned in the /// response. This may take a long time for large groups. + /// 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 @@ -1604,14 +1650,15 @@ public sys.IAsyncResult BeginGroupsMembersSetAccessType(GroupMembersSetAccessTyp public t.Task> GroupsMembersSetAccessTypeAsync(GroupSelector @group, UserSelectorArg user, GroupAccessType accessType, - bool returnMembers = true) + bool returnMembers = true, + tr.CancellationToken cancellationToken = default) { var groupMembersSetAccessTypeArg = new GroupMembersSetAccessTypeArg(@group, user, accessType, returnMembers); - return this.GroupsMembersSetAccessTypeAsync(groupMembersSetAccessTypeArg); + return this.GroupsMembersSetAccessTypeAsync(groupMembersSetAccessTypeArg, cancellationToken); } /// @@ -1671,14 +1718,15 @@ public col.List EndGroupsMembersSetAccessType(sys.IAsyncResul /// Permission : Team member management. /// /// 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 GroupsUpdateAsync(GroupUpdateArgs groupUpdateArgs) + public t.Task GroupsUpdateAsync(GroupUpdateArgs groupUpdateArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(groupUpdateArgs, "api", "/team/groups/update", "team", global::Dropbox.Api.Team.GroupUpdateArgs.Encoder, global::Dropbox.Api.Team.GroupFullInfo.Decoder, global::Dropbox.Api.Team.GroupUpdateError.Decoder); + return this.Transport.SendRpcRequestAsync(groupUpdateArgs, "api", "/team/groups/update", "team", global::Dropbox.Api.Team.GroupUpdateArgs.Encoder, global::Dropbox.Api.Team.GroupFullInfo.Decoder, global::Dropbox.Api.Team.GroupUpdateError.Decoder, cancellationToken); } /// @@ -1712,6 +1760,7 @@ public sys.IAsyncResult BeginGroupsUpdate(GroupUpdateArgs groupUpdateArgs, sys.A /// empty string, the group's external id will be cleared. /// Set new group management type, if /// provided. + /// 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 @@ -1721,7 +1770,8 @@ public t.Task GroupsUpdateAsync(GroupSelector @group, bool returnMembers = true, string newGroupName = null, string newGroupExternalId = null, - global::Dropbox.Api.TeamCommon.GroupManagementType newGroupManagementType = null) + global::Dropbox.Api.TeamCommon.GroupManagementType newGroupManagementType = null, + tr.CancellationToken cancellationToken = default) { var groupUpdateArgs = new GroupUpdateArgs(@group, returnMembers, @@ -1729,7 +1779,7 @@ public t.Task GroupsUpdateAsync(GroupSelector @group, newGroupExternalId, newGroupManagementType); - return this.GroupsUpdateAsync(groupUpdateArgs); + return this.GroupsUpdateAsync(groupUpdateArgs, cancellationToken); } /// @@ -1795,14 +1845,15 @@ public GroupFullInfo EndGroupsUpdate(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 LegalHoldsCreatePolicyAsync(LegalHoldsPolicyCreateArg legalHoldsPolicyCreateArg) + public t.Task LegalHoldsCreatePolicyAsync(LegalHoldsPolicyCreateArg legalHoldsPolicyCreateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(legalHoldsPolicyCreateArg, "api", "/team/legal_holds/create_policy", "team", global::Dropbox.Api.Team.LegalHoldsPolicyCreateArg.Encoder, global::Dropbox.Api.Team.LegalHoldPolicy.Decoder, global::Dropbox.Api.Team.LegalHoldsPolicyCreateError.Decoder); + return this.Transport.SendRpcRequestAsync(legalHoldsPolicyCreateArg, "api", "/team/legal_holds/create_policy", "team", global::Dropbox.Api.Team.LegalHoldsPolicyCreateArg.Encoder, global::Dropbox.Api.Team.LegalHoldPolicy.Decoder, global::Dropbox.Api.Team.LegalHoldsPolicyCreateError.Decoder, cancellationToken); } /// @@ -1831,6 +1882,7 @@ public sys.IAsyncResult BeginLegalHoldsCreatePolicy(LegalHoldsPolicyCreateArg le /// A description of the legal hold policy. /// start date of the legal hold policy. /// end date of the legal hold policy. + /// 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 @@ -1840,7 +1892,8 @@ public t.Task LegalHoldsCreatePolicyAsync(string name, col.IEnumerable members, string description = null, sys.DateTime? startDate = null, - sys.DateTime? endDate = null) + sys.DateTime? endDate = null, + tr.CancellationToken cancellationToken = default) { var legalHoldsPolicyCreateArg = new LegalHoldsPolicyCreateArg(name, members, @@ -1848,7 +1901,7 @@ public t.Task LegalHoldsCreatePolicyAsync(string name, startDate, endDate); - return this.LegalHoldsCreatePolicyAsync(legalHoldsPolicyCreateArg); + return this.LegalHoldsCreatePolicyAsync(legalHoldsPolicyCreateArg, cancellationToken); } /// @@ -1908,14 +1961,15 @@ public LegalHoldPolicy EndLegalHoldsCreatePolicy(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 LegalHoldsGetPolicyAsync(LegalHoldsGetPolicyArg legalHoldsGetPolicyArg) + public t.Task LegalHoldsGetPolicyAsync(LegalHoldsGetPolicyArg legalHoldsGetPolicyArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(legalHoldsGetPolicyArg, "api", "/team/legal_holds/get_policy", "team", global::Dropbox.Api.Team.LegalHoldsGetPolicyArg.Encoder, global::Dropbox.Api.Team.LegalHoldPolicy.Decoder, global::Dropbox.Api.Team.LegalHoldsGetPolicyError.Decoder); + return this.Transport.SendRpcRequestAsync(legalHoldsGetPolicyArg, "api", "/team/legal_holds/get_policy", "team", global::Dropbox.Api.Team.LegalHoldsGetPolicyArg.Encoder, global::Dropbox.Api.Team.LegalHoldPolicy.Decoder, global::Dropbox.Api.Team.LegalHoldsGetPolicyError.Decoder, cancellationToken); } /// @@ -1940,16 +1994,18 @@ public sys.IAsyncResult BeginLegalHoldsGetPolicy(LegalHoldsGetPolicyArg legalHol /// Permission : Team member file access. /// /// The legal hold Id. + /// 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 LegalHoldsGetPolicyAsync(string id) + public t.Task LegalHoldsGetPolicyAsync(string id, + tr.CancellationToken cancellationToken = default) { var legalHoldsGetPolicyArg = new LegalHoldsGetPolicyArg(id); - return this.LegalHoldsGetPolicyAsync(legalHoldsGetPolicyArg); + return this.LegalHoldsGetPolicyAsync(legalHoldsGetPolicyArg, cancellationToken); } /// @@ -1997,14 +2053,15 @@ public LegalHoldPolicy EndLegalHoldsGetPolicy(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 LegalHoldsListHeldRevisionsAsync(LegalHoldsListHeldRevisionsArg legalHoldsListHeldRevisionsArg) + public t.Task LegalHoldsListHeldRevisionsAsync(LegalHoldsListHeldRevisionsArg legalHoldsListHeldRevisionsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(legalHoldsListHeldRevisionsArg, "api", "/team/legal_holds/list_held_revisions", "team", global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsArg.Encoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionResult.Decoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsError.Decoder); + return this.Transport.SendRpcRequestAsync(legalHoldsListHeldRevisionsArg, "api", "/team/legal_holds/list_held_revisions", "team", global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsArg.Encoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionResult.Decoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsError.Decoder, cancellationToken); } /// @@ -2030,16 +2087,18 @@ public sys.IAsyncResult BeginLegalHoldsListHeldRevisions(LegalHoldsListHeldRevis /// Permission : Team member file access. /// /// The legal hold Id. + /// 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 LegalHoldsListHeldRevisionsAsync(string id) + public t.Task LegalHoldsListHeldRevisionsAsync(string id, + tr.CancellationToken cancellationToken = default) { var legalHoldsListHeldRevisionsArg = new LegalHoldsListHeldRevisionsArg(id); - return this.LegalHoldsListHeldRevisionsAsync(legalHoldsListHeldRevisionsArg); + return this.LegalHoldsListHeldRevisionsAsync(legalHoldsListHeldRevisionsArg, cancellationToken); } /// @@ -2088,14 +2147,15 @@ public LegalHoldsListHeldRevisionResult EndLegalHoldsListHeldRevisions(sys.IAsyn /// Permission : Team member file access. /// /// 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 LegalHoldsListHeldRevisionsContinueAsync(LegalHoldsListHeldRevisionsContinueArg legalHoldsListHeldRevisionsContinueArg) + public t.Task LegalHoldsListHeldRevisionsContinueAsync(LegalHoldsListHeldRevisionsContinueArg legalHoldsListHeldRevisionsContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(legalHoldsListHeldRevisionsContinueArg, "api", "/team/legal_holds/list_held_revisions_continue", "team", global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsContinueArg.Encoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionResult.Decoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsError.Decoder); + return this.Transport.SendRpcRequestAsync(legalHoldsListHeldRevisionsContinueArg, "api", "/team/legal_holds/list_held_revisions_continue", "team", global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsContinueArg.Encoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionResult.Decoder, global::Dropbox.Api.Team.LegalHoldsListHeldRevisionsError.Decoder, cancellationToken); } /// @@ -2125,18 +2185,20 @@ public sys.IAsyncResult BeginLegalHoldsListHeldRevisionsContinue(LegalHoldsListH /// The cursor idicates where to continue reading file metadata /// entries for the next API call. When there are no more entries, the cursor will /// return none. + /// 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 LegalHoldsListHeldRevisionsContinueAsync(string id, - string cursor = null) + string cursor = null, + tr.CancellationToken cancellationToken = default) { var legalHoldsListHeldRevisionsContinueArg = new LegalHoldsListHeldRevisionsContinueArg(id, cursor); - return this.LegalHoldsListHeldRevisionsContinueAsync(legalHoldsListHeldRevisionsContinueArg); + return this.LegalHoldsListHeldRevisionsContinueAsync(legalHoldsListHeldRevisionsContinueArg, cancellationToken); } /// @@ -2190,14 +2252,15 @@ public LegalHoldsListHeldRevisionResult EndLegalHoldsListHeldRevisionsContinue(s /// Permission : Team member file access. /// /// 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 LegalHoldsListPoliciesAsync(LegalHoldsListPoliciesArg legalHoldsListPoliciesArg) + public t.Task LegalHoldsListPoliciesAsync(LegalHoldsListPoliciesArg legalHoldsListPoliciesArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(legalHoldsListPoliciesArg, "api", "/team/legal_holds/list_policies", "team", global::Dropbox.Api.Team.LegalHoldsListPoliciesArg.Encoder, global::Dropbox.Api.Team.LegalHoldsListPoliciesResult.Decoder, global::Dropbox.Api.Team.LegalHoldsListPoliciesError.Decoder); + return this.Transport.SendRpcRequestAsync(legalHoldsListPoliciesArg, "api", "/team/legal_holds/list_policies", "team", global::Dropbox.Api.Team.LegalHoldsListPoliciesArg.Encoder, global::Dropbox.Api.Team.LegalHoldsListPoliciesResult.Decoder, global::Dropbox.Api.Team.LegalHoldsListPoliciesError.Decoder, cancellationToken); } /// @@ -2222,16 +2285,18 @@ public sys.IAsyncResult BeginLegalHoldsListPolicies(LegalHoldsListPoliciesArg le /// Permission : Team member file access. /// /// Whether to return holds that were released. + /// 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 LegalHoldsListPoliciesAsync(bool includeReleased = false) + public t.Task LegalHoldsListPoliciesAsync(bool includeReleased = false, + tr.CancellationToken cancellationToken = default) { var legalHoldsListPoliciesArg = new LegalHoldsListPoliciesArg(includeReleased); - return this.LegalHoldsListPoliciesAsync(legalHoldsListPoliciesArg); + return this.LegalHoldsListPoliciesAsync(legalHoldsListPoliciesArg, cancellationToken); } /// @@ -2279,13 +2344,14 @@ public LegalHoldsListPoliciesResult EndLegalHoldsListPolicies(sys.IAsyncResult a /// Permission : Team member file access. /// /// 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 LegalHoldsReleasePolicyAsync(LegalHoldsPolicyReleaseArg legalHoldsPolicyReleaseArg) + public t.Task LegalHoldsReleasePolicyAsync(LegalHoldsPolicyReleaseArg legalHoldsPolicyReleaseArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(legalHoldsPolicyReleaseArg, "api", "/team/legal_holds/release_policy", "team", global::Dropbox.Api.Team.LegalHoldsPolicyReleaseArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.LegalHoldsPolicyReleaseError.Decoder); + return this.Transport.SendRpcRequestAsync(legalHoldsPolicyReleaseArg, "api", "/team/legal_holds/release_policy", "team", global::Dropbox.Api.Team.LegalHoldsPolicyReleaseArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.LegalHoldsPolicyReleaseError.Decoder, cancellationToken); } /// @@ -2310,15 +2376,17 @@ public sys.IAsyncResult BeginLegalHoldsReleasePolicy(LegalHoldsPolicyReleaseArg /// Permission : Team member file access. /// /// The legal hold Id. + /// 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 LegalHoldsReleasePolicyAsync(string id) + public t.Task LegalHoldsReleasePolicyAsync(string id, + tr.CancellationToken cancellationToken = default) { var legalHoldsPolicyReleaseArg = new LegalHoldsPolicyReleaseArg(id); - return this.LegalHoldsReleasePolicyAsync(legalHoldsPolicyReleaseArg); + return this.LegalHoldsReleasePolicyAsync(legalHoldsPolicyReleaseArg, cancellationToken); } /// @@ -2363,14 +2431,15 @@ public void EndLegalHoldsReleasePolicy(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 LegalHoldsUpdatePolicyAsync(LegalHoldsPolicyUpdateArg legalHoldsPolicyUpdateArg) + public t.Task LegalHoldsUpdatePolicyAsync(LegalHoldsPolicyUpdateArg legalHoldsPolicyUpdateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(legalHoldsPolicyUpdateArg, "api", "/team/legal_holds/update_policy", "team", global::Dropbox.Api.Team.LegalHoldsPolicyUpdateArg.Encoder, global::Dropbox.Api.Team.LegalHoldPolicy.Decoder, global::Dropbox.Api.Team.LegalHoldsPolicyUpdateError.Decoder); + return this.Transport.SendRpcRequestAsync(legalHoldsPolicyUpdateArg, "api", "/team/legal_holds/update_policy", "team", global::Dropbox.Api.Team.LegalHoldsPolicyUpdateArg.Encoder, global::Dropbox.Api.Team.LegalHoldPolicy.Decoder, global::Dropbox.Api.Team.LegalHoldsPolicyUpdateError.Decoder, cancellationToken); } /// @@ -2398,6 +2467,7 @@ public sys.IAsyncResult BeginLegalHoldsUpdatePolicy(LegalHoldsPolicyUpdateArg le /// Policy new name. /// Policy new description. /// List of team member IDs to apply the policy on. + /// 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 @@ -2406,14 +2476,15 @@ public sys.IAsyncResult BeginLegalHoldsUpdatePolicy(LegalHoldsPolicyUpdateArg le public t.Task LegalHoldsUpdatePolicyAsync(string id, string name = null, string description = null, - col.IEnumerable members = null) + col.IEnumerable members = null, + tr.CancellationToken cancellationToken = default) { var legalHoldsPolicyUpdateArg = new LegalHoldsPolicyUpdateArg(id, name, description, members); - return this.LegalHoldsUpdatePolicyAsync(legalHoldsPolicyUpdateArg); + return this.LegalHoldsUpdatePolicyAsync(legalHoldsPolicyUpdateArg, cancellationToken); } /// @@ -2469,14 +2540,15 @@ public LegalHoldPolicy EndLegalHoldsUpdatePolicy(sys.IAsyncResult asyncResult) /// Note, this endpoint does not list any team-linked applications. /// /// 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 LinkedAppsListMemberLinkedAppsAsync(ListMemberAppsArg listMemberAppsArg) + public t.Task LinkedAppsListMemberLinkedAppsAsync(ListMemberAppsArg listMemberAppsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listMemberAppsArg, "api", "/team/linked_apps/list_member_linked_apps", "team", global::Dropbox.Api.Team.ListMemberAppsArg.Encoder, global::Dropbox.Api.Team.ListMemberAppsResult.Decoder, global::Dropbox.Api.Team.ListMemberAppsError.Decoder); + return this.Transport.SendRpcRequestAsync(listMemberAppsArg, "api", "/team/linked_apps/list_member_linked_apps", "team", global::Dropbox.Api.Team.ListMemberAppsArg.Encoder, global::Dropbox.Api.Team.ListMemberAppsResult.Decoder, global::Dropbox.Api.Team.ListMemberAppsError.Decoder, cancellationToken); } /// @@ -2501,16 +2573,18 @@ public sys.IAsyncResult BeginLinkedAppsListMemberLinkedApps(ListMemberAppsArg li /// Note, this endpoint does not list any team-linked applications. /// /// The team member id. + /// 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 LinkedAppsListMemberLinkedAppsAsync(string teamMemberId) + public t.Task LinkedAppsListMemberLinkedAppsAsync(string teamMemberId, + tr.CancellationToken cancellationToken = default) { var listMemberAppsArg = new ListMemberAppsArg(teamMemberId); - return this.LinkedAppsListMemberLinkedAppsAsync(listMemberAppsArg); + return this.LinkedAppsListMemberLinkedAppsAsync(listMemberAppsArg, cancellationToken); } /// @@ -2558,14 +2632,15 @@ public ListMemberAppsResult EndLinkedAppsListMemberLinkedApps(sys.IAsyncResult a /// Note, this endpoint does not list any team-linked applications. /// /// 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 LinkedAppsListMembersLinkedAppsAsync(ListMembersAppsArg listMembersAppsArg) + public t.Task LinkedAppsListMembersLinkedAppsAsync(ListMembersAppsArg listMembersAppsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listMembersAppsArg, "api", "/team/linked_apps/list_members_linked_apps", "team", global::Dropbox.Api.Team.ListMembersAppsArg.Encoder, global::Dropbox.Api.Team.ListMembersAppsResult.Decoder, global::Dropbox.Api.Team.ListMembersAppsError.Decoder); + return this.Transport.SendRpcRequestAsync(listMembersAppsArg, "api", "/team/linked_apps/list_members_linked_apps", "team", global::Dropbox.Api.Team.ListMembersAppsArg.Encoder, global::Dropbox.Api.Team.ListMembersAppsResult.Decoder, global::Dropbox.Api.Team.ListMembersAppsError.Decoder, cancellationToken); } /// @@ -2594,16 +2669,18 @@ public sys.IAsyncResult BeginLinkedAppsListMembersLinkedApps(ListMembersAppsArg /// /> the cursor shouldn't be passed. Then, if the result of the call includes a /// cursor, the following requests should include the received cursors in order to /// receive the next sub list of the team applications. + /// 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 LinkedAppsListMembersLinkedAppsAsync(string cursor = null) + public t.Task LinkedAppsListMembersLinkedAppsAsync(string cursor = null, + tr.CancellationToken cancellationToken = default) { var listMembersAppsArg = new ListMembersAppsArg(cursor); - return this.LinkedAppsListMembersLinkedAppsAsync(listMembersAppsArg); + return this.LinkedAppsListMembersLinkedAppsAsync(listMembersAppsArg, cancellationToken); } /// @@ -2655,15 +2732,16 @@ public ListMembersAppsResult EndLinkedAppsListMembersLinkedApps(sys.IAsyncResult /// Note, this endpoint doesn't list any team-linked applications. /// /// 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 LinkedAppsListMembersLinkedAppsAsync instead.")] - public t.Task LinkedAppsListTeamLinkedAppsAsync(ListTeamAppsArg listTeamAppsArg) + public t.Task LinkedAppsListTeamLinkedAppsAsync(ListTeamAppsArg listTeamAppsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(listTeamAppsArg, "api", "/team/linked_apps/list_team_linked_apps", "team", global::Dropbox.Api.Team.ListTeamAppsArg.Encoder, global::Dropbox.Api.Team.ListTeamAppsResult.Decoder, global::Dropbox.Api.Team.ListTeamAppsError.Decoder); + return this.Transport.SendRpcRequestAsync(listTeamAppsArg, "api", "/team/linked_apps/list_team_linked_apps", "team", global::Dropbox.Api.Team.ListTeamAppsArg.Encoder, global::Dropbox.Api.Team.ListTeamAppsResult.Decoder, global::Dropbox.Api.Team.ListTeamAppsError.Decoder, cancellationToken); } /// @@ -2693,17 +2771,19 @@ public sys.IAsyncResult BeginLinkedAppsListTeamLinkedApps(ListTeamAppsArg listTe /// the cursor shouldn't be passed. Then, if the result of the call includes a cursor, /// the following requests should include the received cursors in order to receive the /// next sub list of the team applications. + /// 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 LinkedAppsListMembersLinkedAppsAsync instead.")] - public t.Task LinkedAppsListTeamLinkedAppsAsync(string cursor = null) + public t.Task LinkedAppsListTeamLinkedAppsAsync(string cursor = null, + tr.CancellationToken cancellationToken = default) { var listTeamAppsArg = new ListTeamAppsArg(cursor); - return this.LinkedAppsListTeamLinkedAppsAsync(listTeamAppsArg); + return this.LinkedAppsListTeamLinkedAppsAsync(listTeamAppsArg, cancellationToken); } /// @@ -2756,13 +2836,14 @@ public ListTeamAppsResult EndLinkedAppsListTeamLinkedApps(sys.IAsyncResult async /// Revoke a linked application of the team member. /// /// 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 LinkedAppsRevokeLinkedAppAsync(RevokeLinkedApiAppArg revokeLinkedApiAppArg) + public t.Task LinkedAppsRevokeLinkedAppAsync(RevokeLinkedApiAppArg revokeLinkedApiAppArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(revokeLinkedApiAppArg, "api", "/team/linked_apps/revoke_linked_app", "team", global::Dropbox.Api.Team.RevokeLinkedApiAppArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.RevokeLinkedAppError.Decoder); + return this.Transport.SendRpcRequestAsync(revokeLinkedApiAppArg, "api", "/team/linked_apps/revoke_linked_app", "team", global::Dropbox.Api.Team.RevokeLinkedApiAppArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.RevokeLinkedAppError.Decoder, cancellationToken); } /// @@ -2789,19 +2870,21 @@ public sys.IAsyncResult BeginLinkedAppsRevokeLinkedApp(RevokeLinkedApiAppArg rev /// The unique id of the member owning the device. /// This flag is not longer supported, the application /// dedicated folder (in case the application uses one) will be kept. + /// 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 LinkedAppsRevokeLinkedAppAsync(string appId, string teamMemberId, - bool keepAppFolder = true) + bool keepAppFolder = true, + tr.CancellationToken cancellationToken = default) { var revokeLinkedApiAppArg = new RevokeLinkedApiAppArg(appId, teamMemberId, keepAppFolder); - return this.LinkedAppsRevokeLinkedAppAsync(revokeLinkedApiAppArg); + return this.LinkedAppsRevokeLinkedAppAsync(revokeLinkedApiAppArg, cancellationToken); } /// @@ -2852,14 +2935,15 @@ public void EndLinkedAppsRevokeLinkedApp(sys.IAsyncResult asyncResult) /// Revoke a list of linked applications of the team members. /// /// 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 LinkedAppsRevokeLinkedAppBatchAsync(RevokeLinkedApiAppBatchArg revokeLinkedApiAppBatchArg) + public t.Task LinkedAppsRevokeLinkedAppBatchAsync(RevokeLinkedApiAppBatchArg revokeLinkedApiAppBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(revokeLinkedApiAppBatchArg, "api", "/team/linked_apps/revoke_linked_app_batch", "team", global::Dropbox.Api.Team.RevokeLinkedApiAppBatchArg.Encoder, global::Dropbox.Api.Team.RevokeLinkedAppBatchResult.Decoder, global::Dropbox.Api.Team.RevokeLinkedAppBatchError.Decoder); + return this.Transport.SendRpcRequestAsync(revokeLinkedApiAppBatchArg, "api", "/team/linked_apps/revoke_linked_app_batch", "team", global::Dropbox.Api.Team.RevokeLinkedApiAppBatchArg.Encoder, global::Dropbox.Api.Team.RevokeLinkedAppBatchResult.Decoder, global::Dropbox.Api.Team.RevokeLinkedAppBatchError.Decoder, cancellationToken); } /// @@ -2883,16 +2967,18 @@ public sys.IAsyncResult BeginLinkedAppsRevokeLinkedAppBatch(RevokeLinkedApiAppBa /// Revoke a list of linked applications of the team members. /// /// The revoke linked app + /// 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 LinkedAppsRevokeLinkedAppBatchAsync(col.IEnumerable revokeLinkedApp) + public t.Task LinkedAppsRevokeLinkedAppBatchAsync(col.IEnumerable revokeLinkedApp, + tr.CancellationToken cancellationToken = default) { var revokeLinkedApiAppBatchArg = new RevokeLinkedApiAppBatchArg(revokeLinkedApp); - return this.LinkedAppsRevokeLinkedAppBatchAsync(revokeLinkedApiAppBatchArg); + return this.LinkedAppsRevokeLinkedAppBatchAsync(revokeLinkedApiAppBatchArg, cancellationToken); } /// @@ -2939,14 +3025,15 @@ public RevokeLinkedAppBatchResult EndLinkedAppsRevokeLinkedAppBatch(sys.IAsyncRe /// Add users to member space limits excluded users list. /// /// 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 MemberSpaceLimitsExcludedUsersAddAsync(ExcludedUsersUpdateArg excludedUsersUpdateArg) + public t.Task MemberSpaceLimitsExcludedUsersAddAsync(ExcludedUsersUpdateArg excludedUsersUpdateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(excludedUsersUpdateArg, "api", "/team/member_space_limits/excluded_users/add", "team", global::Dropbox.Api.Team.ExcludedUsersUpdateArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersUpdateResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersUpdateError.Decoder); + return this.Transport.SendRpcRequestAsync(excludedUsersUpdateArg, "api", "/team/member_space_limits/excluded_users/add", "team", global::Dropbox.Api.Team.ExcludedUsersUpdateArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersUpdateResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersUpdateError.Decoder, cancellationToken); } /// @@ -2970,16 +3057,18 @@ public sys.IAsyncResult BeginMemberSpaceLimitsExcludedUsersAdd(ExcludedUsersUpda /// Add users to member space limits excluded users list. /// /// List of users to be added/removed. + /// 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 MemberSpaceLimitsExcludedUsersAddAsync(col.IEnumerable users = null) + public t.Task MemberSpaceLimitsExcludedUsersAddAsync(col.IEnumerable users = null, + tr.CancellationToken cancellationToken = default) { var excludedUsersUpdateArg = new ExcludedUsersUpdateArg(users); - return this.MemberSpaceLimitsExcludedUsersAddAsync(excludedUsersUpdateArg); + return this.MemberSpaceLimitsExcludedUsersAddAsync(excludedUsersUpdateArg, cancellationToken); } /// @@ -3026,14 +3115,15 @@ public ExcludedUsersUpdateResult EndMemberSpaceLimitsExcludedUsersAdd(sys.IAsync /// List member space limits excluded users. /// /// 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 MemberSpaceLimitsExcludedUsersListAsync(ExcludedUsersListArg excludedUsersListArg) + public t.Task MemberSpaceLimitsExcludedUsersListAsync(ExcludedUsersListArg excludedUsersListArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(excludedUsersListArg, "api", "/team/member_space_limits/excluded_users/list", "team", global::Dropbox.Api.Team.ExcludedUsersListArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersListResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersListError.Decoder); + return this.Transport.SendRpcRequestAsync(excludedUsersListArg, "api", "/team/member_space_limits/excluded_users/list", "team", global::Dropbox.Api.Team.ExcludedUsersListArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersListResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersListError.Decoder, cancellationToken); } /// @@ -3057,16 +3147,18 @@ public sys.IAsyncResult BeginMemberSpaceLimitsExcludedUsersList(ExcludedUsersLis /// List member space limits excluded users. /// /// Number of results to return per call. + /// 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 MemberSpaceLimitsExcludedUsersListAsync(uint limit = 1000) + public t.Task MemberSpaceLimitsExcludedUsersListAsync(uint limit = 1000, + tr.CancellationToken cancellationToken = default) { var excludedUsersListArg = new ExcludedUsersListArg(limit); - return this.MemberSpaceLimitsExcludedUsersListAsync(excludedUsersListArg); + return this.MemberSpaceLimitsExcludedUsersListAsync(excludedUsersListArg, cancellationToken); } /// @@ -3113,14 +3205,15 @@ public ExcludedUsersListResult EndMemberSpaceLimitsExcludedUsersList(sys.IAsyncR /// Continue listing member space limits excluded users. /// /// 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 MemberSpaceLimitsExcludedUsersListContinueAsync(ExcludedUsersListContinueArg excludedUsersListContinueArg) + public t.Task MemberSpaceLimitsExcludedUsersListContinueAsync(ExcludedUsersListContinueArg excludedUsersListContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(excludedUsersListContinueArg, "api", "/team/member_space_limits/excluded_users/list/continue", "team", global::Dropbox.Api.Team.ExcludedUsersListContinueArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersListResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersListContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(excludedUsersListContinueArg, "api", "/team/member_space_limits/excluded_users/list/continue", "team", global::Dropbox.Api.Team.ExcludedUsersListContinueArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersListResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersListContinueError.Decoder, cancellationToken); } /// @@ -3145,16 +3238,18 @@ public sys.IAsyncResult BeginMemberSpaceLimitsExcludedUsersListContinue(Excluded /// /// Indicates from what point to get the next set of /// users. + /// 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 MemberSpaceLimitsExcludedUsersListContinueAsync(string cursor) + public t.Task MemberSpaceLimitsExcludedUsersListContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var excludedUsersListContinueArg = new ExcludedUsersListContinueArg(cursor); - return this.MemberSpaceLimitsExcludedUsersListContinueAsync(excludedUsersListContinueArg); + return this.MemberSpaceLimitsExcludedUsersListContinueAsync(excludedUsersListContinueArg, cancellationToken); } /// @@ -3202,14 +3297,15 @@ public ExcludedUsersListResult EndMemberSpaceLimitsExcludedUsersListContinue(sys /// Remove users from member space limits excluded users list. /// /// 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 MemberSpaceLimitsExcludedUsersRemoveAsync(ExcludedUsersUpdateArg excludedUsersUpdateArg) + public t.Task MemberSpaceLimitsExcludedUsersRemoveAsync(ExcludedUsersUpdateArg excludedUsersUpdateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(excludedUsersUpdateArg, "api", "/team/member_space_limits/excluded_users/remove", "team", global::Dropbox.Api.Team.ExcludedUsersUpdateArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersUpdateResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersUpdateError.Decoder); + return this.Transport.SendRpcRequestAsync(excludedUsersUpdateArg, "api", "/team/member_space_limits/excluded_users/remove", "team", global::Dropbox.Api.Team.ExcludedUsersUpdateArg.Encoder, global::Dropbox.Api.Team.ExcludedUsersUpdateResult.Decoder, global::Dropbox.Api.Team.ExcludedUsersUpdateError.Decoder, cancellationToken); } /// @@ -3233,16 +3329,18 @@ public sys.IAsyncResult BeginMemberSpaceLimitsExcludedUsersRemove(ExcludedUsersU /// Remove users from member space limits excluded users list. /// /// List of users to be added/removed. + /// 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 MemberSpaceLimitsExcludedUsersRemoveAsync(col.IEnumerable users = null) + public t.Task MemberSpaceLimitsExcludedUsersRemoveAsync(col.IEnumerable users = null, + tr.CancellationToken cancellationToken = default) { var excludedUsersUpdateArg = new ExcludedUsersUpdateArg(users); - return this.MemberSpaceLimitsExcludedUsersRemoveAsync(excludedUsersUpdateArg); + return this.MemberSpaceLimitsExcludedUsersRemoveAsync(excludedUsersUpdateArg, cancellationToken); } /// @@ -3290,14 +3388,15 @@ public ExcludedUsersUpdateResult EndMemberSpaceLimitsExcludedUsersRemove(sys.IAs /// maximum of 1000 members can be specified in a single call. /// /// 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> MemberSpaceLimitsGetCustomQuotaAsync(CustomQuotaUsersArg customQuotaUsersArg) + public t.Task> MemberSpaceLimitsGetCustomQuotaAsync(CustomQuotaUsersArg customQuotaUsersArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, CustomQuotaError>(customQuotaUsersArg, "api", "/team/member_space_limits/get_custom_quota", "team", global::Dropbox.Api.Team.CustomQuotaUsersArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.CustomQuotaResult.Decoder), global::Dropbox.Api.Team.CustomQuotaError.Decoder); + return this.Transport.SendRpcRequestAsync, CustomQuotaError>(customQuotaUsersArg, "api", "/team/member_space_limits/get_custom_quota", "team", global::Dropbox.Api.Team.CustomQuotaUsersArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.CustomQuotaResult.Decoder), global::Dropbox.Api.Team.CustomQuotaError.Decoder, cancellationToken); } /// @@ -3322,16 +3421,18 @@ public sys.IAsyncResult BeginMemberSpaceLimitsGetCustomQuota(CustomQuotaUsersArg /// maximum of 1000 members can be specified in a single call. /// /// List of users. + /// 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> MemberSpaceLimitsGetCustomQuotaAsync(col.IEnumerable users) + public t.Task> MemberSpaceLimitsGetCustomQuotaAsync(col.IEnumerable users, + tr.CancellationToken cancellationToken = default) { var customQuotaUsersArg = new CustomQuotaUsersArg(users); - return this.MemberSpaceLimitsGetCustomQuotaAsync(customQuotaUsersArg); + return this.MemberSpaceLimitsGetCustomQuotaAsync(customQuotaUsersArg, cancellationToken); } /// @@ -3379,14 +3480,15 @@ public col.List EndMemberSpaceLimitsGetCustomQuota(sys.IAsync /// single call. /// /// 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> MemberSpaceLimitsRemoveCustomQuotaAsync(CustomQuotaUsersArg customQuotaUsersArg) + public t.Task> MemberSpaceLimitsRemoveCustomQuotaAsync(CustomQuotaUsersArg customQuotaUsersArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, CustomQuotaError>(customQuotaUsersArg, "api", "/team/member_space_limits/remove_custom_quota", "team", global::Dropbox.Api.Team.CustomQuotaUsersArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.RemoveCustomQuotaResult.Decoder), global::Dropbox.Api.Team.CustomQuotaError.Decoder); + return this.Transport.SendRpcRequestAsync, CustomQuotaError>(customQuotaUsersArg, "api", "/team/member_space_limits/remove_custom_quota", "team", global::Dropbox.Api.Team.CustomQuotaUsersArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.RemoveCustomQuotaResult.Decoder), global::Dropbox.Api.Team.CustomQuotaError.Decoder, cancellationToken); } /// @@ -3411,16 +3513,18 @@ public sys.IAsyncResult BeginMemberSpaceLimitsRemoveCustomQuota(CustomQuotaUsers /// single call. /// /// List of users. + /// 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> MemberSpaceLimitsRemoveCustomQuotaAsync(col.IEnumerable users) + public t.Task> MemberSpaceLimitsRemoveCustomQuotaAsync(col.IEnumerable users, + tr.CancellationToken cancellationToken = default) { var customQuotaUsersArg = new CustomQuotaUsersArg(users); - return this.MemberSpaceLimitsRemoveCustomQuotaAsync(customQuotaUsersArg); + return this.MemberSpaceLimitsRemoveCustomQuotaAsync(customQuotaUsersArg, cancellationToken); } /// @@ -3468,14 +3572,15 @@ public col.List EndMemberSpaceLimitsRemoveCustomQuota(s /// 1000 members can be specified in a single call. /// /// 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> MemberSpaceLimitsSetCustomQuotaAsync(SetCustomQuotaArg setCustomQuotaArg) + public t.Task> MemberSpaceLimitsSetCustomQuotaAsync(SetCustomQuotaArg setCustomQuotaArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, SetCustomQuotaError>(setCustomQuotaArg, "api", "/team/member_space_limits/set_custom_quota", "team", global::Dropbox.Api.Team.SetCustomQuotaArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.CustomQuotaResult.Decoder), global::Dropbox.Api.Team.SetCustomQuotaError.Decoder); + return this.Transport.SendRpcRequestAsync, SetCustomQuotaError>(setCustomQuotaArg, "api", "/team/member_space_limits/set_custom_quota", "team", global::Dropbox.Api.Team.SetCustomQuotaArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.CustomQuotaResult.Decoder), global::Dropbox.Api.Team.SetCustomQuotaError.Decoder, cancellationToken); } /// @@ -3500,16 +3605,18 @@ public sys.IAsyncResult BeginMemberSpaceLimitsSetCustomQuota(SetCustomQuotaArg s /// 1000 members can be specified in a single call. /// /// List of users and their custom quotas. + /// 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> MemberSpaceLimitsSetCustomQuotaAsync(col.IEnumerable usersAndQuotas) + public t.Task> MemberSpaceLimitsSetCustomQuotaAsync(col.IEnumerable usersAndQuotas, + tr.CancellationToken cancellationToken = default) { var setCustomQuotaArg = new SetCustomQuotaArg(usersAndQuotas); - return this.MemberSpaceLimitsSetCustomQuotaAsync(setCustomQuotaArg); + return this.MemberSpaceLimitsSetCustomQuotaAsync(setCustomQuotaArg, cancellationToken); } /// @@ -3568,11 +3675,12 @@ public col.List EndMemberSpaceLimitsSetCustomQuota(sys.IAsync /// actions taken on the user before they become 'active'. /// /// 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 MembersAddAsync(MembersAddArg membersAddArg) + public t.Task MembersAddAsync(MembersAddArg membersAddArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersAddArg, "api", "/team/members/add", "team", global::Dropbox.Api.Team.MembersAddArg.Encoder, global::Dropbox.Api.Team.MembersAddLaunch.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(membersAddArg, "api", "/team/members/add", "team", global::Dropbox.Api.Team.MembersAddArg.Encoder, global::Dropbox.Api.Team.MembersAddLaunch.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -3608,15 +3716,17 @@ public sys.IAsyncResult BeginMembersAdd(MembersAddArg membersAddArg, sys.AsyncCa /// /// Details of new members to be added to the team. /// Whether to force the add to happen asynchronously. + /// 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 MembersAddAsync(col.IEnumerable newMembers, - bool forceAsync = false) + bool forceAsync = false, + tr.CancellationToken cancellationToken = default) { var membersAddArg = new MembersAddArg(newMembers, forceAsync); - return this.MembersAddAsync(membersAddArg); + return this.MembersAddAsync(membersAddArg, cancellationToken); } /// @@ -3665,14 +3775,15 @@ public MembersAddLaunch EndMembersAdd(sys.IAsyncResult asyncResult) /// Permission : Team member management. /// /// 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 MembersAddJobStatusGetAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task MembersAddJobStatusGetAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/members/add/job_status/get", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Team.MembersAddJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/members/add/job_status/get", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Team.MembersAddJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -3699,16 +3810,18 @@ public sys.IAsyncResult BeginMembersAddJobStatusGet(global::Dropbox.Api.Async.Po /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 MembersAddJobStatusGetAsync(string asyncJobId) + public t.Task MembersAddJobStatusGetAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.MembersAddJobStatusGetAsync(pollArg); + return this.MembersAddJobStatusGetAsync(pollArg, cancellationToken); } /// @@ -3756,14 +3869,15 @@ public MembersAddJobStatus EndMembersAddJobStatusGet(sys.IAsyncResult asyncResul /// Permission : Team member management. /// /// 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 MembersDeleteProfilePhotoAsync(MembersDeleteProfilePhotoArg membersDeleteProfilePhotoArg) + public t.Task MembersDeleteProfilePhotoAsync(MembersDeleteProfilePhotoArg membersDeleteProfilePhotoArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersDeleteProfilePhotoArg, "api", "/team/members/delete_profile_photo", "team", global::Dropbox.Api.Team.MembersDeleteProfilePhotoArg.Encoder, global::Dropbox.Api.Team.TeamMemberInfo.Decoder, global::Dropbox.Api.Team.MembersDeleteProfilePhotoError.Decoder); + return this.Transport.SendRpcRequestAsync(membersDeleteProfilePhotoArg, "api", "/team/members/delete_profile_photo", "team", global::Dropbox.Api.Team.MembersDeleteProfilePhotoArg.Encoder, global::Dropbox.Api.Team.TeamMemberInfo.Decoder, global::Dropbox.Api.Team.MembersDeleteProfilePhotoError.Decoder, cancellationToken); } /// @@ -3788,16 +3902,18 @@ public sys.IAsyncResult BeginMembersDeleteProfilePhoto(MembersDeleteProfilePhoto /// /// Identity of the user whose profile photo will be /// deleted. + /// 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 MembersDeleteProfilePhotoAsync(UserSelectorArg user) + public t.Task MembersDeleteProfilePhotoAsync(UserSelectorArg user, + tr.CancellationToken cancellationToken = default) { var membersDeleteProfilePhotoArg = new MembersDeleteProfilePhotoArg(user); - return this.MembersDeleteProfilePhotoAsync(membersDeleteProfilePhotoArg); + return this.MembersDeleteProfilePhotoAsync(membersDeleteProfilePhotoArg, cancellationToken); } /// @@ -3848,14 +3964,15 @@ public TeamMemberInfo EndMembersDeleteProfilePhoto(sys.IAsyncResult asyncResult) /// cannot be matched to a valid team member. /// /// 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> MembersGetInfoAsync(MembersGetInfoArgs membersGetInfoArgs) + public t.Task> MembersGetInfoAsync(MembersGetInfoArgs membersGetInfoArgs, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, MembersGetInfoError>(membersGetInfoArgs, "api", "/team/members/get_info", "team", global::Dropbox.Api.Team.MembersGetInfoArgs.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.MembersGetInfoItem.Decoder), global::Dropbox.Api.Team.MembersGetInfoError.Decoder); + return this.Transport.SendRpcRequestAsync, MembersGetInfoError>(membersGetInfoArgs, "api", "/team/members/get_info", "team", global::Dropbox.Api.Team.MembersGetInfoArgs.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.MembersGetInfoItem.Decoder), global::Dropbox.Api.Team.MembersGetInfoError.Decoder, cancellationToken); } /// @@ -3882,16 +3999,18 @@ public sys.IAsyncResult BeginMembersGetInfo(MembersGetInfoArgs membersGetInfoArg /// cannot be matched to a valid team member. /// /// List of team members. + /// 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> MembersGetInfoAsync(col.IEnumerable members) + public t.Task> MembersGetInfoAsync(col.IEnumerable members, + tr.CancellationToken cancellationToken = default) { var membersGetInfoArgs = new MembersGetInfoArgs(members); - return this.MembersGetInfoAsync(membersGetInfoArgs); + return this.MembersGetInfoAsync(membersGetInfoArgs, cancellationToken); } /// @@ -3938,14 +4057,15 @@ public col.List EndMembersGetInfo(sys.IAsyncResult asyncResu /// Permission : Team information. /// /// 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 MembersListAsync(MembersListArg membersListArg) + public t.Task MembersListAsync(MembersListArg membersListArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersListArg, "api", "/team/members/list", "team", global::Dropbox.Api.Team.MembersListArg.Encoder, global::Dropbox.Api.Team.MembersListResult.Decoder, global::Dropbox.Api.Team.MembersListError.Decoder); + return this.Transport.SendRpcRequestAsync(membersListArg, "api", "/team/members/list", "team", global::Dropbox.Api.Team.MembersListArg.Encoder, global::Dropbox.Api.Team.MembersListResult.Decoder, global::Dropbox.Api.Team.MembersListError.Decoder, cancellationToken); } /// @@ -3970,18 +4090,20 @@ public sys.IAsyncResult BeginMembersList(MembersListArg membersListArg, sys.Asyn /// /// Number of results to return per call. /// Whether to return removed members. + /// 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 MembersListAsync(uint limit = 1000, - bool includeRemoved = false) + bool includeRemoved = false, + tr.CancellationToken cancellationToken = default) { var membersListArg = new MembersListArg(limit, includeRemoved); - return this.MembersListAsync(membersListArg); + return this.MembersListAsync(membersListArg, cancellationToken); } /// @@ -4033,14 +4155,15 @@ public MembersListResult EndMembersList(sys.IAsyncResult asyncResult) /// Permission : Team information. /// /// 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 MembersListContinueAsync(MembersListContinueArg membersListContinueArg) + public t.Task MembersListContinueAsync(MembersListContinueArg membersListContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersListContinueArg, "api", "/team/members/list/continue", "team", global::Dropbox.Api.Team.MembersListContinueArg.Encoder, global::Dropbox.Api.Team.MembersListResult.Decoder, global::Dropbox.Api.Team.MembersListContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(membersListContinueArg, "api", "/team/members/list/continue", "team", global::Dropbox.Api.Team.MembersListContinueArg.Encoder, global::Dropbox.Api.Team.MembersListResult.Decoder, global::Dropbox.Api.Team.MembersListContinueError.Decoder, cancellationToken); } /// @@ -4067,16 +4190,18 @@ public sys.IAsyncResult BeginMembersListContinue(MembersListContinueArg membersL /// /// Indicates from what point to get the next set of /// members. + /// 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 MembersListContinueAsync(string cursor) + public t.Task MembersListContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var membersListContinueArg = new MembersListContinueArg(cursor); - return this.MembersListContinueAsync(membersListContinueArg); + return this.MembersListContinueAsync(membersListContinueArg, cancellationToken); } /// @@ -4128,14 +4253,15 @@ public MembersListResult EndMembersListContinue(sys.IAsyncResult asyncResult) /// Permission : Team member management. /// /// 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 MembersMoveFormerMemberFilesAsync(MembersDataTransferArg membersDataTransferArg) + public t.Task MembersMoveFormerMemberFilesAsync(MembersDataTransferArg membersDataTransferArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersDataTransferArg, "api", "/team/members/move_former_member_files", "team", global::Dropbox.Api.Team.MembersDataTransferArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Team.MembersTransferFormerMembersFilesError.Decoder); + return this.Transport.SendRpcRequestAsync(membersDataTransferArg, "api", "/team/members/move_former_member_files", "team", global::Dropbox.Api.Team.MembersDataTransferArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Team.MembersTransferFormerMembersFilesError.Decoder, cancellationToken); } /// @@ -4169,6 +4295,7 @@ public sys.IAsyncResult BeginMembersMoveFormerMemberFiles(MembersDataTransferArg /// transferred to this user. /// Errors during the transfer process will be sent via /// email to 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 @@ -4176,13 +4303,14 @@ public sys.IAsyncResult BeginMembersMoveFormerMemberFiles(MembersDataTransferArg /// cref="MembersTransferFormerMembersFilesError"/>. public t.Task MembersMoveFormerMemberFilesAsync(UserSelectorArg user, UserSelectorArg transferDestId, - UserSelectorArg transferAdminId) + UserSelectorArg transferAdminId, + tr.CancellationToken cancellationToken = default) { var membersDataTransferArg = new MembersDataTransferArg(user, transferDestId, transferAdminId); - return this.MembersMoveFormerMemberFilesAsync(membersDataTransferArg); + return this.MembersMoveFormerMemberFilesAsync(membersDataTransferArg, cancellationToken); } /// @@ -4241,14 +4369,15 @@ public sys.IAsyncResult BeginMembersMoveFormerMemberFiles(UserSelectorArg user, /// Permission : Team member management. /// /// 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 MembersMoveFormerMemberFilesJobStatusCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task MembersMoveFormerMemberFilesJobStatusCheckAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/members/move_former_member_files/job_status/check", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Async.PollEmptyResult.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/members/move_former_member_files/job_status/check", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Async.PollEmptyResult.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -4276,16 +4405,18 @@ public sys.IAsyncResult BeginMembersMoveFormerMemberFilesJobStatusCheck(global:: /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 MembersMoveFormerMemberFilesJobStatusCheckAsync(string asyncJobId) + public t.Task MembersMoveFormerMemberFilesJobStatusCheckAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.MembersMoveFormerMemberFilesJobStatusCheckAsync(pollArg); + return this.MembersMoveFormerMemberFilesJobStatusCheckAsync(pollArg, cancellationToken); } /// @@ -4336,13 +4467,14 @@ public sys.IAsyncResult BeginMembersMoveFormerMemberFilesJobStatusCheck(string a /// identify the user account. /// /// 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 MembersRecoverAsync(MembersRecoverArg membersRecoverArg) + public t.Task MembersRecoverAsync(MembersRecoverArg membersRecoverArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersRecoverArg, "api", "/team/members/recover", "team", global::Dropbox.Api.Team.MembersRecoverArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersRecoverError.Decoder); + return this.Transport.SendRpcRequestAsync(membersRecoverArg, "api", "/team/members/recover", "team", global::Dropbox.Api.Team.MembersRecoverArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersRecoverError.Decoder, cancellationToken); } /// @@ -4368,15 +4500,17 @@ public sys.IAsyncResult BeginMembersRecover(MembersRecoverArg membersRecoverArg, /// identify the user account. /// /// Identity of user to recover. + /// 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 MembersRecoverAsync(UserSelectorArg user) + public t.Task MembersRecoverAsync(UserSelectorArg user, + tr.CancellationToken cancellationToken = default) { var membersRecoverArg = new MembersRecoverArg(user); - return this.MembersRecoverAsync(membersRecoverArg); + return this.MembersRecoverAsync(membersRecoverArg, cancellationToken); } /// @@ -4436,14 +4570,15 @@ public void EndMembersRecover(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 MembersRemoveAsync(MembersRemoveArg membersRemoveArg) + public t.Task MembersRemoveAsync(MembersRemoveArg membersRemoveArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersRemoveArg, "api", "/team/members/remove", "team", global::Dropbox.Api.Team.MembersRemoveArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Team.MembersRemoveError.Decoder); + return this.Transport.SendRpcRequestAsync(membersRemoveArg, "api", "/team/members/remove", "team", global::Dropbox.Api.Team.MembersRemoveArg.Encoder, global::Dropbox.Api.Async.LaunchEmptyResult.Decoder, global::Dropbox.Api.Team.MembersRemoveError.Decoder, cancellationToken); } /// @@ -4502,6 +4637,7 @@ public sys.IAsyncResult BeginMembersRemove(MembersRemoveArg membersRemoveArg, sy /// sharing relationships, the arguments should be set to /// false and should be set to /// true. + /// 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 @@ -4512,7 +4648,8 @@ public sys.IAsyncResult BeginMembersRemove(MembersRemoveArg membersRemoveArg, sy UserSelectorArg transferDestId = null, UserSelectorArg transferAdminId = null, bool keepAccount = false, - bool retainTeamShares = false) + bool retainTeamShares = false, + tr.CancellationToken cancellationToken = default) { var membersRemoveArg = new MembersRemoveArg(user, wipeData, @@ -4521,7 +4658,7 @@ public sys.IAsyncResult BeginMembersRemove(MembersRemoveArg membersRemoveArg, sy keepAccount, retainTeamShares); - return this.MembersRemoveAsync(membersRemoveArg); + return this.MembersRemoveAsync(membersRemoveArg, cancellationToken); } /// @@ -4599,14 +4736,15 @@ public sys.IAsyncResult BeginMembersRemove(UserSelectorArg user, /// Permission : Team member management. /// /// 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 MembersRemoveJobStatusGetAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task MembersRemoveJobStatusGetAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/members/remove/job_status/get", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Async.PollEmptyResult.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/members/remove/job_status/get", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Async.PollEmptyResult.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -4634,16 +4772,18 @@ public sys.IAsyncResult BeginMembersRemoveJobStatusGet(global::Dropbox.Api.Async /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 MembersRemoveJobStatusGetAsync(string asyncJobId) + public t.Task MembersRemoveJobStatusGetAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.MembersRemoveJobStatusGetAsync(pollArg); + return this.MembersRemoveJobStatusGetAsync(pollArg, cancellationToken); } /// @@ -4694,14 +4834,15 @@ public sys.IAsyncResult BeginMembersRemoveJobStatusGet(string asyncJobId, /// email address not on a verified domain a verification email will be sent. /// /// 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 MembersSecondaryEmailsAddAsync(AddSecondaryEmailsArg addSecondaryEmailsArg) + public t.Task MembersSecondaryEmailsAddAsync(AddSecondaryEmailsArg addSecondaryEmailsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(addSecondaryEmailsArg, "api", "/team/members/secondary_emails/add", "team", global::Dropbox.Api.Team.AddSecondaryEmailsArg.Encoder, global::Dropbox.Api.Team.AddSecondaryEmailsResult.Decoder, global::Dropbox.Api.Team.AddSecondaryEmailsError.Decoder); + return this.Transport.SendRpcRequestAsync(addSecondaryEmailsArg, "api", "/team/members/secondary_emails/add", "team", global::Dropbox.Api.Team.AddSecondaryEmailsArg.Encoder, global::Dropbox.Api.Team.AddSecondaryEmailsResult.Decoder, global::Dropbox.Api.Team.AddSecondaryEmailsError.Decoder, cancellationToken); } /// @@ -4727,16 +4868,18 @@ public sys.IAsyncResult BeginMembersSecondaryEmailsAdd(AddSecondaryEmailsArg add /// email address not on a verified domain a verification email will be sent. /// /// List of users and secondary emails to add. + /// 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 MembersSecondaryEmailsAddAsync(col.IEnumerable newSecondaryEmails) + public t.Task MembersSecondaryEmailsAddAsync(col.IEnumerable newSecondaryEmails, + tr.CancellationToken cancellationToken = default) { var addSecondaryEmailsArg = new AddSecondaryEmailsArg(newSecondaryEmails); - return this.MembersSecondaryEmailsAddAsync(addSecondaryEmailsArg); + return this.MembersSecondaryEmailsAddAsync(addSecondaryEmailsArg, cancellationToken); } /// @@ -4785,11 +4928,12 @@ public AddSecondaryEmailsResult EndMembersSecondaryEmailsAdd(sys.IAsyncResult as /// secondary email and their primary email. /// /// 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 MembersSecondaryEmailsDeleteAsync(DeleteSecondaryEmailsArg deleteSecondaryEmailsArg) + public t.Task MembersSecondaryEmailsDeleteAsync(DeleteSecondaryEmailsArg deleteSecondaryEmailsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(deleteSecondaryEmailsArg, "api", "/team/members/secondary_emails/delete", "team", global::Dropbox.Api.Team.DeleteSecondaryEmailsArg.Encoder, global::Dropbox.Api.Team.DeleteSecondaryEmailsResult.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(deleteSecondaryEmailsArg, "api", "/team/members/secondary_emails/delete", "team", global::Dropbox.Api.Team.DeleteSecondaryEmailsArg.Encoder, global::Dropbox.Api.Team.DeleteSecondaryEmailsResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -4817,13 +4961,15 @@ public sys.IAsyncResult BeginMembersSecondaryEmailsDelete(DeleteSecondaryEmailsA /// /// List of users and their secondary emails 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. - public t.Task MembersSecondaryEmailsDeleteAsync(col.IEnumerable emailsToDelete) + public t.Task MembersSecondaryEmailsDeleteAsync(col.IEnumerable emailsToDelete, + tr.CancellationToken cancellationToken = default) { var deleteSecondaryEmailsArg = new DeleteSecondaryEmailsArg(emailsToDelete); - return this.MembersSecondaryEmailsDeleteAsync(deleteSecondaryEmailsArg); + return this.MembersSecondaryEmailsDeleteAsync(deleteSecondaryEmailsArg, cancellationToken); } /// @@ -4869,11 +5015,12 @@ public DeleteSecondaryEmailsResult EndMembersSecondaryEmailsDelete(sys.IAsyncRes /// Permission : Team member management. /// /// 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 MembersSecondaryEmailsResendVerificationEmailsAsync(ResendVerificationEmailArg resendVerificationEmailArg) + public t.Task MembersSecondaryEmailsResendVerificationEmailsAsync(ResendVerificationEmailArg resendVerificationEmailArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(resendVerificationEmailArg, "api", "/team/members/secondary_emails/resend_verification_emails", "team", global::Dropbox.Api.Team.ResendVerificationEmailArg.Encoder, global::Dropbox.Api.Team.ResendVerificationEmailResult.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(resendVerificationEmailArg, "api", "/team/members/secondary_emails/resend_verification_emails", "team", global::Dropbox.Api.Team.ResendVerificationEmailArg.Encoder, global::Dropbox.Api.Team.ResendVerificationEmailResult.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -4899,13 +5046,15 @@ public sys.IAsyncResult BeginMembersSecondaryEmailsResendVerificationEmails(Rese /// /// List of users and secondary emails to resend /// verification emails to. + /// 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 MembersSecondaryEmailsResendVerificationEmailsAsync(col.IEnumerable emailsToResend) + public t.Task MembersSecondaryEmailsResendVerificationEmailsAsync(col.IEnumerable emailsToResend, + tr.CancellationToken cancellationToken = default) { var resendVerificationEmailArg = new ResendVerificationEmailArg(emailsToResend); - return this.MembersSecondaryEmailsResendVerificationEmailsAsync(resendVerificationEmailArg); + return this.MembersSecondaryEmailsResendVerificationEmailsAsync(resendVerificationEmailArg, cancellationToken); } /// @@ -4954,13 +5103,14 @@ public ResendVerificationEmailResult EndMembersSecondaryEmailsResendVerification /// No-op if team member is not pending. /// /// 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 MembersSendWelcomeEmailAsync(UserSelectorArg userSelectorArg) + public t.Task MembersSendWelcomeEmailAsync(UserSelectorArg userSelectorArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(userSelectorArg, "api", "/team/members/send_welcome_email", "team", global::Dropbox.Api.Team.UserSelectorArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersSendWelcomeError.Decoder); + return this.Transport.SendRpcRequestAsync(userSelectorArg, "api", "/team/members/send_welcome_email", "team", global::Dropbox.Api.Team.UserSelectorArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersSendWelcomeError.Decoder, cancellationToken); } /// @@ -5002,14 +5152,15 @@ public void EndMembersSendWelcomeEmail(sys.IAsyncResult asyncResult) /// Permission : Team member management. /// /// 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 MembersSetAdminPermissionsAsync(MembersSetPermissionsArg membersSetPermissionsArg) + public t.Task MembersSetAdminPermissionsAsync(MembersSetPermissionsArg membersSetPermissionsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersSetPermissionsArg, "api", "/team/members/set_admin_permissions", "team", global::Dropbox.Api.Team.MembersSetPermissionsArg.Encoder, global::Dropbox.Api.Team.MembersSetPermissionsResult.Decoder, global::Dropbox.Api.Team.MembersSetPermissionsError.Decoder); + return this.Transport.SendRpcRequestAsync(membersSetPermissionsArg, "api", "/team/members/set_admin_permissions", "team", global::Dropbox.Api.Team.MembersSetPermissionsArg.Encoder, global::Dropbox.Api.Team.MembersSetPermissionsResult.Decoder, global::Dropbox.Api.Team.MembersSetPermissionsError.Decoder, cancellationToken); } /// @@ -5035,18 +5186,20 @@ public sys.IAsyncResult BeginMembersSetAdminPermissions(MembersSetPermissionsArg /// /// Identity of user whose role will be set. /// The new role of the member. + /// 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 MembersSetAdminPermissionsAsync(UserSelectorArg user, - AdminTier newRole) + AdminTier newRole, + tr.CancellationToken cancellationToken = default) { var membersSetPermissionsArg = new MembersSetPermissionsArg(user, newRole); - return this.MembersSetAdminPermissionsAsync(membersSetPermissionsArg); + return this.MembersSetAdminPermissionsAsync(membersSetPermissionsArg, cancellationToken); } /// @@ -5097,14 +5250,15 @@ public MembersSetPermissionsResult EndMembersSetAdminPermissions(sys.IAsyncResul /// Permission : Team member management. /// /// 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 MembersSetProfileAsync(MembersSetProfileArg membersSetProfileArg) + public t.Task MembersSetProfileAsync(MembersSetProfileArg membersSetProfileArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersSetProfileArg, "api", "/team/members/set_profile", "team", global::Dropbox.Api.Team.MembersSetProfileArg.Encoder, global::Dropbox.Api.Team.TeamMemberInfo.Decoder, global::Dropbox.Api.Team.MembersSetProfileError.Decoder); + return this.Transport.SendRpcRequestAsync(membersSetProfileArg, "api", "/team/members/set_profile", "team", global::Dropbox.Api.Team.MembersSetProfileArg.Encoder, global::Dropbox.Api.Team.TeamMemberInfo.Decoder, global::Dropbox.Api.Team.MembersSetProfileError.Decoder, cancellationToken); } /// @@ -5136,6 +5290,7 @@ public sys.IAsyncResult BeginMembersSetProfile(MembersSetProfileArg membersSetPr /// using persistent ID SAML configuration. /// New value for whether the user is a /// directory restricted 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 @@ -5147,7 +5302,8 @@ public t.Task MembersSetProfileAsync(UserSelectorArg user, string newGivenName = null, string newSurname = null, string newPersistentId = null, - bool? newIsDirectoryRestricted = null) + bool? newIsDirectoryRestricted = null, + tr.CancellationToken cancellationToken = default) { var membersSetProfileArg = new MembersSetProfileArg(user, newEmail, @@ -5157,7 +5313,7 @@ public t.Task MembersSetProfileAsync(UserSelectorArg user, newPersistentId, newIsDirectoryRestricted); - return this.MembersSetProfileAsync(membersSetProfileArg); + return this.MembersSetProfileAsync(membersSetProfileArg, cancellationToken); } /// @@ -5224,14 +5380,15 @@ public TeamMemberInfo EndMembersSetProfile(sys.IAsyncResult asyncResult) /// Permission : Team member management. /// /// 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 MembersSetProfilePhotoAsync(MembersSetProfilePhotoArg membersSetProfilePhotoArg) + public t.Task MembersSetProfilePhotoAsync(MembersSetProfilePhotoArg membersSetProfilePhotoArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersSetProfilePhotoArg, "api", "/team/members/set_profile_photo", "team", global::Dropbox.Api.Team.MembersSetProfilePhotoArg.Encoder, global::Dropbox.Api.Team.TeamMemberInfo.Decoder, global::Dropbox.Api.Team.MembersSetProfilePhotoError.Decoder); + return this.Transport.SendRpcRequestAsync(membersSetProfilePhotoArg, "api", "/team/members/set_profile_photo", "team", global::Dropbox.Api.Team.MembersSetProfilePhotoArg.Encoder, global::Dropbox.Api.Team.TeamMemberInfo.Decoder, global::Dropbox.Api.Team.MembersSetProfilePhotoError.Decoder, cancellationToken); } /// @@ -5256,18 +5413,20 @@ public sys.IAsyncResult BeginMembersSetProfilePhoto(MembersSetProfilePhotoArg me /// /// Identity of the user whose profile photo will be set. /// Image to set as the member'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 MembersSetProfilePhotoAsync(UserSelectorArg user, - global::Dropbox.Api.Account.PhotoSourceArg photo) + global::Dropbox.Api.Account.PhotoSourceArg photo, + tr.CancellationToken cancellationToken = default) { var membersSetProfilePhotoArg = new MembersSetProfilePhotoArg(user, photo); - return this.MembersSetProfilePhotoAsync(membersSetProfilePhotoArg); + return this.MembersSetProfilePhotoAsync(membersSetProfilePhotoArg, cancellationToken); } /// @@ -5319,13 +5478,14 @@ public TeamMemberInfo EndMembersSetProfilePhoto(sys.IAsyncResult asyncResult) /// identify the user account. /// /// 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 MembersSuspendAsync(MembersDeactivateArg membersDeactivateArg) + public t.Task MembersSuspendAsync(MembersDeactivateArg membersDeactivateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersDeactivateArg, "api", "/team/members/suspend", "team", global::Dropbox.Api.Team.MembersDeactivateArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersSuspendError.Decoder); + return this.Transport.SendRpcRequestAsync(membersDeactivateArg, "api", "/team/members/suspend", "team", global::Dropbox.Api.Team.MembersDeactivateArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersSuspendError.Decoder, cancellationToken); } /// @@ -5354,17 +5514,19 @@ public sys.IAsyncResult BeginMembersSuspend(MembersDeactivateArg membersDeactiva /// moved. /// If provided, controls if the user's data will be deleted on /// their linked devices. + /// 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 MembersSuspendAsync(UserSelectorArg user, - bool wipeData = true) + bool wipeData = true, + tr.CancellationToken cancellationToken = default) { var membersDeactivateArg = new MembersDeactivateArg(user, wipeData); - return this.MembersSuspendAsync(membersDeactivateArg); + return this.MembersSuspendAsync(membersDeactivateArg, cancellationToken); } /// @@ -5415,13 +5577,14 @@ public void EndMembersSuspend(sys.IAsyncResult asyncResult) /// identify the user account. /// /// 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 MembersUnsuspendAsync(MembersUnsuspendArg membersUnsuspendArg) + public t.Task MembersUnsuspendAsync(MembersUnsuspendArg membersUnsuspendArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(membersUnsuspendArg, "api", "/team/members/unsuspend", "team", global::Dropbox.Api.Team.MembersUnsuspendArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersUnsuspendError.Decoder); + return this.Transport.SendRpcRequestAsync(membersUnsuspendArg, "api", "/team/members/unsuspend", "team", global::Dropbox.Api.Team.MembersUnsuspendArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.MembersUnsuspendError.Decoder, cancellationToken); } /// @@ -5447,15 +5610,17 @@ public sys.IAsyncResult BeginMembersUnsuspend(MembersUnsuspendArg membersUnsuspe /// identify the user account. /// /// Identity of user to unsuspend. + /// 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 MembersUnsuspendAsync(UserSelectorArg user) + public t.Task MembersUnsuspendAsync(UserSelectorArg user, + tr.CancellationToken cancellationToken = default) { var membersUnsuspendArg = new MembersUnsuspendArg(user); - return this.MembersUnsuspendAsync(membersUnsuspendArg); + return this.MembersUnsuspendAsync(membersUnsuspendArg, cancellationToken); } /// @@ -5502,14 +5667,15 @@ public void EndMembersUnsuspend(sys.IAsyncResult asyncResult) /// other teams. Duplicates may occur in the list. /// /// 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 NamespacesListAsync(TeamNamespacesListArg teamNamespacesListArg) + public t.Task NamespacesListAsync(TeamNamespacesListArg teamNamespacesListArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamNamespacesListArg, "api", "/team/namespaces/list", "team", global::Dropbox.Api.Team.TeamNamespacesListArg.Encoder, global::Dropbox.Api.Team.TeamNamespacesListResult.Decoder, global::Dropbox.Api.Team.TeamNamespacesListError.Decoder); + return this.Transport.SendRpcRequestAsync(teamNamespacesListArg, "api", "/team/namespaces/list", "team", global::Dropbox.Api.Team.TeamNamespacesListArg.Encoder, global::Dropbox.Api.Team.TeamNamespacesListResult.Decoder, global::Dropbox.Api.Team.TeamNamespacesListError.Decoder, cancellationToken); } /// @@ -5536,16 +5702,18 @@ public sys.IAsyncResult BeginNamespacesList(TeamNamespacesListArg teamNamespaces /// other teams. Duplicates may occur in the list. /// /// Specifying a value here has no effect. + /// 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 NamespacesListAsync(uint limit = 1000) + public t.Task NamespacesListAsync(uint limit = 1000, + tr.CancellationToken cancellationToken = default) { var teamNamespacesListArg = new TeamNamespacesListArg(limit); - return this.NamespacesListAsync(teamNamespacesListArg); + return this.NamespacesListAsync(teamNamespacesListArg, cancellationToken); } /// @@ -5594,14 +5762,15 @@ public TeamNamespacesListResult EndNamespacesList(sys.IAsyncResult asyncResult) /// list. /// /// 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 NamespacesListContinueAsync(TeamNamespacesListContinueArg teamNamespacesListContinueArg) + public t.Task NamespacesListContinueAsync(TeamNamespacesListContinueArg teamNamespacesListContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamNamespacesListContinueArg, "api", "/team/namespaces/list/continue", "team", global::Dropbox.Api.Team.TeamNamespacesListContinueArg.Encoder, global::Dropbox.Api.Team.TeamNamespacesListResult.Decoder, global::Dropbox.Api.Team.TeamNamespacesListContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(teamNamespacesListContinueArg, "api", "/team/namespaces/list/continue", "team", global::Dropbox.Api.Team.TeamNamespacesListContinueArg.Encoder, global::Dropbox.Api.Team.TeamNamespacesListResult.Decoder, global::Dropbox.Api.Team.TeamNamespacesListContinueError.Decoder, cancellationToken); } /// @@ -5628,16 +5797,18 @@ public sys.IAsyncResult BeginNamespacesListContinue(TeamNamespacesListContinueAr /// /// Indicates from what point to get the next set of /// team-accessible namespaces. + /// 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 NamespacesListContinueAsync(string cursor) + public t.Task NamespacesListContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var teamNamespacesListContinueArg = new TeamNamespacesListContinueArg(cursor); - return this.NamespacesListContinueAsync(teamNamespacesListContinueArg); + return this.NamespacesListContinueAsync(teamNamespacesListContinueArg, cancellationToken); } /// @@ -5684,15 +5855,16 @@ public TeamNamespacesListResult EndNamespacesListContinue(sys.IAsyncResult async /// Permission : Team member file access. /// /// 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")] - public t.Task PropertiesTemplateAddAsync(global::Dropbox.Api.FileProperties.AddTemplateArg addTemplateArg) + public t.Task PropertiesTemplateAddAsync(global::Dropbox.Api.FileProperties.AddTemplateArg addTemplateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(addTemplateArg, "api", "/team/properties/template/add", "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", "/team/properties/template/add", "team", global::Dropbox.Api.FileProperties.AddTemplateArg.Encoder, global::Dropbox.Api.FileProperties.AddTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder, cancellationToken); } /// @@ -5721,6 +5893,7 @@ public sys.IAsyncResult BeginPropertiesTemplateAdd(global::Dropbox.Api.FilePrope /// 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 @@ -5729,13 +5902,14 @@ public sys.IAsyncResult BeginPropertiesTemplateAdd(global::Dropbox.Api.FilePrope [sys.Obsolete("This function is deprecated")] public t.Task PropertiesTemplateAddAsync(string name, string description, - col.IEnumerable fields) + col.IEnumerable fields, + tr.CancellationToken cancellationToken = default) { var addTemplateArg = new global::Dropbox.Api.FileProperties.AddTemplateArg(name, description, fields); - return this.PropertiesTemplateAddAsync(addTemplateArg); + return this.PropertiesTemplateAddAsync(addTemplateArg, cancellationToken); } /// @@ -5792,15 +5966,16 @@ public sys.IAsyncResult BeginPropertiesTemplateAdd(string name, /// Permission : Team member file access. /// /// 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")] - public t.Task PropertiesTemplateGetAsync(global::Dropbox.Api.FileProperties.GetTemplateArg getTemplateArg) + public t.Task PropertiesTemplateGetAsync(global::Dropbox.Api.FileProperties.GetTemplateArg getTemplateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getTemplateArg, "api", "/team/properties/template/get", "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", "/team/properties/template/get", "team", global::Dropbox.Api.FileProperties.GetTemplateArg.Encoder, global::Dropbox.Api.FileProperties.GetTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken); } /// @@ -5828,17 +6003,19 @@ public sys.IAsyncResult BeginPropertiesTemplateGet(global::Dropbox.Api.FilePrope /// /> 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 . [sys.Obsolete("This function is deprecated")] - public t.Task PropertiesTemplateGetAsync(string templateId) + public t.Task PropertiesTemplateGetAsync(string templateId, + tr.CancellationToken cancellationToken = default) { var getTemplateArg = new global::Dropbox.Api.FileProperties.GetTemplateArg(templateId); - return this.PropertiesTemplateGetAsync(getTemplateArg); + return this.PropertiesTemplateGetAsync(getTemplateArg, cancellationToken); } /// @@ -5889,15 +6066,16 @@ public sys.IAsyncResult BeginPropertiesTemplateGet(string templateId, /// /// Permission : Team member file access. /// + /// 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")] - public t.Task PropertiesTemplateListAsync() + public t.Task PropertiesTemplateListAsync(tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/team/properties/template/list", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder); + return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/team/properties/template/list", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.FileProperties.ListTemplateResult.Decoder, global::Dropbox.Api.FileProperties.TemplateError.Decoder, cancellationToken); } /// @@ -5942,15 +6120,16 @@ public sys.IAsyncResult BeginPropertiesTemplateList(sys.AsyncCallback callback, /// Permission : Team member file access. /// /// 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")] - public t.Task PropertiesTemplateUpdateAsync(global::Dropbox.Api.FileProperties.UpdateTemplateArg updateTemplateArg) + public t.Task PropertiesTemplateUpdateAsync(global::Dropbox.Api.FileProperties.UpdateTemplateArg updateTemplateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(updateTemplateArg, "api", "/team/properties/template/update", "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", "/team/properties/template/update", "team", global::Dropbox.Api.FileProperties.UpdateTemplateArg.Encoder, global::Dropbox.Api.FileProperties.UpdateTemplateResult.Decoder, global::Dropbox.Api.FileProperties.ModifyTemplateError.Decoder, cancellationToken); } /// @@ -5984,6 +6163,7 @@ public sys.IAsyncResult BeginPropertiesTemplateUpdate(global::Dropbox.Api.FilePr /// 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 @@ -5993,14 +6173,15 @@ public sys.IAsyncResult BeginPropertiesTemplateUpdate(global::Dropbox.Api.FilePr public t.Task PropertiesTemplateUpdateAsync(string templateId, string name = null, string description = null, - col.IEnumerable addFields = null) + col.IEnumerable addFields = null, + tr.CancellationToken cancellationToken = default) { var updateTemplateArg = new global::Dropbox.Api.FileProperties.UpdateTemplateArg(templateId, name, description, addFields); - return this.PropertiesTemplateUpdateAsync(updateTemplateArg); + return this.PropertiesTemplateUpdateAsync(updateTemplateArg, cancellationToken); } /// @@ -6064,15 +6245,16 @@ public sys.IAsyncResult BeginPropertiesTemplateUpdate(string templateId, /// Retrieves reporting data about a team's user activity. /// /// 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")] - public t.Task ReportsGetActivityAsync(DateRange dateRange) + public t.Task ReportsGetActivityAsync(DateRange dateRange, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_activity", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetActivityReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder); + return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_activity", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetActivityReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder, cancellationToken); } /// @@ -6098,6 +6280,7 @@ public sys.IAsyncResult BeginReportsGetActivity(DateRange dateRange, sys.AsyncCa /// Optional starting date (inclusive). If start_date is None /// or too long ago, this field will be set to 6 months ago. /// Optional ending date (exclusive). + /// 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 @@ -6105,12 +6288,13 @@ public sys.IAsyncResult BeginReportsGetActivity(DateRange dateRange, sys.AsyncCa /// cref="DateRangeError"/>. [sys.Obsolete("This function is deprecated")] public t.Task ReportsGetActivityAsync(sys.DateTime? startDate = null, - sys.DateTime? endDate = null) + sys.DateTime? endDate = null, + tr.CancellationToken cancellationToken = default) { var dateRange = new DateRange(startDate, endDate); - return this.ReportsGetActivityAsync(dateRange); + return this.ReportsGetActivityAsync(dateRange, cancellationToken); } /// @@ -6162,15 +6346,16 @@ public GetActivityReport EndReportsGetActivity(sys.IAsyncResult asyncResult) /// Retrieves reporting data about a team's linked devices. /// /// 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")] - public t.Task ReportsGetDevicesAsync(DateRange dateRange) + public t.Task ReportsGetDevicesAsync(DateRange dateRange, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_devices", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetDevicesReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder); + return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_devices", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetDevicesReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder, cancellationToken); } /// @@ -6196,6 +6381,7 @@ public sys.IAsyncResult BeginReportsGetDevices(DateRange dateRange, sys.AsyncCal /// Optional starting date (inclusive). If start_date is None /// or too long ago, this field will be set to 6 months ago. /// Optional ending date (exclusive). + /// 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 @@ -6203,12 +6389,13 @@ public sys.IAsyncResult BeginReportsGetDevices(DateRange dateRange, sys.AsyncCal /// cref="DateRangeError"/>. [sys.Obsolete("This function is deprecated")] public t.Task ReportsGetDevicesAsync(sys.DateTime? startDate = null, - sys.DateTime? endDate = null) + sys.DateTime? endDate = null, + tr.CancellationToken cancellationToken = default) { var dateRange = new DateRange(startDate, endDate); - return this.ReportsGetDevicesAsync(dateRange); + return this.ReportsGetDevicesAsync(dateRange, cancellationToken); } /// @@ -6260,15 +6447,16 @@ public GetDevicesReport EndReportsGetDevices(sys.IAsyncResult asyncResult) /// Retrieves reporting data about a team's membership. /// /// 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")] - public t.Task ReportsGetMembershipAsync(DateRange dateRange) + public t.Task ReportsGetMembershipAsync(DateRange dateRange, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_membership", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetMembershipReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder); + return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_membership", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetMembershipReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder, cancellationToken); } /// @@ -6294,6 +6482,7 @@ public sys.IAsyncResult BeginReportsGetMembership(DateRange dateRange, sys.Async /// Optional starting date (inclusive). If start_date is None /// or too long ago, this field will be set to 6 months ago. /// Optional ending date (exclusive). + /// 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 @@ -6301,12 +6490,13 @@ public sys.IAsyncResult BeginReportsGetMembership(DateRange dateRange, sys.Async /// cref="DateRangeError"/>. [sys.Obsolete("This function is deprecated")] public t.Task ReportsGetMembershipAsync(sys.DateTime? startDate = null, - sys.DateTime? endDate = null) + sys.DateTime? endDate = null, + tr.CancellationToken cancellationToken = default) { var dateRange = new DateRange(startDate, endDate); - return this.ReportsGetMembershipAsync(dateRange); + return this.ReportsGetMembershipAsync(dateRange, cancellationToken); } /// @@ -6358,15 +6548,16 @@ public GetMembershipReport EndReportsGetMembership(sys.IAsyncResult asyncResult) /// Retrieves reporting data about a team's storage usage. /// /// 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")] - public t.Task ReportsGetStorageAsync(DateRange dateRange) + public t.Task ReportsGetStorageAsync(DateRange dateRange, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_storage", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetStorageReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder); + return this.Transport.SendRpcRequestAsync(dateRange, "api", "/team/reports/get_storage", "team", global::Dropbox.Api.Team.DateRange.Encoder, global::Dropbox.Api.Team.GetStorageReport.Decoder, global::Dropbox.Api.Team.DateRangeError.Decoder, cancellationToken); } /// @@ -6392,6 +6583,7 @@ public sys.IAsyncResult BeginReportsGetStorage(DateRange dateRange, sys.AsyncCal /// Optional starting date (inclusive). If start_date is None /// or too long ago, this field will be set to 6 months ago. /// Optional ending date (exclusive). + /// 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 @@ -6399,12 +6591,13 @@ public sys.IAsyncResult BeginReportsGetStorage(DateRange dateRange, sys.AsyncCal /// cref="DateRangeError"/>. [sys.Obsolete("This function is deprecated")] public t.Task ReportsGetStorageAsync(sys.DateTime? startDate = null, - sys.DateTime? endDate = null) + sys.DateTime? endDate = null, + tr.CancellationToken cancellationToken = default) { var dateRange = new DateRange(startDate, endDate); - return this.ReportsGetStorageAsync(dateRange); + return this.ReportsGetStorageAsync(dateRange, cancellationToken); } /// @@ -6457,14 +6650,15 @@ public GetStorageReport EndReportsGetStorage(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 TeamFolderActivateAsync(TeamFolderIdArg teamFolderIdArg) + public t.Task TeamFolderActivateAsync(TeamFolderIdArg teamFolderIdArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderIdArg, "api", "/team/team_folder/activate", "team", global::Dropbox.Api.Team.TeamFolderIdArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderActivateError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderIdArg, "api", "/team/team_folder/activate", "team", global::Dropbox.Api.Team.TeamFolderIdArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderActivateError.Decoder, cancellationToken); } /// @@ -6488,16 +6682,18 @@ public sys.IAsyncResult BeginTeamFolderActivate(TeamFolderIdArg teamFolderIdArg, /// Permission : Team member file access. /// /// The ID of the team 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 TeamFolderActivateAsync(string teamFolderId) + public t.Task TeamFolderActivateAsync(string teamFolderId, + tr.CancellationToken cancellationToken = default) { var teamFolderIdArg = new TeamFolderIdArg(teamFolderId); - return this.TeamFolderActivateAsync(teamFolderIdArg); + return this.TeamFolderActivateAsync(teamFolderIdArg, cancellationToken); } /// @@ -6545,14 +6741,15 @@ public TeamFolderMetadata EndTeamFolderActivate(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 TeamFolderArchiveAsync(TeamFolderArchiveArg teamFolderArchiveArg) + public t.Task TeamFolderArchiveAsync(TeamFolderArchiveArg teamFolderArchiveArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderArchiveArg, "api", "/team/team_folder/archive", "team", global::Dropbox.Api.Team.TeamFolderArchiveArg.Encoder, global::Dropbox.Api.Team.TeamFolderArchiveLaunch.Decoder, global::Dropbox.Api.Team.TeamFolderArchiveError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderArchiveArg, "api", "/team/team_folder/archive", "team", global::Dropbox.Api.Team.TeamFolderArchiveArg.Encoder, global::Dropbox.Api.Team.TeamFolderArchiveLaunch.Decoder, global::Dropbox.Api.Team.TeamFolderArchiveError.Decoder, cancellationToken); } /// @@ -6579,18 +6776,20 @@ public sys.IAsyncResult BeginTeamFolderArchive(TeamFolderArchiveArg teamFolderAr /// The ID of the team folder. /// Whether to force the archive to happen /// synchronously. + /// 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 TeamFolderArchiveAsync(string teamFolderId, - bool forceAsyncOff = false) + bool forceAsyncOff = false, + tr.CancellationToken cancellationToken = default) { var teamFolderArchiveArg = new TeamFolderArchiveArg(teamFolderId, forceAsyncOff); - return this.TeamFolderArchiveAsync(teamFolderArchiveArg); + return this.TeamFolderArchiveAsync(teamFolderArchiveArg, cancellationToken); } /// @@ -6641,14 +6840,15 @@ public TeamFolderArchiveLaunch EndTeamFolderArchive(sys.IAsyncResult asyncResult /// Permission : Team member file access. /// /// 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 TeamFolderArchiveCheckAsync(global::Dropbox.Api.Async.PollArg pollArg) + public t.Task TeamFolderArchiveCheckAsync(global::Dropbox.Api.Async.PollArg pollArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/team_folder/archive/check", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Team.TeamFolderArchiveJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder); + return this.Transport.SendRpcRequestAsync(pollArg, "api", "/team/team_folder/archive/check", "team", global::Dropbox.Api.Async.PollArg.Encoder, global::Dropbox.Api.Team.TeamFolderArchiveJobStatus.Decoder, global::Dropbox.Api.Async.PollError.Decoder, cancellationToken); } /// @@ -6673,16 +6873,18 @@ public sys.IAsyncResult BeginTeamFolderArchiveCheck(global::Dropbox.Api.Async.Po /// /// Id of the asynchronous job. This is the value of a /// response returned from the method that launched the job. + /// 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 TeamFolderArchiveCheckAsync(string asyncJobId) + public t.Task TeamFolderArchiveCheckAsync(string asyncJobId, + tr.CancellationToken cancellationToken = default) { var pollArg = new global::Dropbox.Api.Async.PollArg(asyncJobId); - return this.TeamFolderArchiveCheckAsync(pollArg); + return this.TeamFolderArchiveCheckAsync(pollArg, cancellationToken); } /// @@ -6730,14 +6932,15 @@ public TeamFolderArchiveJobStatus EndTeamFolderArchiveCheck(sys.IAsyncResult asy /// Permission : Team member file access. /// /// 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 TeamFolderCreateAsync(TeamFolderCreateArg teamFolderCreateArg) + public t.Task TeamFolderCreateAsync(TeamFolderCreateArg teamFolderCreateArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderCreateArg, "api", "/team/team_folder/create", "team", global::Dropbox.Api.Team.TeamFolderCreateArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderCreateError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderCreateArg, "api", "/team/team_folder/create", "team", global::Dropbox.Api.Team.TeamFolderCreateArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderCreateError.Decoder, cancellationToken); } /// @@ -6763,18 +6966,20 @@ public sys.IAsyncResult BeginTeamFolderCreate(TeamFolderCreateArg teamFolderCrea /// Name for the new team folder. /// The sync setting to apply to this team folder. Only /// permitted if the team has team selective sync enabled. + /// 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 TeamFolderCreateAsync(string name, - global::Dropbox.Api.Files.SyncSettingArg syncSetting = null) + global::Dropbox.Api.Files.SyncSettingArg syncSetting = null, + tr.CancellationToken cancellationToken = default) { var teamFolderCreateArg = new TeamFolderCreateArg(name, syncSetting); - return this.TeamFolderCreateAsync(teamFolderCreateArg); + return this.TeamFolderCreateAsync(teamFolderCreateArg, cancellationToken); } /// @@ -6825,11 +7030,12 @@ public TeamFolderMetadata EndTeamFolderCreate(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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> TeamFolderGetInfoAsync(TeamFolderIdListArg teamFolderIdListArg) + public t.Task> TeamFolderGetInfoAsync(TeamFolderIdListArg teamFolderIdListArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, enc.Empty>(teamFolderIdListArg, "api", "/team/team_folder/get_info", "team", global::Dropbox.Api.Team.TeamFolderIdListArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.TeamFolderGetInfoItem.Decoder), enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync, enc.Empty>(teamFolderIdListArg, "api", "/team/team_folder/get_info", "team", global::Dropbox.Api.Team.TeamFolderIdListArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Team.TeamFolderGetInfoItem.Decoder), enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -6853,13 +7059,15 @@ public sys.IAsyncResult BeginTeamFolderGetInfo(TeamFolderIdListArg teamFolderIdL /// Permission : Team member file access. /// /// The list of team folder IDs. + /// 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> TeamFolderGetInfoAsync(col.IEnumerable teamFolderIds) + public t.Task> TeamFolderGetInfoAsync(col.IEnumerable teamFolderIds, + tr.CancellationToken cancellationToken = default) { var teamFolderIdListArg = new TeamFolderIdListArg(teamFolderIds); - return this.TeamFolderGetInfoAsync(teamFolderIdListArg); + return this.TeamFolderGetInfoAsync(teamFolderIdListArg, cancellationToken); } /// @@ -6903,14 +7111,15 @@ public col.List EndTeamFolderGetInfo(sys.IAsyncResult asy /// Permission : Team member file access. /// /// 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 TeamFolderListAsync(TeamFolderListArg teamFolderListArg) + public t.Task TeamFolderListAsync(TeamFolderListArg teamFolderListArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderListArg, "api", "/team/team_folder/list", "team", global::Dropbox.Api.Team.TeamFolderListArg.Encoder, global::Dropbox.Api.Team.TeamFolderListResult.Decoder, global::Dropbox.Api.Team.TeamFolderListError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderListArg, "api", "/team/team_folder/list", "team", global::Dropbox.Api.Team.TeamFolderListArg.Encoder, global::Dropbox.Api.Team.TeamFolderListResult.Decoder, global::Dropbox.Api.Team.TeamFolderListError.Decoder, cancellationToken); } /// @@ -6934,16 +7143,18 @@ public sys.IAsyncResult BeginTeamFolderList(TeamFolderListArg teamFolderListArg, /// Permission : Team member file access. /// /// The maximum number of results to return 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 TeamFolderListAsync(uint limit = 1000) + public t.Task TeamFolderListAsync(uint limit = 1000, + tr.CancellationToken cancellationToken = default) { var teamFolderListArg = new TeamFolderListArg(limit); - return this.TeamFolderListAsync(teamFolderListArg); + return this.TeamFolderListAsync(teamFolderListArg, cancellationToken); } /// @@ -6992,14 +7203,15 @@ public TeamFolderListResult EndTeamFolderList(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 TeamFolderListContinueAsync(TeamFolderListContinueArg teamFolderListContinueArg) + public t.Task TeamFolderListContinueAsync(TeamFolderListContinueArg teamFolderListContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderListContinueArg, "api", "/team/team_folder/list/continue", "team", global::Dropbox.Api.Team.TeamFolderListContinueArg.Encoder, global::Dropbox.Api.Team.TeamFolderListResult.Decoder, global::Dropbox.Api.Team.TeamFolderListContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderListContinueArg, "api", "/team/team_folder/list/continue", "team", global::Dropbox.Api.Team.TeamFolderListContinueArg.Encoder, global::Dropbox.Api.Team.TeamFolderListResult.Decoder, global::Dropbox.Api.Team.TeamFolderListContinueError.Decoder, cancellationToken); } /// @@ -7026,16 +7238,18 @@ public sys.IAsyncResult BeginTeamFolderListContinue(TeamFolderListContinueArg te /// /// Indicates from what point to get the next set of team /// folders. + /// 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 TeamFolderListContinueAsync(string cursor) + public t.Task TeamFolderListContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var teamFolderListContinueArg = new TeamFolderListContinueArg(cursor); - return this.TeamFolderListContinueAsync(teamFolderListContinueArg); + return this.TeamFolderListContinueAsync(teamFolderListContinueArg, cancellationToken); } /// @@ -7083,13 +7297,14 @@ public TeamFolderListResult EndTeamFolderListContinue(sys.IAsyncResult asyncResu /// Permission : Team member file access. /// /// 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 TeamFolderPermanentlyDeleteAsync(TeamFolderIdArg teamFolderIdArg) + public t.Task TeamFolderPermanentlyDeleteAsync(TeamFolderIdArg teamFolderIdArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderIdArg, "api", "/team/team_folder/permanently_delete", "team", global::Dropbox.Api.Team.TeamFolderIdArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.TeamFolderPermanentlyDeleteError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderIdArg, "api", "/team/team_folder/permanently_delete", "team", global::Dropbox.Api.Team.TeamFolderIdArg.Encoder, enc.EmptyDecoder.Instance, global::Dropbox.Api.Team.TeamFolderPermanentlyDeleteError.Decoder, cancellationToken); } /// @@ -7114,15 +7329,17 @@ public sys.IAsyncResult BeginTeamFolderPermanentlyDelete(TeamFolderIdArg teamFol /// Permission : Team member file access. /// /// The ID of the team folder. + /// 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 TeamFolderPermanentlyDeleteAsync(string teamFolderId) + public t.Task TeamFolderPermanentlyDeleteAsync(string teamFolderId, + tr.CancellationToken cancellationToken = default) { var teamFolderIdArg = new TeamFolderIdArg(teamFolderId); - return this.TeamFolderPermanentlyDeleteAsync(teamFolderIdArg); + return this.TeamFolderPermanentlyDeleteAsync(teamFolderIdArg, cancellationToken); } /// @@ -7167,14 +7384,15 @@ public void EndTeamFolderPermanentlyDelete(sys.IAsyncResult asyncResult) /// Permission : Team member file access. /// /// 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 TeamFolderRenameAsync(TeamFolderRenameArg teamFolderRenameArg) + public t.Task TeamFolderRenameAsync(TeamFolderRenameArg teamFolderRenameArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderRenameArg, "api", "/team/team_folder/rename", "team", global::Dropbox.Api.Team.TeamFolderRenameArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderRenameError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderRenameArg, "api", "/team/team_folder/rename", "team", global::Dropbox.Api.Team.TeamFolderRenameArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderRenameError.Decoder, cancellationToken); } /// @@ -7199,18 +7417,20 @@ public sys.IAsyncResult BeginTeamFolderRename(TeamFolderRenameArg teamFolderRena /// /// The ID of the team folder. /// New team folder name. + /// 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 TeamFolderRenameAsync(string teamFolderId, - string name) + string name, + tr.CancellationToken cancellationToken = default) { var teamFolderRenameArg = new TeamFolderRenameArg(teamFolderId, name); - return this.TeamFolderRenameAsync(teamFolderRenameArg); + return this.TeamFolderRenameAsync(teamFolderRenameArg, cancellationToken); } /// @@ -7260,14 +7480,15 @@ public TeamFolderMetadata EndTeamFolderRename(sys.IAsyncResult asyncResult) /// endpoint requires that the team has team selective sync enabled. /// /// 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 TeamFolderUpdateSyncSettingsAsync(TeamFolderUpdateSyncSettingsArg teamFolderUpdateSyncSettingsArg) + public t.Task TeamFolderUpdateSyncSettingsAsync(TeamFolderUpdateSyncSettingsArg teamFolderUpdateSyncSettingsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(teamFolderUpdateSyncSettingsArg, "api", "/team/team_folder/update_sync_settings", "team", global::Dropbox.Api.Team.TeamFolderUpdateSyncSettingsArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderUpdateSyncSettingsError.Decoder); + return this.Transport.SendRpcRequestAsync(teamFolderUpdateSyncSettingsArg, "api", "/team/team_folder/update_sync_settings", "team", global::Dropbox.Api.Team.TeamFolderUpdateSyncSettingsArg.Encoder, global::Dropbox.Api.Team.TeamFolderMetadata.Decoder, global::Dropbox.Api.Team.TeamFolderUpdateSyncSettingsError.Decoder, cancellationToken); } /// @@ -7296,6 +7517,7 @@ public sys.IAsyncResult BeginTeamFolderUpdateSyncSettings(TeamFolderUpdateSyncSe /// meaningful if the team folder is not a shared team root. /// Sync settings to apply to contents of this team /// 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 @@ -7303,13 +7525,14 @@ public sys.IAsyncResult BeginTeamFolderUpdateSyncSettings(TeamFolderUpdateSyncSe /// cref="TeamFolderUpdateSyncSettingsError"/>. public t.Task TeamFolderUpdateSyncSettingsAsync(string teamFolderId, global::Dropbox.Api.Files.SyncSettingArg syncSetting = null, - col.IEnumerable contentSyncSettings = null) + col.IEnumerable contentSyncSettings = null, + tr.CancellationToken cancellationToken = default) { var teamFolderUpdateSyncSettingsArg = new TeamFolderUpdateSyncSettingsArg(teamFolderId, syncSetting, contentSyncSettings); - return this.TeamFolderUpdateSyncSettingsAsync(teamFolderUpdateSyncSettingsArg); + return this.TeamFolderUpdateSyncSettingsAsync(teamFolderUpdateSyncSettingsArg, cancellationToken); } /// @@ -7364,14 +7587,15 @@ public TeamFolderMetadata EndTeamFolderUpdateSyncSettings(sys.IAsyncResult async /// Returns the member profile of the admin who generated the team access token /// used to make the call. /// + /// 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 TokenGetAuthenticatedAdminAsync() + public t.Task TokenGetAuthenticatedAdminAsync(tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/team/token/get_authenticated_admin", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.Team.TokenGetAuthenticatedAdminResult.Decoder, global::Dropbox.Api.Team.TokenGetAuthenticatedAdminError.Decoder); + return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/team/token/get_authenticated_admin", "team", enc.EmptyEncoder.Instance, global::Dropbox.Api.Team.TokenGetAuthenticatedAdminResult.Decoder, global::Dropbox.Api.Team.TokenGetAuthenticatedAdminError.Decoder, cancellationToken); } /// diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/TeamLogTeamRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/TeamLogTeamRoutes.cs index 38808bdf46..fc6720746f 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/TeamLogTeamRoutes.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/TeamLogTeamRoutes.cs @@ -8,6 +8,7 @@ namespace Dropbox.Api.TeamLog.Routes using io = System.IO; using col = System.Collections.Generic; using t = System.Threading.Tasks; + using tr = System.Threading; using enc = Dropbox.Api.Stone; /// @@ -48,14 +49,15 @@ internal TeamLogTeamRoutes(enc.ITransport transport) /// Permission : Team Auditing. /// /// 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 GetEventsAsync(GetTeamEventsArg getTeamEventsArg) + public t.Task GetEventsAsync(GetTeamEventsArg getTeamEventsArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getTeamEventsArg, "api", "/team_log/get_events", "team", global::Dropbox.Api.TeamLog.GetTeamEventsArg.Encoder, global::Dropbox.Api.TeamLog.GetTeamEventsResult.Decoder, global::Dropbox.Api.TeamLog.GetTeamEventsError.Decoder); + return this.Transport.SendRpcRequestAsync(getTeamEventsArg, "api", "/team_log/get_events", "team", global::Dropbox.Api.TeamLog.GetTeamEventsArg.Encoder, global::Dropbox.Api.TeamLog.GetTeamEventsResult.Decoder, global::Dropbox.Api.TeamLog.GetTeamEventsError.Decoder, cancellationToken); } /// @@ -104,6 +106,7 @@ public sys.IAsyncResult BeginGetEvents(GetTeamEventsArg getTeamEventsArg, sys.As /// category shouldn't be provided together with event_type. /// Filter the returned events to a single event type. Note /// that event_type shouldn't be provided together with category. + /// 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 @@ -113,7 +116,8 @@ public t.Task GetEventsAsync(uint limit = 1000, string accountId = null, global::Dropbox.Api.TeamCommon.TimeRange time = null, EventCategory category = null, - EventTypeArg eventType = null) + EventTypeArg eventType = null, + tr.CancellationToken cancellationToken = default) { var getTeamEventsArg = new GetTeamEventsArg(limit, accountId, @@ -121,7 +125,7 @@ public t.Task GetEventsAsync(uint limit = 1000, category, eventType); - return this.GetEventsAsync(getTeamEventsArg); + return this.GetEventsAsync(getTeamEventsArg, cancellationToken); } /// @@ -190,14 +194,15 @@ public GetTeamEventsResult EndGetEvents(sys.IAsyncResult asyncResult) /// Permission : Team Auditing. /// /// 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 GetEventsContinueAsync(GetTeamEventsContinueArg getTeamEventsContinueArg) + public t.Task GetEventsContinueAsync(GetTeamEventsContinueArg getTeamEventsContinueArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getTeamEventsContinueArg, "api", "/team_log/get_events/continue", "team", global::Dropbox.Api.TeamLog.GetTeamEventsContinueArg.Encoder, global::Dropbox.Api.TeamLog.GetTeamEventsResult.Decoder, global::Dropbox.Api.TeamLog.GetTeamEventsContinueError.Decoder); + return this.Transport.SendRpcRequestAsync(getTeamEventsContinueArg, "api", "/team_log/get_events/continue", "team", global::Dropbox.Api.TeamLog.GetTeamEventsContinueArg.Encoder, global::Dropbox.Api.TeamLog.GetTeamEventsResult.Decoder, global::Dropbox.Api.TeamLog.GetTeamEventsContinueError.Decoder, cancellationToken); } /// @@ -224,16 +229,18 @@ public sys.IAsyncResult BeginGetEventsContinue(GetTeamEventsContinueArg getTeamE /// /// Indicates from what point to get the next set of /// events. + /// 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 GetEventsContinueAsync(string cursor) + public t.Task GetEventsContinueAsync(string cursor, + tr.CancellationToken cancellationToken = default) { var getTeamEventsContinueArg = new GetTeamEventsContinueArg(cursor); - return this.GetEventsContinueAsync(getTeamEventsContinueArg); + return this.GetEventsContinueAsync(getTeamEventsContinueArg, cancellationToken); } /// diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Users/UsersUserRoutes.cs b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Users/UsersUserRoutes.cs index 0d3dec1ce7..ef4741c9fb 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Generated/Users/UsersUserRoutes.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Generated/Users/UsersUserRoutes.cs @@ -8,6 +8,7 @@ namespace Dropbox.Api.Users.Routes using io = System.IO; using col = System.Collections.Generic; using t = System.Threading.Tasks; + using tr = System.Threading; using enc = Dropbox.Api.Stone; /// @@ -35,14 +36,15 @@ internal UsersUserRoutes(enc.ITransport transport) /// account. /// /// 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 FeaturesGetValuesAsync(UserFeaturesGetValuesBatchArg userFeaturesGetValuesBatchArg) + public t.Task FeaturesGetValuesAsync(UserFeaturesGetValuesBatchArg userFeaturesGetValuesBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(userFeaturesGetValuesBatchArg, "api", "/users/features/get_values", "user", global::Dropbox.Api.Users.UserFeaturesGetValuesBatchArg.Encoder, global::Dropbox.Api.Users.UserFeaturesGetValuesBatchResult.Decoder, global::Dropbox.Api.Users.UserFeaturesGetValuesBatchError.Decoder); + return this.Transport.SendRpcRequestAsync(userFeaturesGetValuesBatchArg, "api", "/users/features/get_values", "user", global::Dropbox.Api.Users.UserFeaturesGetValuesBatchArg.Encoder, global::Dropbox.Api.Users.UserFeaturesGetValuesBatchResult.Decoder, global::Dropbox.Api.Users.UserFeaturesGetValuesBatchError.Decoder, cancellationToken); } /// @@ -68,16 +70,18 @@ public sys.IAsyncResult BeginFeaturesGetValues(UserFeaturesGetValuesBatchArg use /// A list of features in . If the /// list is empty, this route will return . + /// 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 FeaturesGetValuesAsync(col.IEnumerable features) + public t.Task FeaturesGetValuesAsync(col.IEnumerable features, + tr.CancellationToken cancellationToken = default) { var userFeaturesGetValuesBatchArg = new UserFeaturesGetValuesBatchArg(features); - return this.FeaturesGetValuesAsync(userFeaturesGetValuesBatchArg); + return this.FeaturesGetValuesAsync(userFeaturesGetValuesBatchArg, cancellationToken); } /// @@ -125,14 +129,15 @@ public UserFeaturesGetValuesBatchResult EndFeaturesGetValues(sys.IAsyncResult as /// Get information about a user's account. /// /// 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 GetAccountAsync(GetAccountArg getAccountArg) + public t.Task GetAccountAsync(GetAccountArg getAccountArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(getAccountArg, "api", "/users/get_account", "user", global::Dropbox.Api.Users.GetAccountArg.Encoder, global::Dropbox.Api.Users.BasicAccount.Decoder, global::Dropbox.Api.Users.GetAccountError.Decoder); + return this.Transport.SendRpcRequestAsync(getAccountArg, "api", "/users/get_account", "user", global::Dropbox.Api.Users.GetAccountArg.Encoder, global::Dropbox.Api.Users.BasicAccount.Decoder, global::Dropbox.Api.Users.GetAccountError.Decoder, cancellationToken); } /// @@ -155,16 +160,18 @@ public sys.IAsyncResult BeginGetAccount(GetAccountArg getAccountArg, sys.AsyncCa /// Get information about a user's account. /// /// A user's account identifier. + /// 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 GetAccountAsync(string accountId) + public t.Task GetAccountAsync(string accountId, + tr.CancellationToken cancellationToken = default) { var getAccountArg = new GetAccountArg(accountId); - return this.GetAccountAsync(getAccountArg); + return this.GetAccountAsync(getAccountArg, cancellationToken); } /// @@ -211,14 +218,15 @@ public BasicAccount EndGetAccount(sys.IAsyncResult asyncResult) /// queried per 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> GetAccountBatchAsync(GetAccountBatchArg getAccountBatchArg) + public t.Task> GetAccountBatchAsync(GetAccountBatchArg getAccountBatchArg, tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync, GetAccountBatchError>(getAccountBatchArg, "api", "/users/get_account_batch", "user", global::Dropbox.Api.Users.GetAccountBatchArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Users.BasicAccount.Decoder), global::Dropbox.Api.Users.GetAccountBatchError.Decoder); + return this.Transport.SendRpcRequestAsync, GetAccountBatchError>(getAccountBatchArg, "api", "/users/get_account_batch", "user", global::Dropbox.Api.Users.GetAccountBatchArg.Encoder, enc.Decoder.CreateListDecoder(global::Dropbox.Api.Users.BasicAccount.Decoder), global::Dropbox.Api.Users.GetAccountBatchError.Decoder, cancellationToken); } /// @@ -243,16 +251,18 @@ public sys.IAsyncResult BeginGetAccountBatch(GetAccountBatchArg getAccountBatchA /// /// List of user account identifiers. Should not contain any /// duplicate account 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> GetAccountBatchAsync(col.IEnumerable accountIds) + public t.Task> GetAccountBatchAsync(col.IEnumerable accountIds, + tr.CancellationToken cancellationToken = default) { var getAccountBatchArg = new GetAccountBatchArg(accountIds); - return this.GetAccountBatchAsync(getAccountBatchArg); + return this.GetAccountBatchAsync(getAccountBatchArg, cancellationToken); } /// @@ -298,11 +308,12 @@ public col.List EndGetAccountBatch(sys.IAsyncResult asyncResult) /// /// Get information about the current user's account. /// + /// 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 GetCurrentAccountAsync() + public t.Task GetCurrentAccountAsync(tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/users/get_current_account", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.Users.FullAccount.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/users/get_current_account", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.Users.FullAccount.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// @@ -341,11 +352,12 @@ public FullAccount EndGetCurrentAccount(sys.IAsyncResult asyncResult) /// /// Get the space usage information for the current user's account. /// + /// 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 GetSpaceUsageAsync() + public t.Task GetSpaceUsageAsync(tr.CancellationToken cancellationToken = default) { - return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/users/get_space_usage", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.Users.SpaceUsage.Decoder, enc.EmptyDecoder.Instance); + return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/users/get_space_usage", "user", enc.EmptyEncoder.Instance, global::Dropbox.Api.Users.SpaceUsage.Decoder, enc.EmptyDecoder.Instance, cancellationToken); } /// diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Stone/Encoder.cs b/dropbox-sdk-dotnet/Dropbox.Api/Stone/Encoder.cs index 409e69006f..99a91d23bc 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Stone/Encoder.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Stone/Encoder.cs @@ -8,6 +8,8 @@ namespace Dropbox.Api.Stone { using System; using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// The factory class for encoders. @@ -52,15 +54,17 @@ public NullableEncoder(IEncoder encoder) /// /// The value. /// The writer. - public void Encode(T? value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(T? value, IJsonWriter writer, CancellationToken cancellationToken = default) { if (value == null) { - writer.WriteNull(); + await writer.WriteNull(cancellationToken); return; } - this.encoder.Encode(value.Value, writer); + await this.encoder.Encode(value.Value, writer, cancellationToken); } } @@ -84,9 +88,11 @@ internal sealed class Int32Encoder : IEncoder /// /// The value. /// The writer. - public void Encode(int value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(int value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteInt32(value); + await writer.WriteInt32(value, cancellationToken); } } @@ -110,9 +116,11 @@ internal sealed class Int64Encoder : IEncoder /// /// The value. /// The writer. - public void Encode(long value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(long value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteInt64(value); + await writer.WriteInt64(value, cancellationToken); } } @@ -136,9 +144,11 @@ internal sealed class UInt32Encoder : IEncoder /// /// The value. /// The writer. - public void Encode(uint value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(uint value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteUInt32(value); + await writer.WriteUInt32(value, cancellationToken); } } @@ -162,9 +172,11 @@ internal sealed class UInt64Encoder : IEncoder /// /// The value. /// The writer. - public void Encode(ulong value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(ulong value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteUInt64(value); + await writer.WriteUInt64(value, cancellationToken); } } @@ -183,9 +195,11 @@ internal sealed class SingleEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(float value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(float value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteSingle(value); + await writer.WriteSingle(value, cancellationToken); } } @@ -209,9 +223,11 @@ internal sealed class DoubleEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(double value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(double value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteDouble(value); + await writer.WriteDouble(value, cancellationToken); } } @@ -235,9 +251,11 @@ internal sealed class BooleanEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(bool value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(bool value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteBoolean(value); + await writer.WriteBoolean(value, cancellationToken); } } @@ -261,9 +279,11 @@ internal sealed class DateTimeEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(DateTime value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(DateTime value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteDateTime(value); + await writer.WriteDateTime(value, cancellationToken); } } @@ -282,9 +302,11 @@ internal sealed class BytesEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(byte[] value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(byte[] value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteBytes(value); + await writer.WriteBytes(value, cancellationToken); } } @@ -303,9 +325,11 @@ internal sealed class StringEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(string value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(string value, IJsonWriter writer, CancellationToken cancellationToken = default) { - writer.WriteString(value); + await writer.WriteString(value, cancellationToken); } } @@ -324,8 +348,11 @@ internal sealed class EmptyEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(Empty value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public Task Encode(Empty value, IJsonWriter writer, CancellationToken cancellationToken = default) { + return Task.CompletedTask; } } @@ -341,17 +368,19 @@ internal abstract class StructEncoder : IEncoder /// /// The value. /// The writer. - public void Encode(T value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(T value, IJsonWriter writer, CancellationToken cancellationToken = default) { if (value == null) { - writer.WriteNull(); + await writer.WriteNull(cancellationToken); return; } - writer.WriteStartObject(); + await writer.WriteStartObject(cancellationToken); this.EncodeFields(value, writer); - writer.WriteEndObject(); + await writer.WriteEndObject(cancellationToken); } /// @@ -369,10 +398,12 @@ public void Encode(T value, IJsonWriter writer) /// The value. /// The writer. /// The encoder. - protected static void WriteProperty(string propertyName, TProperty value, IJsonWriter writer, IEncoder encoder) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + protected static async Task WriteProperty(string propertyName, TProperty value, IJsonWriter writer, IEncoder encoder, CancellationToken cancellationToken = default) { - writer.WritePropertyName(propertyName); - encoder.Encode(value, writer); + await writer.WritePropertyName(propertyName, cancellationToken); + await encoder.Encode(value, writer, cancellationToken); } /// @@ -383,10 +414,12 @@ protected static void WriteProperty(string propertyName, TProperty va /// The value. /// The writer. /// The encoder. - protected static void WriteListProperty(string propertyName, IList value, IJsonWriter writer, IEncoder encoder) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + protected static async Task WriteListProperty(string propertyName, IList value, IJsonWriter writer, IEncoder encoder, CancellationToken cancellationToken = default) { - writer.WritePropertyName(propertyName); - ListEncoder.Encode(value, writer, encoder); + await writer.WritePropertyName(propertyName, cancellationToken); + await ListEncoder.Encode(value, writer, encoder, cancellationToken); } } @@ -416,16 +449,18 @@ public ListEncoder(IEncoder itemEncoder) /// The list. /// The writer. /// The item encoder. - public static void Encode(IList value, IJsonWriter writer, IEncoder itemEncoder) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public static async Task Encode(IList value, IJsonWriter writer, IEncoder itemEncoder, CancellationToken cancellationToken = default) { - writer.WriteStartArray(); + await writer.WriteStartArray(cancellationToken); foreach (var item in value) { - itemEncoder.Encode(item, writer); + await itemEncoder.Encode(item, writer, cancellationToken); } - writer.WriteEndArray(); + await writer.WriteEndArray(cancellationToken); } /// @@ -433,9 +468,11 @@ public static void Encode(IList value, IJsonWriter writer, IEncoder itemEn /// /// The value. /// The writer. - public void Encode(IList value, IJsonWriter writer) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + public async Task Encode(IList value, IJsonWriter writer, CancellationToken cancellationToken = default) { - Encode(value, writer, this.itemEncoder); + await Encode(value, writer, this.itemEncoder, cancellationToken); } } } diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Stone/IEncoder.cs b/dropbox-sdk-dotnet/Dropbox.Api/Stone/IEncoder.cs index 4561f0d55c..ff5c95094c 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Stone/IEncoder.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Stone/IEncoder.cs @@ -6,8 +6,8 @@ namespace Dropbox.Api.Stone { - using System; - using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// The encoder interface. @@ -20,6 +20,8 @@ internal interface IEncoder /// /// The value. /// The writer. - void Encode(T value, IJsonWriter writer); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task Encode(T value, IJsonWriter writer, CancellationToken cancellationToken = default); } } diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Stone/IJsonWriter.cs b/dropbox-sdk-dotnet/Dropbox.Api/Stone/IJsonWriter.cs index 6547cee2fb..54a8fe5888 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Stone/IJsonWriter.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Stone/IJsonWriter.cs @@ -7,6 +7,8 @@ namespace Dropbox.Api.Stone { using System; + using System.Threading; + using System.Threading.Tasks; /// /// The json writer interface. @@ -17,91 +19,123 @@ internal interface IJsonWriter /// Write a Int32 value. /// /// The value. - void WriteInt32(int value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteInt32(int value, CancellationToken cancellationToken = default); /// /// Write a Int64 value. /// /// The value. - void WriteInt64(long value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteInt64(long value, CancellationToken cancellationToken = default); /// /// Write a UInt32 value. /// /// The value. - void WriteUInt32(uint value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteUInt32(uint value, CancellationToken cancellationToken = default); /// /// Write a UInt64 value. /// /// The value. - void WriteUInt64(ulong value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteUInt64(ulong value, CancellationToken cancellationToken = default); /// /// Write a double value. /// /// The value. - void WriteDouble(double value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteDouble(double value, CancellationToken cancellationToken = default); /// /// Write a single value. /// /// The value. - void WriteSingle(float value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteSingle(float value, CancellationToken cancellationToken = default); /// /// Write a DateTime value. /// /// The value. - void WriteDateTime(DateTime value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteDateTime(DateTime value, CancellationToken cancellationToken = default); /// /// Write a boolean value. /// /// The value. - void WriteBoolean(bool value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteBoolean(bool value, CancellationToken cancellationToken = default); /// /// Write a byte[] value. /// /// The value. - void WriteBytes(byte[] value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteBytes(byte[] value, CancellationToken cancellationToken = default); /// /// Write a string value. /// /// The value. - void WriteString(string value); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteString(string value, CancellationToken cancellationToken = default); /// /// Write a null value. /// - void WriteNull(); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteNull(CancellationToken cancellationToken = default); /// /// Write start object. /// - void WriteStartObject(); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteStartObject(CancellationToken cancellationToken = default); /// /// Write end object. /// - void WriteEndObject(); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteEndObject(CancellationToken cancellationToken = default); /// /// Write start array. /// - void WriteStartArray(); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteStartArray(CancellationToken cancellationToken = default); /// /// Write end array. /// - void WriteEndArray(); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WriteEndArray(CancellationToken cancellationToken = default); /// /// Write property name. /// /// The property name. - void WritePropertyName(string name); + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + Task WritePropertyName(string name, CancellationToken cancellationToken = default); } } diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Stone/ITransport.cs b/dropbox-sdk-dotnet/Dropbox.Api/Stone/ITransport.cs index f10a9a55b4..8e84062f0b 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Stone/ITransport.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Stone/ITransport.cs @@ -7,8 +7,8 @@ namespace Dropbox.Api.Stone { using System; - using System.Collections.Generic; using System.IO; + using System.Threading; using System.Threading.Tasks; /// @@ -71,7 +71,8 @@ Task SendRpcRequestAsync( string auth, IEncoder requestEncoder, IDecoder responseDecoder, - IDecoder errorDecoder); + IDecoder errorDecoder, + CancellationToken cancellationToken = default); /// /// Sends the upload request asynchronously. @@ -96,7 +97,8 @@ Task SendUploadRequestAsync( string auth, IEncoder requestEncoder, IDecoder responseDecoder, - IDecoder errorDecoder); + IDecoder errorDecoder, + CancellationToken cancellationToken = default); /// /// Sends the download request asynchronously. @@ -119,6 +121,7 @@ Task> SendDownloadRequestAsync requestEncoder, IDecoder responseDecoder, - IDecoder errorDecoder); + IDecoder errorDecoder, + CancellationToken cancellationToken = default); } } diff --git a/dropbox-sdk-dotnet/Dropbox.Api/Stone/JsonWriter.cs b/dropbox-sdk-dotnet/Dropbox.Api/Stone/JsonWriter.cs index 27d8eabbbb..ddfb03e689 100644 --- a/dropbox-sdk-dotnet/Dropbox.Api/Stone/JsonWriter.cs +++ b/dropbox-sdk-dotnet/Dropbox.Api/Stone/JsonWriter.cs @@ -10,7 +10,8 @@ namespace Dropbox.Api.Stone using System.Collections.Generic; using System.IO; using System.Text; - + using System.Threading; + using System.Threading.Tasks; using Newtonsoft.Json; /// @@ -39,8 +40,9 @@ private JsonWriter(JsonTextWriter writer) /// The object to write. /// The encoder. /// If escape non-ascii characters. + /// The cancellation token to cancel operation. /// The encoded object as a JSON string. - public static string Write(T encodable, IEncoder encoder, bool escapeNonAscii = false) + public static async Task WriteAsync(T encodable, IEncoder encoder, bool escapeNonAscii = false, CancellationToken cancellationToken = default) { var builder = new StringBuilder(); var textWriter = new JsonTextWriter(new StringWriter(builder)) { DateFormatString = "yyyy-MM-ddTHH:mm:ssZ" }; @@ -51,7 +53,7 @@ public static string Write(T encodable, IEncoder encoder, bool escapeNonAs } var writer = new JsonWriter(textWriter); - encoder.Encode(encodable, writer); + await encoder.Encode(encodable, writer, cancellationToken); var json = builder.ToString(); @@ -62,139 +64,171 @@ public static string Write(T encodable, IEncoder encoder, bool escapeNonAs /// Write a Int32 value. /// /// The value. - void IJsonWriter.WriteInt32(int value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteInt32(int value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a Int64 value. /// /// The value. - void IJsonWriter.WriteInt64(long value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteInt64(long value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a UInt32 value. /// /// The value. - void IJsonWriter.WriteUInt32(uint value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteUInt32(uint value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a UInt64 value. /// /// The value. - void IJsonWriter.WriteUInt64(ulong value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteUInt64(ulong value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a double value. /// /// The value. - void IJsonWriter.WriteDouble(double value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteDouble(double value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a single value. /// /// The value. - void IJsonWriter.WriteSingle(float value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteSingle(float value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a DateTime value. /// /// The value. - void IJsonWriter.WriteDateTime(DateTime value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteDateTime(DateTime value, CancellationToken cancellationToken) { - this.writer.WriteValue(value.ToUniversalTime()); + await this.writer.WriteValueAsync(value.ToUniversalTime(), cancellationToken); } /// /// Write a boolean value. /// /// The value. - void IJsonWriter.WriteBoolean(bool value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteBoolean(bool value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a byte[] value. /// /// The value. - void IJsonWriter.WriteBytes(byte[] value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteBytes(byte[] value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a string value. /// /// The value. - void IJsonWriter.WriteString(string value) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteString(string value, CancellationToken cancellationToken) { - this.writer.WriteValue(value); + await this.writer.WriteValueAsync(value, cancellationToken); } /// /// Write a null value. /// - void IJsonWriter.WriteNull() + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteNull(CancellationToken cancellationToken) { - this.writer.WriteNull(); + await this.writer.WriteNullAsync(cancellationToken); } /// /// Write start object. /// - void IJsonWriter.WriteStartObject() + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteStartObject(CancellationToken cancellationToken) { - this.writer.WriteStartObject(); + await this.writer.WriteStartObjectAsync(cancellationToken); } /// /// Write end object. /// - void IJsonWriter.WriteEndObject() + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteEndObject(CancellationToken cancellationToken) { - this.writer.WriteEndObject(); + await this.writer.WriteEndObjectAsync(cancellationToken); } /// /// Write start array. /// - void IJsonWriter.WriteStartArray() + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteStartArray(CancellationToken cancellationToken) { - this.writer.WriteStartArray(); + await this.writer.WriteStartArrayAsync(cancellationToken); } /// /// Write end array. /// - void IJsonWriter.WriteEndArray() + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WriteEndArray(CancellationToken cancellationToken) { - this.writer.WriteEndArray(); + await this.writer.WriteEndArrayAsync(cancellationToken); } /// /// Write property name. /// /// The property name. - void IJsonWriter.WritePropertyName(string name) + /// The cancellation token to cancel operation. + /// The task object representing the asynchronous operation. + async Task IJsonWriter.WritePropertyName(string name, CancellationToken cancellationToken) { - this.writer.WritePropertyName(name); + await this.writer.WritePropertyNameAsync(name, cancellationToken); } } -} +} \ No newline at end of file diff --git a/generator/csharp.py b/generator/csharp.py index 013a65d6ac..b6ac8378d1 100644 --- a/generator/csharp.py +++ b/generator/csharp.py @@ -1846,6 +1846,7 @@ def _generate_routes(self, ns): self.emit('using io = System.IO;') self.emit('using col = System.Collections.Generic;') self.emit('using t = System.Threading.Tasks;') + self.emit('using tr = System.Threading;') self.emit('using enc = {}.Stone;'.format(self._namespace_name)) self.emit() @@ -1929,8 +1930,10 @@ def _generate_route(self, ns, route, auth_type): body_arg = 'io.Stream body' ctor_args.append(ConstructorArg('io.Stream', 'body', body_arg, 'The document to upload')) - - async_fn = 'public {} {}({})'.format(task_type, async_name, ', '.join(route_args)) + + cancellationTokenArg_name = 'cancellationToken' + cancellationTokenArg = ['tr.CancellationToken {} = default'.format(cancellationTokenArg_name)] + async_fn = 'public {} {}({})'.format(task_type, async_name, ', '.join(route_args + cancellationTokenArg)) apm_args = route_args + ['sys.AsyncCallback callback', 'object state = null'] apm_fn = 'public sys.IAsyncResult Begin{}({})'.format(public_name, ', '.join(apm_args)) @@ -1944,6 +1947,7 @@ def _generate_route(self, ns, route, auth_type): self.emit_xml('The request parameters', 'param', name=arg_name) if route_style == 'upload': self.emit_xml('The content to upload.', 'param', name='body') + self.emit_xml('The cancellation token to cancel operation.', 'param', name=cancellationTokenArg_name) if result_is_void: self.emit_xml('The task that represents the asynchronous send operation.', 'returns') @@ -1968,6 +1972,7 @@ def _generate_route(self, ns, route, auth_type): self._get_encoder(route.arg_data_type), self._get_decoder(route.result_data_type), self._get_decoder(route.error_data_type), + cancellationTokenArg_name ]) self.emit('return this.Transport.Send{}RequestAsync<{}>({});'.format( @@ -2009,6 +2014,7 @@ def _generate_route(self, ns, route, auth_type): self.emit_summary(route.doc or 'The {} route'.format(self._name_words(route.name))) for arg in ctor_args: self.emit_wrapped_text(arg.doc) + self.emit_xml('The cancellation token to cancel operation.', 'param', name=cancellationTokenArg_name) if result_is_void: self.emit_xml('The task that represents the asynchronous send operation.', 'returns') @@ -2023,7 +2029,7 @@ def _generate_route(self, ns, route, auth_type): self._generate_obsolete_attribute(route.deprecated, suffix='Async') self.generate_multiline_list( - arg_list, + arg_list + cancellationTokenArg, before='public {} {}'.format(task_type, async_name), skip_last_sep=True ) @@ -2038,6 +2044,7 @@ def _generate_route(self, ns, route, auth_type): async_args = [arg_name] if route_style == 'upload': async_args.append('body') + async_args.append(cancellationTokenArg_name) self.emit('return this.{}({});'.format(async_name, ', '.join(async_args))) self.emit()