diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index 49b81c72e070..3a0a3dd4272b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -448,7 +448,7 @@ namespace {{packageName}}.Client } {{#supportsAsync}} - private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { RestClient client = new RestClient(_baseUrl); @@ -479,7 +479,7 @@ namespace {{packageName}}.Client InterceptRequest(req); - var response = await client.ExecuteAsync(req); + var response = await client.ExecuteAsync(req, cancellationToken); InterceptResponse(req, response); @@ -526,11 +526,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); } /// @@ -540,11 +541,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); } /// @@ -554,11 +556,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); } /// @@ -568,11 +571,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); } /// @@ -582,11 +586,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); } /// @@ -596,11 +601,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); } /// @@ -610,11 +616,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); } #endregion IAsynchronousClient {{/supportsAsync}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache index 0068ce5cd4d0..8fa4c40cd94a 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache @@ -19,9 +19,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -29,9 +30,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -39,9 +41,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -49,9 +52,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -59,9 +63,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -69,9 +74,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -79,9 +85,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } {{^supportsAsync}}*/{{/supportsAsync}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index 644c038885a3..59a65d9d9634 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -62,8 +62,9 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// {{summary}} @@ -72,9 +73,10 @@ namespace {{packageName}}.{{apiPackage}} /// {{notes}} /// /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} - System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -376,12 +378,13 @@ namespace {{packageName}}.{{apiPackage}} /// {{summary}} {{notes}} /// /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken);{{/returnType}} } @@ -389,9 +392,10 @@ namespace {{packageName}}.{{apiPackage}} /// {{summary}} {{notes}} /// /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -534,7 +538,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 99156f92d281..8d9b36ddfc5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -65,8 +65,9 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test special tags @@ -75,9 +76,10 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -258,11 +260,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTags /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -271,9 +274,10 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -303,7 +307,7 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 55ac584e8a77..e510f1f6926b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -400,8 +400,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// creates an XmlItem @@ -410,9 +411,10 @@ public interface IFakeApiAsync : IApiAccessor /// this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -421,8 +423,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)); + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -431,9 +434,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)); + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -442,8 +446,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -452,9 +457,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -463,8 +469,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)); + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -473,9 +480,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)); + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -484,8 +492,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -494,9 +503,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -505,8 +515,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -515,9 +526,10 @@ public interface IFakeApiAsync : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -526,9 +538,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -537,10 +551,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model /// @@ -549,8 +565,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model @@ -559,9 +576,10 @@ public interface IFakeApiAsync : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -570,21 +588,35 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -593,22 +625,36 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters /// @@ -617,15 +663,23 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters @@ -634,16 +688,24 @@ public interface IFakeApiAsync : IApiAccessor /// To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) /// @@ -652,13 +714,19 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Required String in group parameters + /// Cancellation Token to cancel the request. /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. /// Required Integer in group parameters + /// Cancellation Token to cancel the request. /// String in group parameters (optional) + /// Cancellation Token to cancel the request. /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) @@ -667,14 +735,20 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties /// @@ -683,8 +757,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// request body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties @@ -693,9 +768,10 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data /// @@ -704,9 +780,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// field1 + /// Cancellation Token to cancel the request. /// field2 + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2); + System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data @@ -715,10 +793,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -727,12 +807,17 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -741,13 +826,18 @@ public interface IFakeApiAsync : IApiAccessor /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -931,11 +1021,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateXmlItemWithHttpInfo (Xm /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateXmlItemAsyncWithHttpInfo(xmlItem); + await CreateXmlItemAsyncWithHttpInfo(xmlItem, cancellationToken); } @@ -943,9 +1034,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'xmlItem' is set if (xmlItem == null) @@ -979,7 +1071,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1045,11 +1137,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)) + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1058,9 +1151,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1085,7 +1179,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1151,11 +1245,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1164,9 +1259,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1191,7 +1287,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1257,11 +1353,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1270,9 +1367,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1297,7 +1395,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1363,11 +1461,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1376,9 +1475,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1403,7 +1503,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1472,11 +1572,12 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + await TestBodyWithFileSchemaAsyncWithHttpInfo(body, cancellationToken); } @@ -1484,9 +1585,10 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1515,7 +1617,7 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1591,12 +1693,14 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body, cancellationToken); } @@ -1604,10 +1708,12 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'query' is set if (query == null) @@ -1641,7 +1747,7 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1712,11 +1818,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHtt /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1725,9 +1832,10 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1757,7 +1865,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1905,24 +2013,38 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken); } @@ -1930,22 +2052,36 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) @@ -2027,7 +2163,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2137,18 +2273,26 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken); } @@ -2156,16 +2300,24 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2221,7 +2373,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2309,16 +2461,22 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken); } @@ -2326,14 +2484,20 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2371,7 +2535,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2440,11 +2604,12 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param, cancellationToken); } @@ -2452,9 +2617,10 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2483,7 +2649,7 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2559,12 +2725,14 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2) + public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestJsonFormDataAsyncWithHttpInfo(param, param2); + await TestJsonFormDataAsyncWithHttpInfo(param, param2, cancellationToken); } @@ -2572,10 +2740,12 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2) + public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2609,7 +2779,7 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2705,15 +2875,20 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context, cancellationToken); } @@ -2721,13 +2896,18 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -2775,7 +2955,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index b663807131fd..ca7fecd46a3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -65,8 +65,9 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test class name in snake case @@ -75,9 +76,10 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -263,11 +265,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpI /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -276,9 +279,10 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -313,7 +317,7 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 6c50956c4ad5..a9f87aeb4eaa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -247,8 +247,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body); + System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Add a new pet to the store @@ -257,9 +258,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet /// @@ -268,9 +270,11 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet id to delete + /// Cancellation Token to cancel the request. /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet @@ -279,10 +283,12 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status /// @@ -291,8 +297,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status @@ -301,9 +308,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags /// @@ -312,8 +320,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags @@ -322,9 +331,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID /// @@ -333,8 +343,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID @@ -343,9 +354,10 @@ public interface IPetApiAsync : IApiAccessor /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet /// @@ -354,8 +366,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body); + System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet @@ -364,9 +377,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data /// @@ -375,10 +389,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data @@ -387,11 +404,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image /// @@ -400,10 +420,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image @@ -412,11 +435,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) /// @@ -425,10 +451,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// file to upload + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) @@ -437,11 +466,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -627,11 +659,12 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet body) + public async System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await AddPetAsyncWithHttpInfo(body); + await AddPetAsyncWithHttpInfo(body, cancellationToken); } @@ -639,9 +672,10 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -677,7 +711,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -753,12 +787,14 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeletePetAsyncWithHttpInfo(petId, apiKey); + await DeletePetAsyncWithHttpInfo(petId, apiKey, cancellationToken); } @@ -766,10 +802,12 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -803,7 +841,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -880,11 +918,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByStatusWithHttp /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status, cancellationToken); return localVarResponse.Data; } @@ -893,9 +932,10 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'status' is set if (status == null) @@ -931,7 +971,7 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1008,11 +1048,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByTagsWithHttpIn /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags, cancellationToken); return localVarResponse.Data; } @@ -1021,9 +1062,10 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'tags' is set if (tags == null) @@ -1059,7 +1101,7 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List>("/pet/findByTags", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1131,11 +1173,12 @@ public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long p /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId, cancellationToken); return localVarResponse.Data; } @@ -1144,9 +1187,10 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1177,7 +1221,7 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1253,11 +1297,12 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo (Pet bo /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetAsyncWithHttpInfo(body); + await UpdatePetAsyncWithHttpInfo(body, cancellationToken); } @@ -1265,9 +1310,10 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1303,7 +1349,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1386,13 +1432,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status, cancellationToken); } @@ -1400,11 +1449,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1443,7 +1495,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1528,13 +1580,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file, cancellationToken); return localVarResponse.Data; } @@ -1543,11 +1598,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1587,7 +1645,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1673,13 +1731,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata, cancellationToken); return localVarResponse.Data; } @@ -1688,11 +1749,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'requiredFile' is set if (requiredFile == null) @@ -1733,7 +1797,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index a7379d4eac15..431369433551 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -126,8 +126,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete purchase order by ID @@ -136,9 +137,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status /// @@ -147,7 +149,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - System.Threading.Tasks.Task> GetInventoryAsync (); + System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status @@ -157,7 +159,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID /// @@ -166,8 +168,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID @@ -176,9 +179,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet /// @@ -187,8 +191,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body); + System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet @@ -197,9 +202,10 @@ public interface IStoreApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -377,11 +383,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo (stri /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteOrderAsyncWithHttpInfo(orderId); + await DeleteOrderAsyncWithHttpInfo(orderId, cancellationToken); } @@ -389,9 +396,10 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -419,7 +427,7 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -488,9 +496,9 @@ public Org.OpenAPITools.Client.ApiResponse< Dictionary > GetInvento /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - public async System.Threading.Tasks.Task> GetInventoryAsync () + public async System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(cancellationToken); return localVarResponse.Data; } @@ -500,7 +508,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -529,7 +537,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -596,11 +604,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (lo /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId, cancellationToken); return localVarResponse.Data; } @@ -609,9 +618,10 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -637,7 +647,7 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -708,11 +718,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Orde /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -721,9 +732,10 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -753,7 +765,7 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index f233973eb0cb..fa89ac357fb0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -214,8 +214,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body); + System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create user @@ -224,9 +225,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -235,8 +237,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -245,9 +248,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -256,8 +260,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -266,9 +271,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user /// @@ -277,8 +283,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteUserAsync (string username); + System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user @@ -287,9 +294,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name /// @@ -298,8 +306,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - System.Threading.Tasks.Task GetUserByNameAsync (string username); + System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name @@ -308,9 +317,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system /// @@ -319,9 +329,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The user name for login + /// Cancellation Token to cancel the request. /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task LoginUserAsync (string username, string password); + System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system @@ -330,10 +342,12 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session /// @@ -342,7 +356,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of void - System.Threading.Tasks.Task LogoutUserAsync (); + System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session @@ -352,7 +366,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse - System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user /// @@ -361,9 +375,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted + /// Cancellation Token to cancel the request. /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user @@ -372,10 +388,12 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -553,11 +571,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo (User /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User body) + public async System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUserAsyncWithHttpInfo(body); + await CreateUserAsyncWithHttpInfo(body, cancellationToken); } @@ -565,9 +584,10 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -595,7 +615,7 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -663,11 +683,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + await CreateUsersWithArrayInputAsyncWithHttpInfo(body, cancellationToken); } @@ -675,9 +696,10 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -705,7 +727,7 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List("/user/createWithArray", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -773,11 +795,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithListInputAsyncWithHttpInfo(body); + await CreateUsersWithListInputAsyncWithHttpInfo(body, cancellationToken); } @@ -785,9 +808,10 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -815,7 +839,7 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List("/user/createWithList", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -883,11 +907,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo (strin /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteUserAsync (string username) + public async System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteUserAsyncWithHttpInfo(username); + await DeleteUserAsyncWithHttpInfo(username, cancellationToken); } @@ -895,9 +920,10 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -925,7 +951,7 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -996,11 +1022,12 @@ public Org.OpenAPITools.Client.ApiResponse< User > GetUserByNameWithHttpInfo (st /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + public async System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username, cancellationToken); return localVarResponse.Data; } @@ -1009,9 +1036,10 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1041,7 +1069,7 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1119,12 +1147,14 @@ public Org.OpenAPITools.Client.ApiResponse< string > LoginUserWithHttpInfo (stri /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password, cancellationToken); return localVarResponse.Data; } @@ -1133,10 +1163,12 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1171,7 +1203,7 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1233,9 +1265,9 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo () /// /// Thrown when fails to make API call /// Task of void - public async System.Threading.Tasks.Task LogoutUserAsync () + public async System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await LogoutUserAsyncWithHttpInfo(); + await LogoutUserAsyncWithHttpInfo(cancellationToken); } @@ -1244,7 +1276,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () /// /// Thrown when fails to make API call /// Task of ApiResponse - public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1267,7 +1299,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1342,12 +1374,14 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo (strin /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdateUserAsyncWithHttpInfo(username, body); + await UpdateUserAsyncWithHttpInfo(username, body, cancellationToken); } @@ -1355,10 +1389,12 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1391,7 +1427,7 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 6160e7a740ec..238b48ce89da 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -450,7 +450,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura return result; } - private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { RestClient client = new RestClient(_baseUrl); @@ -481,7 +481,7 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig InterceptRequest(req); - var response = await client.ExecuteAsync(req); + var response = await client.ExecuteAsync(req, cancellationToken); InterceptResponse(req, response); @@ -528,11 +528,12 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); } /// @@ -542,11 +543,12 @@ public Task> GetAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); } /// @@ -556,11 +558,12 @@ public Task> PostAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); } /// @@ -570,11 +573,12 @@ public Task> PutAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); } /// @@ -584,11 +588,12 @@ public Task> DeleteAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); } /// @@ -598,11 +603,12 @@ public Task> HeadAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); } /// @@ -612,11 +618,12 @@ public Task> OptionsAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); } #endregion IAsynchronousClient diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs index 750cf1839362..ea7ec150cf40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -28,9 +28,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -38,9 +39,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -48,9 +50,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -58,9 +61,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -68,9 +72,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -78,9 +83,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -88,9 +94,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 99156f92d281..8d9b36ddfc5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -65,8 +65,9 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test special tags @@ -75,9 +76,10 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -258,11 +260,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTags /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -271,9 +274,10 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -303,7 +307,7 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 55ac584e8a77..e510f1f6926b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -400,8 +400,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// creates an XmlItem @@ -410,9 +411,10 @@ public interface IFakeApiAsync : IApiAccessor /// this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -421,8 +423,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)); + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -431,9 +434,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)); + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -442,8 +446,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -452,9 +457,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -463,8 +469,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)); + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -473,9 +480,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)); + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -484,8 +492,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -494,9 +503,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -505,8 +515,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -515,9 +526,10 @@ public interface IFakeApiAsync : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -526,9 +538,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -537,10 +551,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model /// @@ -549,8 +565,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model @@ -559,9 +576,10 @@ public interface IFakeApiAsync : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -570,21 +588,35 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -593,22 +625,36 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters /// @@ -617,15 +663,23 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters @@ -634,16 +688,24 @@ public interface IFakeApiAsync : IApiAccessor /// To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) /// @@ -652,13 +714,19 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Required String in group parameters + /// Cancellation Token to cancel the request. /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. /// Required Integer in group parameters + /// Cancellation Token to cancel the request. /// String in group parameters (optional) + /// Cancellation Token to cancel the request. /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) @@ -667,14 +735,20 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties /// @@ -683,8 +757,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// request body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties @@ -693,9 +768,10 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data /// @@ -704,9 +780,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// field1 + /// Cancellation Token to cancel the request. /// field2 + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2); + System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data @@ -715,10 +793,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -727,12 +807,17 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -741,13 +826,18 @@ public interface IFakeApiAsync : IApiAccessor /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -931,11 +1021,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateXmlItemWithHttpInfo (Xm /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateXmlItemAsyncWithHttpInfo(xmlItem); + await CreateXmlItemAsyncWithHttpInfo(xmlItem, cancellationToken); } @@ -943,9 +1034,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'xmlItem' is set if (xmlItem == null) @@ -979,7 +1071,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1045,11 +1137,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)) + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1058,9 +1151,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1085,7 +1179,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1151,11 +1245,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1164,9 +1259,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1191,7 +1287,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1257,11 +1353,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1270,9 +1367,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1297,7 +1395,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1363,11 +1461,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1376,9 +1475,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1403,7 +1503,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1472,11 +1572,12 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + await TestBodyWithFileSchemaAsyncWithHttpInfo(body, cancellationToken); } @@ -1484,9 +1585,10 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1515,7 +1617,7 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1591,12 +1693,14 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body, cancellationToken); } @@ -1604,10 +1708,12 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'query' is set if (query == null) @@ -1641,7 +1747,7 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1712,11 +1818,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHtt /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1725,9 +1832,10 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1757,7 +1865,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1905,24 +2013,38 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken); } @@ -1930,22 +2052,36 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) @@ -2027,7 +2163,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2137,18 +2273,26 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken); } @@ -2156,16 +2300,24 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2221,7 +2373,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2309,16 +2461,22 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken); } @@ -2326,14 +2484,20 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2371,7 +2535,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2440,11 +2604,12 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param, cancellationToken); } @@ -2452,9 +2617,10 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2483,7 +2649,7 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2559,12 +2725,14 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2) + public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestJsonFormDataAsyncWithHttpInfo(param, param2); + await TestJsonFormDataAsyncWithHttpInfo(param, param2, cancellationToken); } @@ -2572,10 +2740,12 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2) + public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2609,7 +2779,7 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2705,15 +2875,20 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context, cancellationToken); } @@ -2721,13 +2896,18 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -2775,7 +2955,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index b663807131fd..ca7fecd46a3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -65,8 +65,9 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test class name in snake case @@ -75,9 +76,10 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -263,11 +265,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpI /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -276,9 +279,10 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -313,7 +317,7 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs index 6c50956c4ad5..a9f87aeb4eaa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs @@ -247,8 +247,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body); + System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Add a new pet to the store @@ -257,9 +258,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet /// @@ -268,9 +270,11 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet id to delete + /// Cancellation Token to cancel the request. /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet @@ -279,10 +283,12 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status /// @@ -291,8 +297,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status @@ -301,9 +308,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags /// @@ -312,8 +320,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags @@ -322,9 +331,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID /// @@ -333,8 +343,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID @@ -343,9 +354,10 @@ public interface IPetApiAsync : IApiAccessor /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet /// @@ -354,8 +366,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body); + System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet @@ -364,9 +377,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data /// @@ -375,10 +389,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data @@ -387,11 +404,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image /// @@ -400,10 +420,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image @@ -412,11 +435,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) /// @@ -425,10 +451,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// file to upload + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) @@ -437,11 +466,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -627,11 +659,12 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet body) + public async System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await AddPetAsyncWithHttpInfo(body); + await AddPetAsyncWithHttpInfo(body, cancellationToken); } @@ -639,9 +672,10 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -677,7 +711,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -753,12 +787,14 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeletePetAsyncWithHttpInfo(petId, apiKey); + await DeletePetAsyncWithHttpInfo(petId, apiKey, cancellationToken); } @@ -766,10 +802,12 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -803,7 +841,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -880,11 +918,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByStatusWithHttp /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status, cancellationToken); return localVarResponse.Data; } @@ -893,9 +932,10 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'status' is set if (status == null) @@ -931,7 +971,7 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1008,11 +1048,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByTagsWithHttpIn /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags, cancellationToken); return localVarResponse.Data; } @@ -1021,9 +1062,10 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'tags' is set if (tags == null) @@ -1059,7 +1101,7 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List>("/pet/findByTags", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1131,11 +1173,12 @@ public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long p /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId, cancellationToken); return localVarResponse.Data; } @@ -1144,9 +1187,10 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1177,7 +1221,7 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1253,11 +1297,12 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo (Pet bo /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetAsyncWithHttpInfo(body); + await UpdatePetAsyncWithHttpInfo(body, cancellationToken); } @@ -1265,9 +1310,10 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1303,7 +1349,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1386,13 +1432,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status, cancellationToken); } @@ -1400,11 +1449,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1443,7 +1495,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1528,13 +1580,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file, cancellationToken); return localVarResponse.Data; } @@ -1543,11 +1598,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1587,7 +1645,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1673,13 +1731,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata, cancellationToken); return localVarResponse.Data; } @@ -1688,11 +1749,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'requiredFile' is set if (requiredFile == null) @@ -1733,7 +1797,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs index a7379d4eac15..431369433551 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -126,8 +126,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete purchase order by ID @@ -136,9 +137,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status /// @@ -147,7 +149,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - System.Threading.Tasks.Task> GetInventoryAsync (); + System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status @@ -157,7 +159,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID /// @@ -166,8 +168,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID @@ -176,9 +179,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet /// @@ -187,8 +191,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body); + System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet @@ -197,9 +202,10 @@ public interface IStoreApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -377,11 +383,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo (stri /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteOrderAsyncWithHttpInfo(orderId); + await DeleteOrderAsyncWithHttpInfo(orderId, cancellationToken); } @@ -389,9 +396,10 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -419,7 +427,7 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -488,9 +496,9 @@ public Org.OpenAPITools.Client.ApiResponse< Dictionary > GetInvento /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - public async System.Threading.Tasks.Task> GetInventoryAsync () + public async System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(cancellationToken); return localVarResponse.Data; } @@ -500,7 +508,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -529,7 +537,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -596,11 +604,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (lo /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId, cancellationToken); return localVarResponse.Data; } @@ -609,9 +618,10 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -637,7 +647,7 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -708,11 +718,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Orde /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -721,9 +732,10 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -753,7 +765,7 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs index f233973eb0cb..fa89ac357fb0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs @@ -214,8 +214,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body); + System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create user @@ -224,9 +225,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -235,8 +237,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -245,9 +248,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -256,8 +260,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -266,9 +271,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user /// @@ -277,8 +283,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteUserAsync (string username); + System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user @@ -287,9 +294,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name /// @@ -298,8 +306,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - System.Threading.Tasks.Task GetUserByNameAsync (string username); + System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name @@ -308,9 +317,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system /// @@ -319,9 +329,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The user name for login + /// Cancellation Token to cancel the request. /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task LoginUserAsync (string username, string password); + System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system @@ -330,10 +342,12 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session /// @@ -342,7 +356,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of void - System.Threading.Tasks.Task LogoutUserAsync (); + System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session @@ -352,7 +366,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse - System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user /// @@ -361,9 +375,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted + /// Cancellation Token to cancel the request. /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user @@ -372,10 +388,12 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -553,11 +571,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo (User /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User body) + public async System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUserAsyncWithHttpInfo(body); + await CreateUserAsyncWithHttpInfo(body, cancellationToken); } @@ -565,9 +584,10 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -595,7 +615,7 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -663,11 +683,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + await CreateUsersWithArrayInputAsyncWithHttpInfo(body, cancellationToken); } @@ -675,9 +696,10 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -705,7 +727,7 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List("/user/createWithArray", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -773,11 +795,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithListInputAsyncWithHttpInfo(body); + await CreateUsersWithListInputAsyncWithHttpInfo(body, cancellationToken); } @@ -785,9 +808,10 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -815,7 +839,7 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List("/user/createWithList", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -883,11 +907,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo (strin /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteUserAsync (string username) + public async System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteUserAsyncWithHttpInfo(username); + await DeleteUserAsyncWithHttpInfo(username, cancellationToken); } @@ -895,9 +920,10 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -925,7 +951,7 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -996,11 +1022,12 @@ public Org.OpenAPITools.Client.ApiResponse< User > GetUserByNameWithHttpInfo (st /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + public async System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username, cancellationToken); return localVarResponse.Data; } @@ -1009,9 +1036,10 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1041,7 +1069,7 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1119,12 +1147,14 @@ public Org.OpenAPITools.Client.ApiResponse< string > LoginUserWithHttpInfo (stri /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password, cancellationToken); return localVarResponse.Data; } @@ -1133,10 +1163,12 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1171,7 +1203,7 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1233,9 +1265,9 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo () /// /// Thrown when fails to make API call /// Task of void - public async System.Threading.Tasks.Task LogoutUserAsync () + public async System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await LogoutUserAsyncWithHttpInfo(); + await LogoutUserAsyncWithHttpInfo(cancellationToken); } @@ -1244,7 +1276,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () /// /// Thrown when fails to make API call /// Task of ApiResponse - public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1267,7 +1299,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1342,12 +1374,14 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo (strin /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdateUserAsyncWithHttpInfo(username, body); + await UpdateUserAsyncWithHttpInfo(username, body, cancellationToken); } @@ -1355,10 +1389,12 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1391,7 +1427,7 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs index 8c44232d59bf..f94175d7029e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -451,7 +451,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura return result; } - private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { RestClient client = new RestClient(_baseUrl); @@ -482,7 +482,7 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig InterceptRequest(req); - var response = await client.ExecuteAsync(req); + var response = await client.ExecuteAsync(req, cancellationToken); InterceptResponse(req, response); @@ -529,11 +529,12 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); } /// @@ -543,11 +544,12 @@ public Task> GetAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); } /// @@ -557,11 +559,12 @@ public Task> PostAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); } /// @@ -571,11 +574,12 @@ public Task> PutAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); } /// @@ -585,11 +589,12 @@ public Task> DeleteAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); } /// @@ -599,11 +604,12 @@ public Task> HeadAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); } /// @@ -613,11 +619,12 @@ public Task> OptionsAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); } #endregion IAsynchronousClient diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs index 750cf1839362..ea7ec150cf40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -28,9 +28,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -38,9 +39,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -48,9 +50,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -58,9 +61,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -68,9 +72,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -78,9 +83,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -88,9 +94,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } }