diff --git a/bin/utils/test_file_list.yaml b/bin/utils/test_file_list.yaml index 31e862ffb195..9e3d9da4ed2a 100644 --- a/bin/utils/test_file_list.yaml +++ b/bin/utils/test_file_list.yaml @@ -3,7 +3,7 @@ - filename: "samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs" sha256: e323c7e646a0ceb6d1d8f34f287175ac666fdbbe057791b45d138de3d9582666 - filename: "samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs" - sha256: 7dad88554fe630d25c787cae05305d302d5e34ca810aee4fa23f20055f9188e1 + sha256: b98a6043573332de4f049db50b36bce7b5fada8511769da97f6561066a0f8c5c - filename: "samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/linux-logo.png" sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230 # java okhttp gson test files diff --git a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache index be918b9f0dbc..ea843a6233c4 100644 --- a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache @@ -455,7 +455,7 @@ namespace {{packageName}}.Client var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, + Timeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, diff --git a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache index 2753aafb39cb..069758033634 100644 --- a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache @@ -202,7 +202,7 @@ namespace {{packageName}}.Client }; // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; + Timeout = TimeSpan.FromSeconds(100); } /// @@ -286,9 +286,9 @@ namespace {{packageName}}.Client public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache index 5981728b466a..6712aa632daf 100644 --- a/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache @@ -101,10 +101,10 @@ namespace {{packageName}}.Client string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/httpclient/ApiClient.mustache index cefe6be9ff86..603284acbf33 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/httpclient/ApiClient.mustache @@ -481,7 +481,7 @@ namespace {{packageName}}.Client try { - if (configuration.Timeout > 0) + if (configuration.Timeout > TimeSpan.Zero) { timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs index 83177ada5dcf..e68525827001 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs @@ -455,7 +455,7 @@ private async Task> ExecClientAsync(Func @@ -221,9 +221,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index a702f89054cf..f5684dd36c0c 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -72,10 +72,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs index 28c149428ece..b630d530a0c9 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs @@ -455,7 +455,7 @@ private async Task> ExecClientAsync(Func @@ -215,9 +215,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index c04a6f3a0135..680178e9b793 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -71,10 +71,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs index f0b087398912..e12582623e86 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -155,7 +155,7 @@ public void GetPetByIdTest() { // set timeout to 10 seconds Configuration c1 = new Configuration(); - c1.Timeout = 10000; + c1.Timeout = TimeSpan.FromSeconds(10); c1.UserAgent = "TEST_USER_AGENT"; HttpClient httpClient = new HttpClient(); diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs index e00f3d614671..0a7945d386bc 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTestsV2.cs @@ -44,7 +44,7 @@ public PetApiTestsV2() _petApi = new PetApi(_httpClient, new Configuration { BasePath = BasePath, - Timeout = 10000, + Timeout = TimeSpan.FromSeconds(10), UserAgent = "TEST_USER_AGENT" }); diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 635dc63210d2..e6e2e5519c9b 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -482,7 +482,7 @@ private async Task> ExecAsync(HttpRequestMessage req, try { - if (configuration.Timeout > 0) + if (configuration.Timeout > TimeSpan.Zero) { timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs index bc16bd428535..08960c8389ea 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -231,7 +231,7 @@ public Configuration() }; // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; + Timeout = TimeSpan.FromSeconds(100); } /// @@ -315,9 +315,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index b3a84bc5bda3..6076bf2b1e51 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -71,10 +71,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs index b4c183d73311..140c3a3b83ed 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs @@ -456,7 +456,7 @@ private async Task> ExecClientAsync(Func @@ -216,9 +216,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 063daeb1b56c..ede1eec97a87 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -102,10 +102,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 76307fd39ac4..1b4d99d12689 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -456,7 +456,7 @@ private async Task> ExecClientAsync(Func @@ -321,9 +321,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 8713a816f356..1a8860767d20 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -102,10 +102,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 76307fd39ac4..1b4d99d12689 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -456,7 +456,7 @@ private async Task> ExecClientAsync(Func @@ -321,9 +321,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 8713a816f356..1a8860767d20 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -102,10 +102,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs index 9fc322566233..2b00f3e7dddc 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -454,7 +454,7 @@ private async Task> ExecClientAsync(Func @@ -220,9 +220,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index b694418eb75e..7d9d3648a8b8 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -71,10 +71,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs index ca7c3baede5f..9c43d5454b7c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -455,7 +455,7 @@ private async Task> ExecClientAsync(Func @@ -321,9 +321,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 986123acb8c6..ab66c761933f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -102,10 +102,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index ca7c3baede5f..9c43d5454b7c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -455,7 +455,7 @@ private async Task> ExecClientAsync(Func @@ -321,9 +321,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 986123acb8c6..ab66c761933f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -102,10 +102,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs index fd06cb542a11..c1690e3de7f8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs @@ -454,7 +454,7 @@ private async Task> ExecClientAsync(Func @@ -220,9 +220,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index b5ffbc06997d..ee2c1e0a819f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -71,10 +71,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs index 76307fd39ac4..1b4d99d12689 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs @@ -456,7 +456,7 @@ private async Task> ExecClientAsync(Func @@ -316,9 +316,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 8713a816f356..1a8860767d20 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -102,10 +102,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs index 35c2d517a210..e0779fde00f2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -154,7 +154,7 @@ public void GetPetByIdTest() { // set timeout to 10 seconds Configuration c1 = new Configuration(); - c1.Timeout = 10000; + c1.Timeout = TimeSpan.FromSeconds(10); c1.UserAgent = "TEST_USER_AGENT"; PetApi petApi = new PetApi(c1); diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 76307fd39ac4..1b4d99d12689 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -456,7 +456,7 @@ private async Task> ExecClientAsync(Func @@ -316,9 +316,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 8713a816f356..1a8860767d20 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -102,10 +102,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs index bc16bd428535..08960c8389ea 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -231,7 +231,7 @@ public Configuration() }; // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; + Timeout = TimeSpan.FromSeconds(100); } /// @@ -315,9 +315,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index b3a84bc5bda3..6076bf2b1e51 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -71,10 +71,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy.