From f8956ad090b3b25b3fbb254c28ed12aad8625cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Vieira?= Date: Mon, 12 Jan 2026 17:13:13 +0000 Subject: [PATCH 1/2] Upgrade to .NET 10 --- .github/workflows/automerge.yml | 2 +- .github/workflows/nuget.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- README.md | 2 -- src/Common.Projects.props | 4 ++-- .../Integration/BusinessAccountTest.cs | 4 ++-- .../Trakx.Circle.ApiClient.Tests.csproj | 23 +++++++++---------- .../ClientRegistrations.cs | 21 ++++++++--------- .../ClientRegistrations.tt | 2 +- .../PollyLoggingExtensions.cs | 6 ++--- .../Trakx.Circle.ApiClient.csproj | 10 ++++---- .../Utils/ApiKeyCredentialsProvider.cs | 7 +++--- 12 files changed, 42 insertions(+), 47 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 5b143f8..32b2ceb 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -12,6 +12,6 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Merge non major updates - uses: trakx/github-actions/dependabot-automerge@v10.1.2 + uses: trakx/github-actions/dependabot-automerge@v10.2.9 with: githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 332b956..81138ed 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -57,10 +57,10 @@ jobs: - name: Build and publish nuget packages id: publish - uses: trakx/github-actions/publish-nuget@v10.1.2 + uses: trakx/github-actions/publish-nuget@v10.2.9 with: packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} githubToken: ${{secrets.GITHUB_TOKEN}} debuggable: ${{steps.default-inputs.outputs.debuggable}} semverIncrementLevel: ${{steps.default-inputs.outputs.semverIncrementLevel}} - dotnetVersion: 8.x + dotnetVersion: 10.x diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16c8900..7a818af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,10 @@ jobs: steps: - name: Test and cover solutions id: test - uses: trakx/github-actions/test-dotnet@v10.1.2 + uses: trakx/github-actions/test-dotnet@v10.2.9 with: packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}} codacyToken: ${{secrets.CODACY_TOKEN}} awsAccessKeyId: ${{secrets.AWS_ACCESS_KEY_ID}} awsAccessKeySecret: ${{secrets.AWS_ACCESS_KEY_SECRET}} - dotnetVersion: 8.x + dotnetVersion: 10.x diff --git a/README.md b/README.md index 1655ae2..7097be1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ [![Build and Test](https://github.com/trakx/circle-api-client/actions/workflows/test.yml/badge.svg)](https://github.com/trakx/circle-api-client/actions/workflows/test.yml) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a11f6875244948d39af6c2350095490f)](https://www.codacy.com/gh/trakx/circle-api-client/dashboard?utm_source=github.com&utm_medium=referral&utm_content=trakx/circle-api-client&utm_campaign=Badge_Grade) -[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/435670815af049dc879feaa3cfd7cc81)](https://www.codacy.com/gh/trakx/circle-api-client/dashboard?utm_source=github.com&utm_medium=referral&utm_content=trakx/circle-api-client&utm_campaign=Badge_Coverage) # circle-api-client C# implementation of a Circle api client diff --git a/src/Common.Projects.props b/src/Common.Projects.props index bf5f5bd..7346140 100644 --- a/src/Common.Projects.props +++ b/src/Common.Projects.props @@ -1,7 +1,7 @@ Trakx - Copyright © 2024 Trakx + Copyright © 2026 Trakx https://github.com/trakx/circle-api-client git true @@ -14,7 +14,7 @@ latest - net8.0 + net10.0 0.1.0 diff --git a/src/Trakx.Circle.ApiClient.Tests/Integration/BusinessAccountTest.cs b/src/Trakx.Circle.ApiClient.Tests/Integration/BusinessAccountTest.cs index 6acbd68..04921b4 100644 --- a/src/Trakx.Circle.ApiClient.Tests/Integration/BusinessAccountTest.cs +++ b/src/Trakx.Circle.ApiClient.Tests/Integration/BusinessAccountTest.cs @@ -109,8 +109,8 @@ public async Task Get_Balance_Should_Be_Successful() Logger.Information("{Amount} {Currency}", money.Amount, money.Currency); } - availableBalance.Should().HaveCountGreaterOrEqualTo(minCount); - result.Content.Data.Unsettled.Should().HaveCountGreaterOrEqualTo(minCount); + availableBalance.Should().HaveCountGreaterThanOrEqualTo(minCount); + result.Content.Data.Unsettled.Should().HaveCountGreaterThanOrEqualTo(minCount); result.StatusCode.Should().Be(StatusCodes.Status200OK); } [Fact(Skip = "Payment SilverGate payment not working now")] diff --git a/src/Trakx.Circle.ApiClient.Tests/Trakx.Circle.ApiClient.Tests.csproj b/src/Trakx.Circle.ApiClient.Tests/Trakx.Circle.ApiClient.Tests.csproj index 43de457..985fd16 100644 --- a/src/Trakx.Circle.ApiClient.Tests/Trakx.Circle.ApiClient.Tests.csproj +++ b/src/Trakx.Circle.ApiClient.Tests/Trakx.Circle.ApiClient.Tests.csproj @@ -7,27 +7,26 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Trakx.Circle.ApiClient/ClientRegistrations.cs b/src/Trakx.Circle.ApiClient/ClientRegistrations.cs index 7b024dc..02de3d2 100644 --- a/src/Trakx.Circle.ApiClient/ClientRegistrations.cs +++ b/src/Trakx.Circle.ApiClient/ClientRegistrations.cs @@ -1,9 +1,8 @@ - -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using Polly; using Polly.Contrib.WaitAndRetry; using Polly.Extensions.Http; -using Serilog; namespace Trakx.Circle.ApiClient { @@ -24,7 +23,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.AccountsClient")); @@ -39,7 +38,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.PaymentsClient")); @@ -54,7 +53,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.CardsClient")); @@ -69,7 +68,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.BankAccountsClient")); @@ -84,7 +83,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.SettlementsClient")); @@ -99,7 +98,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.ChargebacksClient")); @@ -114,7 +113,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.ReversalsClient")); @@ -129,7 +128,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext(); + var logger = s.GetRequiredService>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("Trakx.Circle.ApiClient.BusinessAccountClient")); diff --git a/src/Trakx.Circle.ApiClient/ClientRegistrations.tt b/src/Trakx.Circle.ApiClient/ClientRegistrations.tt index 8aae788..6cf6ba5 100644 --- a/src/Trakx.Circle.ApiClient/ClientRegistrations.tt +++ b/src/Trakx.Circle.ApiClient/ClientRegistrations.tt @@ -45,7 +45,7 @@ namespace <#= nameSpace #> .WaitAndRetryAsync(delay, onRetry: (result, timeSpan, retryCount, context) => { - var logger = Log.Logger.ForContext<<#= name #>>(); + var logger = s.GetRequiredService>>(); logger.LogApiFailure(result, timeSpan, retryCount, context); }) .WithPolicyKey("<#= nameSpace #>.<#= name #>")); diff --git a/src/Trakx.Circle.ApiClient/PollyLoggingExtensions.cs b/src/Trakx.Circle.ApiClient/PollyLoggingExtensions.cs index 45464ac..b91866a 100644 --- a/src/Trakx.Circle.ApiClient/PollyLoggingExtensions.cs +++ b/src/Trakx.Circle.ApiClient/PollyLoggingExtensions.cs @@ -1,5 +1,5 @@ +using Microsoft.Extensions.Logging; using Polly; -using Serilog; namespace Trakx.Circle.ApiClient; @@ -20,12 +20,12 @@ public static void LogApiFailure(this ILogger logger, DelegateResult - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + diff --git a/src/Trakx.Circle.ApiClient/Utils/ApiKeyCredentialsProvider.cs b/src/Trakx.Circle.ApiClient/Utils/ApiKeyCredentialsProvider.cs index e6121c3..674c347 100644 --- a/src/Trakx.Circle.ApiClient/Utils/ApiKeyCredentialsProvider.cs +++ b/src/Trakx.Circle.ApiClient/Utils/ApiKeyCredentialsProvider.cs @@ -1,5 +1,6 @@ -using Serilog; +using Microsoft.Extensions.Logging; using Trakx.Common.ApiClient; +using Trakx.Common.Logging; namespace Trakx.Circle.ApiClient.Utils; @@ -9,7 +10,7 @@ public sealed class ApiKeyCredentialsProvider : ICircleCredentialsProvider, IDis private readonly CircleApiConfiguration _configuration; private readonly CancellationTokenSource _tokenSource; - private static readonly ILogger Logger = Log.Logger.ForContext(); + private static readonly ILogger Logger = LoggerProvider.Create(); public ApiKeyCredentialsProvider(CircleApiConfiguration configuration) { @@ -24,7 +25,7 @@ public ApiKeyCredentialsProvider(CircleApiConfiguration configuration) public void AddCredentials(HttpRequestMessage msg) { msg.Headers.Add("Authorization", $"Bearer {_configuration.ApiKey}"); - Logger.Verbose("Headers added"); + Logger.LogTrace("Headers added"); } public Task AddCredentialsAsync(HttpRequestMessage msg) From a7600e7b6095b392535a2ed8ecb71040867e78f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Vieira?= Date: Mon, 12 Jan 2026 17:21:59 +0000 Subject: [PATCH 2/2] Re-generate api client with latest version of nswag --- src/Trakx.Circle.ApiClient/ApiClients.cs | 1568 +++++++++++------ .../AuthorisedClient.cs | 2 - .../CircleApiConfiguration.cs | 2 +- .../ClientRegistrations.cs | 16 +- .../ClientRegistrations.tt | 2 +- .../Trakx.Circle.ApiClient.csproj | 2 +- src/Trakx.Circle.ApiClient/nswag.json | 4 +- 7 files changed, 1007 insertions(+), 589 deletions(-) diff --git a/src/Trakx.Circle.ApiClient/ApiClients.cs b/src/Trakx.Circle.ApiClient/ApiClients.cs index 4cb48cc..f804cd4 100644 --- a/src/Trakx.Circle.ApiClient/ApiClients.cs +++ b/src/Trakx.Circle.ApiClient/ApiClients.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- @@ -13,19 +13,23 @@ #pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' #pragma warning disable 612 // Disable "CS0612 '...' is obsolete" +#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" #pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type" +#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference" #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" #pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" #pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" +#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." namespace Trakx.Circle.ApiClient { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IAccountsClient { @@ -42,15 +46,23 @@ public partial interface IAccountsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class AccountsClient : AuthorisedClient, IAccountsClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public AccountsClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -60,10 +72,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -89,7 +103,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/businessAccount/balances" urlBuilder_.Append("v1/businessAccount/balances"); @@ -137,7 +151,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -168,6 +182,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -179,7 +213,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -195,7 +229,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -224,10 +258,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -267,7 +301,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IPaymentsClient { @@ -481,15 +515,23 @@ public partial interface IPaymentsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class PaymentsClient : AuthorisedClient, IPaymentsClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public PaymentsClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -499,10 +541,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -556,43 +600,43 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/payments" urlBuilder_.Append("v1/payments"); - urlBuilder_.Append('?'); - if (settlementId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("settlementId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(settlementId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (type != null) - { - foreach (var item_ in type) { urlBuilder_.Append(System.Uri.EscapeDataString("type")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (status != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("status")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (settlementId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("settlementId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(settlementId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (type != null) + { + foreach (var item_ in type) { urlBuilder_.Append(System.Uri.EscapeDataString("type")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } + } + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (status != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("status")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -638,7 +682,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -670,7 +714,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -678,7 +722,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/payments" urlBuilder_.Append("v1/payments"); @@ -746,7 +790,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -786,7 +830,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/payments/{id}" urlBuilder_.Append("v1/payments/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -845,7 +889,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -888,7 +932,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -896,7 +940,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/payments/{id}/cancel" urlBuilder_.Append("v1/payments/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -956,7 +1000,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -997,7 +1041,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -1005,7 +1049,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/payments/{id}/refund" urlBuilder_.Append("v1/payments/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -1065,7 +1109,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1100,7 +1144,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -1108,7 +1152,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/mocks/payments/wire" urlBuilder_.Append("v1/mocks/payments/wire"); @@ -1166,7 +1210,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1201,7 +1245,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -1209,7 +1253,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/wallets" urlBuilder_.Append("v1/wallets"); @@ -1247,7 +1291,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1314,31 +1358,31 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/wallets" urlBuilder_.Append("v1/wallets"); - urlBuilder_.Append('?'); - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -1384,7 +1428,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1424,7 +1468,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/wallets/{id}" urlBuilder_.Append("v1/wallets/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -1473,7 +1517,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1512,7 +1556,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -1520,7 +1564,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/wallets/{id}/addresses" urlBuilder_.Append("v1/wallets/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -1569,28 +1613,28 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new ApiException("The request cannot be processed due to a client error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 409) + if (status_ == 404) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ApiException("The request has not been applied because it comes in conflict with another request (such as re-using an idempotencyKey for a different request).", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ApiException("The specified resource was not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 404) + if (status_ == 409) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ApiException("The specified resource was not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ApiException("The request has not been applied because it comes in conflict with another request (such as re-using an idempotencyKey for a different request).", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1661,33 +1705,33 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/wallets/{id}/addresses" urlBuilder_.Append("v1/wallets/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); urlBuilder_.Append("/addresses"); - urlBuilder_.Append('?'); - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -1743,7 +1787,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1774,6 +1818,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -1785,7 +1849,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -1801,7 +1865,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -1830,10 +1894,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -1873,7 +1937,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ICardsClient { @@ -1939,15 +2003,23 @@ public partial interface ICardsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class CardsClient : AuthorisedClient, ICardsClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public CardsClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -1957,10 +2029,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -1979,7 +2053,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -1987,7 +2061,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/cards" urlBuilder_.Append("v1/cards"); @@ -2045,7 +2119,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2107,23 +2181,23 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/cards" urlBuilder_.Append("v1/cards"); - urlBuilder_.Append('?'); - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -2169,7 +2243,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2209,7 +2283,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/cards/{id}" urlBuilder_.Append("v1/cards/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -2268,7 +2342,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2304,7 +2378,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -2312,7 +2386,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/cards/{id}" urlBuilder_.Append("v1/cards/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -2351,7 +2425,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2382,6 +2456,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -2393,7 +2487,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -2409,7 +2503,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -2438,10 +2532,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -2481,7 +2575,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IBankAccountsClient { @@ -2547,15 +2641,23 @@ public partial interface IBankAccountsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class BankAccountsClient : AuthorisedClient, IBankAccountsClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public BankAccountsClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -2565,10 +2667,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -2587,7 +2691,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -2595,7 +2699,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/banks/wires" urlBuilder_.Append("v1/banks/wires"); @@ -2663,7 +2767,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2703,7 +2807,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/banks/wires/{id}" urlBuilder_.Append("v1/banks/wires/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -2762,7 +2866,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2802,7 +2906,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/banks/wires/{id}/instructions" urlBuilder_.Append("v1/banks/wires/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -2862,7 +2966,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2897,7 +3001,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -2905,7 +3009,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/banks/ach" urlBuilder_.Append("v1/banks/ach"); @@ -2963,7 +3067,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3006,7 +3110,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/banks/ach/{id}" urlBuilder_.Append("v1/banks/ach/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -3065,7 +3169,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3100,7 +3204,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -3108,7 +3212,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/mocks/ach/accounts" urlBuilder_.Append("v1/mocks/ach/accounts"); @@ -3166,7 +3270,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3197,6 +3301,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -3208,7 +3332,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -3224,7 +3348,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -3253,10 +3377,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -3296,7 +3420,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ISettlementsClient { @@ -3347,15 +3471,23 @@ public partial interface ISettlementsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class SettlementsClient : AuthorisedClient, ISettlementsClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public SettlementsClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -3365,10 +3497,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -3419,31 +3553,31 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/settlements" urlBuilder_.Append("v1/settlements"); - urlBuilder_.Append('?'); - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -3489,7 +3623,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3529,7 +3663,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/settlements/{id}" urlBuilder_.Append("v1/settlements/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -3588,7 +3722,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3619,6 +3753,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -3630,7 +3784,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -3646,7 +3800,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -3675,10 +3829,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -3718,7 +3872,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IChargebacksClient { @@ -3783,15 +3937,23 @@ public partial interface IChargebacksClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class ChargebacksClient : AuthorisedClient, IChargebacksClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public ChargebacksClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -3801,10 +3963,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -3858,31 +4022,31 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/chargebacks" urlBuilder_.Append("v1/chargebacks"); - urlBuilder_.Append('?'); - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -3938,7 +4102,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3978,7 +4142,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/chargebacks/{id}" urlBuilder_.Append("v1/chargebacks/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -4037,7 +4201,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4072,7 +4236,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -4080,7 +4244,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/mocks/cards/chargebacks" urlBuilder_.Append("v1/mocks/cards/chargebacks"); @@ -4158,7 +4322,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4189,6 +4353,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -4200,7 +4384,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -4216,7 +4400,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -4245,10 +4429,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -4288,7 +4472,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IReversalsClient { @@ -4333,15 +4517,23 @@ public partial interface IReversalsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class ReversalsClient : AuthorisedClient, IReversalsClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public ReversalsClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -4351,10 +4543,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -4408,31 +4602,31 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/reversals" urlBuilder_.Append("v1/reversals"); - urlBuilder_.Append('?'); - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -4488,7 +4682,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4519,6 +4713,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -4530,7 +4744,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -4546,7 +4760,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -4575,10 +4789,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -4618,7 +4832,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IBusinessAccountClient { @@ -4703,15 +4917,23 @@ public partial interface IBusinessAccountClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class BusinessAccountClient : AuthorisedClient, IBusinessAccountClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public BusinessAccountClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -4721,10 +4943,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -4750,7 +4974,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/businessAccount/banks/signet" urlBuilder_.Append("v1/businessAccount/banks/signet"); @@ -4808,7 +5032,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4843,7 +5067,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -4851,7 +5075,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/businessAccount/banks/signet" urlBuilder_.Append("v1/businessAccount/banks/signet"); @@ -4878,24 +5102,24 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 201) + if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ApiException("Successfully created a signet bank.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + return new Trakx.Common.ApiClient.Response(status_, headers_, objectResponse_.Object); } else - if (status_ == 200) + if (status_ == 201) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - return new Trakx.Common.ApiClient.Response(status_, headers_, objectResponse_.Object); + throw new ApiException("Successfully created a signet bank.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 400) @@ -4929,7 +5153,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4972,7 +5196,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/businessAccount/banks/signet/{id}" urlBuilder_.Append("v1/businessAccount/banks/signet/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -5041,7 +5265,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5076,7 +5300,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -5084,7 +5308,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/businessAccount/banks/sen" urlBuilder_.Append("v1/businessAccount/banks/sen"); @@ -5111,24 +5335,24 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 201) + if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ApiException("Successfully created a SilverGate bank", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + return new Trakx.Common.ApiClient.Response(status_, headers_, objectResponse_.Object); } else - if (status_ == 200) + if (status_ == 201) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - return new Trakx.Common.ApiClient.Response(status_, headers_, objectResponse_.Object); + throw new ApiException("Successfully created a SilverGate bank", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 400) @@ -5162,7 +5386,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5201,7 +5425,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/businessAccount/banks/sen" urlBuilder_.Append("v1/businessAccount/banks/sen"); @@ -5259,7 +5483,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5294,7 +5518,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -5302,7 +5526,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/mocks/payments/sen" urlBuilder_.Append("v1/mocks/payments/sen"); @@ -5329,7 +5553,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5339,7 +5563,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return new Trakx.Common.ApiClient.Response(status_, headers_, objectResponse_.Object); } else - if (status_ == 200) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5380,7 +5604,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5423,7 +5647,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/businessAccount/banks/sen/{id}/instructions" urlBuilder_.Append("v1/businessAccount/banks/sen/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -5493,7 +5717,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5524,6 +5748,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -5535,7 +5779,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -5551,7 +5795,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -5580,10 +5824,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -5623,7 +5867,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IWalletsClient { @@ -5681,15 +5925,23 @@ public partial interface IWalletsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class WalletsClient : AuthorisedClient, IWalletsClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public WalletsClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -5699,10 +5951,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -5728,7 +5982,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -5736,7 +5990,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/wallets/{walletId}/addresses" urlBuilder_.Append("v1/wallets/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(walletId, System.Globalization.CultureInfo.InvariantCulture))); @@ -5785,28 +6039,28 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new ApiException("The request cannot be processed due to a client error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 409) + if (status_ == 404) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ApiException("The request has not been applied because it comes in conflict with another request (such as re-using an idempotencyKey for a different request).", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ApiException("The specified resource was not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 404) + if (status_ == 409) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ApiException("The specified resource was not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ApiException("The request has not been applied because it comes in conflict with another request (such as re-using an idempotencyKey for a different request).", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5877,33 +6131,33 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/wallets/{walletId}/addresses" urlBuilder_.Append("v1/wallets/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(walletId, System.Globalization.CultureInfo.InvariantCulture))); urlBuilder_.Append("/addresses"); - urlBuilder_.Append('?'); - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -5959,7 +6213,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5990,6 +6244,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -6001,7 +6275,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -6017,7 +6291,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -6046,10 +6320,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -6089,7 +6363,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ITransfersClient { @@ -6157,15 +6431,23 @@ public partial interface ITransfersClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] internal partial class TransfersClient : AuthorisedClient, ITransfersClient { + #pragma warning disable 8618 + private string _baseUrl; + #pragma warning restore 8618 + private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); + private Newtonsoft.Json.JsonSerializerSettings _instanceSettings; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public TransfersClient(ClientConfigurator configuration, System.Net.Http.HttpClient httpClient) : base(configuration) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { _httpClient = httpClient; + Initialize(); } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -6175,10 +6457,12 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() return settings; } - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } } static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void Initialize(); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); @@ -6200,7 +6484,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; @@ -6208,7 +6492,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/transfers" urlBuilder_.Append("v1/transfers"); @@ -6246,7 +6530,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -6316,43 +6600,43 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/transfers" urlBuilder_.Append("v1/transfers"); - urlBuilder_.Append('?'); - if (walletId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("walletId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(walletId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sourceWalletId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("sourceWalletId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(sourceWalletId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (destinationWalletId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("destinationWalletId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(destinationWalletId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (from != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (to != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageBefore != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageAfter != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (pageSize != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; + urlBuilder_.Append('?'); + if (walletId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("walletId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(walletId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (sourceWalletId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("sourceWalletId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(sourceWalletId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (destinationWalletId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("destinationWalletId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(destinationWalletId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (from != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("from")).Append('=').Append(System.Uri.EscapeDataString(from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (to != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("to")).Append('=').Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageBefore != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageBefore")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageBefore, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageAfter != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageAfter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageAfter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (pageSize != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("pageSize")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; PrepareRequest(client_, request_, urlBuilder_); @@ -6398,7 +6682,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -6438,7 +6722,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); var urlBuilder_ = new System.Text.StringBuilder(); - if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl); + if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl); // Operation Path: "v1/transfers/{id}" urlBuilder_.Append("v1/transfers/"); urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); @@ -6477,7 +6761,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -6508,6 +6792,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -6519,7 +6823,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); @@ -6535,7 +6839,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) using (var streamReader = new System.IO.StreamReader(responseStream)) using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) { @@ -6564,10 +6868,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -6607,9 +6911,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record PaymentResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public System.Collections.Generic.List Data { get; set; } = new System.Collections.Generic.List(); @@ -6625,9 +6930,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SilverGateSenPaymentResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Data Data { get; set; } = new Data(); @@ -6643,9 +6949,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SilverGateSenBankTransferRequest { + /// /// Circle tracking reference that needs to be set in the memo filed. This field is retrievable through the response during SEN account creation or via the bank instruction endpoint. /// @@ -6672,9 +6979,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SilverGateSenBankRequest { + /// /// Universally unique identifier (UUID v4) idempotency key. This key is utilized to ensure exactly-once execution of mutating requests. /// @@ -6707,9 +7015,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SilverGateSenBankResponse { + /// /// Unique system generated identifier for the entity. /// @@ -6764,9 +7073,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Balances { + /// /// List of currency balances (one for each currency) that are currently available to spend. /// @@ -6792,9 +7102,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BalancesResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Balances Data { get; set; } = new Balances(); @@ -6810,9 +7121,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Money { + /// /// Magnitude of the amount, in units of the currency, with a `.` decimal. /// @@ -6838,9 +7150,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Error { + [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Always)] public int Code { get; init; } @@ -6859,9 +7172,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Source { + /// /// Unique identifier for the source. /// @@ -6889,7 +7203,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// Enumerated status of the payment. `pending` means the payment is waiting to be processed. `confirmed` means the payment has been approved by the bank and the merchant can treat it as successful, but settlement funds are not yet available to the merchant. `paid` means settlement funds have been received and are available to the merchant. `failed` means something went wrong (most commonly that the payment was denied). Terminal states are `paid` and `failed`. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum PaymentStatus { @@ -6910,9 +7224,10 @@ public enum PaymentStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SilverGateBankInstructionResponse { + /// /// Tracking ref that needs to be set in the public description field when you send the funds to Circle Signet wallet /// @@ -6942,9 +7257,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SignetBank { + /// /// Unique system generated identifier for the entity. /// @@ -6990,9 +7306,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A source blockchain address. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SourceBlockchainLocation { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] @@ -7017,9 +7334,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A source wallet address. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SourceWalletLocation { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] @@ -7043,9 +7361,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A destination wallet location. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DestinationWalletLocation { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] @@ -7078,9 +7397,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A destination blockchain address. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DestinationBlockchainLocation { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] @@ -7102,9 +7422,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record TransferResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Transfer Data { get; set; } = new Transfer(); @@ -7123,9 +7444,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A transfer of funds. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Transfer { + /// /// Unique identifier for this transfer. /// @@ -7196,9 +7518,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedTransferResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public DetailedTransfer Data { get; set; } = new DetailedTransfer(); @@ -7217,9 +7540,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A transfer of funds. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedTransfer { + /// /// Unique identifier for this transfer. /// @@ -7271,9 +7595,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A destination of funds. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Destination { + /// /// Unique identifier for this transfer. /// @@ -7313,9 +7638,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A user address. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record UserAddress { + /// /// Address of the beneficiary's bank. /// @@ -7351,9 +7677,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SignetBankCreationRequest { + /// /// Universally unique identifier (UUID v4) idempotency key. This key is utilized to ensure exactly-once execution of mutating requests. /// @@ -7379,9 +7706,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record RequestWalletLocation { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] @@ -7408,9 +7736,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A source blockchain address. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record RequestBlockchainLocation { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] @@ -7432,9 +7761,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record TransferCreationRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -7462,9 +7792,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record PaymentInfoPaymentAndRefund { + /// /// Unique system generated identifier for the item. /// @@ -7509,9 +7840,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record PaymentInfoCancel { + /// /// Unique system generated identifier for the item. /// @@ -7549,9 +7881,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MetadataPayment { + [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.StringLength(1024)] @@ -7585,9 +7918,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// PGP encrypted json string. The object format given here needs to be stringified and PGP encrypted before it is sent to the server, so `encryptedData` will end up as a string, rather than an object. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record EncryptedCardPaymentData { + /// /// Card Verification Number. Three or four digit security code. Only required if verification includes a cvv check. /// @@ -7605,9 +7939,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record CardPaymentCreationRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -7661,9 +7996,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record RiskEvaluation { + /// /// Enumerated decision of the card. /// @@ -7688,9 +8024,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MetadataPhoneEmail { + [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.StringLength(1024)] @@ -7715,7 +8052,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// Indicates the failure reason of a payment. Only present for payments in failed state. Possible values are [payment_failed, payment_fraud_detected, payment_denied, payment_not_supported_by_issuer, payment_not_funded, payment_unprocessable, payment_stopped_by_issuer, payment_canceled, payment_returned, payment_failed_balance_check, card_failed, card_invalid, card_address_mismatch, card_zip_mismatch, card_cvv_invalid, card_expired, card_limit_violated, card_not_honored, card_cvv_required, credit_card_not_allowed, card_account_ineligible, unauthorized_transaction, bank_account_ineligible, bank_transaction_error, invalid_account_number, invalid_wire_rtn, invalid_ach_rtn] /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum PaymentErrorCode { @@ -7805,7 +8142,7 @@ public enum PaymentErrorCode /// /// Indicates the failure reason of the card verification. Only present on cards with failed verification. Possible values are [verification_failed, verification_fraud_detected, verification_denied, verification_not_supported_by_issuer, verification_stopped_by_issuer, card_failed, card_invalid, card_address_mismatch, card_zip_mismatch, card_cvv_invalid, card_expired, card_limit_violated, card_not_honored, card_cvv_required, credit_card_not_allowed, card_account_ineligible] /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum VerificationResponse { @@ -7859,9 +8196,10 @@ public enum VerificationResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedPaymentResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public DetailedPayment Data { get; set; } = new DetailedPayment(); @@ -7877,9 +8215,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedPayment { + /// /// Unique system generated identifier for the payment item. /// @@ -7987,9 +8326,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BasicPayment { + /// /// Unique system generated identifier for the payment item. /// @@ -8070,9 +8410,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BasicCancel { + /// /// Unique system generated identifier for the payment item. /// @@ -8150,9 +8491,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BasicRefund { + /// /// Unique system generated identifier for the payment item. /// @@ -8236,9 +8578,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedPaymentPolymorphicResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public DetailedPaymentPolymorphic Data { get; set; } = new DetailedPaymentPolymorphic(); @@ -8254,9 +8597,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedPaymentPolymorphic { + /// /// Unique system generated identifier for the payment item. /// @@ -8370,9 +8714,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedCancelResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public DetailedCancel Data { get; set; } = new DetailedCancel(); @@ -8388,9 +8733,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedCancel { + /// /// Unique system generated identifier for the payment item. /// @@ -8493,9 +8839,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MetadataCard { + [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.StringLength(1024)] @@ -8526,9 +8873,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BillingDetails { + /// /// Full name of the card or bank account holder. /// @@ -8594,9 +8942,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record CardCreationRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -8653,7 +9002,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// Enumerated reason for a returned payment. Providing this reason in the request is recommended (to improve risk evaluation) but not required. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum ReversalReason { @@ -8695,9 +9044,10 @@ public enum ReversalReason } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record CancelCreationRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -8717,9 +9067,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record RefundCreationRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -8743,9 +9094,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedRefundResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public DetailedRefund Data { get; set; } = new DetailedRefund(); @@ -8761,9 +9113,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record DetailedRefund { + /// /// Unique system generated identifier for the payment item. /// @@ -8867,9 +9220,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MockWirePaymentRequest { + /// /// Wire tracking reference that needs to be set in the wire reference to beneficiary field. This field is retrievable through the response during wire creation or via the bank instruction endpoint. /// @@ -8899,9 +9253,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MockWirePaymentResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Data2 Data { get; set; } = new Data2(); @@ -8920,7 +9275,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// Indicates the failure reason of the card verification. Only present on cards with failed verification. Possible values are [verification_failed, verification_fraud_detected, verification_denied, verification_not_supported_by_issuer, verification_stopped_by_issuer, card_failed, card_invalid, card_address_mismatch, card_zip_mismatch, card_cvv_invalid, card_expired, card_limit_violated, card_not_honored, card_cvv_required, credit_card_not_allowed, card_account_ineligible] /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum VerificationErrorCode { @@ -8974,9 +9329,10 @@ public enum VerificationErrorCode } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record CardResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Card Data { get; set; } = new Card(); @@ -8992,9 +9348,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Card { + /// /// Unique system generated identifier for the card. /// @@ -9100,9 +9457,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SimpleBillingDetails { + /// /// Country portion of the address. Formatted as a two-letter country code specified in ISO 3166-1 alpha-2. /// @@ -9130,9 +9488,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SimpleCardResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public System.Collections.Generic.List Data { get; set; } = new System.Collections.Generic.List(); @@ -9148,9 +9507,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record SimpleCard { + /// /// Unique system generated identifier for the card. /// @@ -9233,9 +9593,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// PGP encrypted json string. The object format given here needs to be stringified and PGP encrypted before it is sent to the server, so `encryptedData` will end up as a string, rather than an object. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record EncryptedCardUpdateData { + /// /// Card Verification Number. Three or four digit security code. /// @@ -9254,9 +9615,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record CardUpdate { + /// /// Unique identifier of the public key used in encryption. /// @@ -9293,9 +9655,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BankAddressIbanSupported { + /// /// Name of the bank. This property is required for bank accounts outside of the US that do not support IBAN /// @@ -9351,9 +9714,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BankAddressNonIban { + /// /// Name of the bank. This property is required for bank accounts outside of the US that do not support IBAN /// @@ -9410,9 +9774,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BankAddress { + /// /// Name of the bank. This property is required for bank accounts outside of the US that do not support IBAN /// @@ -9470,9 +9835,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// Relevant fields for U.S. bank accounts. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireCreationRequest_US { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -9519,9 +9885,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// Relevant fields for non-U.S. bank accounts that support IBAN. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireCreationRequest_iban { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -9561,9 +9928,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// Relevant fields for non-U.S. banks that do NOT support IBAN. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireCreationRequest_accountNumber { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -9607,9 +9975,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Wire Data { get; set; } = new Wire(); @@ -9625,9 +9994,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Wire { + /// /// Unique system generated identifier for the bank account (wires). /// @@ -9678,9 +10048,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireInstructionBeneficiary { + /// /// Name of the beneficiary. /// @@ -9710,9 +10081,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireInstructionBeneficiaryBank { + /// /// Name of the beneficiary's bank. /// @@ -9772,9 +10144,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireInstructionResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public WireInstruction Data { get; set; } = new WireInstruction(); @@ -9790,9 +10163,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WireInstruction { + /// /// Wire tracking ref that needs to be set in the wire reference field. /// @@ -9816,9 +10190,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record ACHCreationRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -9848,9 +10223,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record ACHResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public ACH Data { get; set; } = new ACH(); @@ -9866,9 +10242,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record ACH { + /// /// Unique system generated identifier for the ACH account. /// @@ -9950,9 +10327,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MockAchAccount { + /// /// The account number of the ACH account. /// @@ -9988,9 +10366,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MockAchAccountCreationRequest { + [Newtonsoft.Json.JsonProperty("account", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public MockAchAccount Account { get; set; } = new MockAchAccount(); @@ -10013,9 +10392,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MockAchAccountResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Data3 Data { get; set; } = new Data3(); @@ -10031,9 +10411,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WalletCreationRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -10056,9 +10437,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record WalletResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public Wire Data { get; set; } = new Wire(); @@ -10074,9 +10456,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Wallet { + /// /// Wallet identifier. Numeric value but should be treated as a string as format may change in the future /// @@ -10123,7 +10506,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti /// /// A blockchain that a given currency is available on. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum Chain { @@ -10141,7 +10524,7 @@ public enum Chain /// /// A currency associated with a balance or address. Currently, only `USD` is supported. /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum Currency { @@ -10150,9 +10533,10 @@ public enum Currency } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record GenerateAddressRequest { + [Newtonsoft.Json.JsonProperty("idempotencyKey", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Guid IdempotencyKey { get; set; } @@ -10178,9 +10562,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record AddressResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public System.Collections.Generic.List Data { get; set; } = new System.Collections.Generic.List(); @@ -10196,9 +10581,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record AddressObjectResponse { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] public AddressObject Data { get; set; } = new AddressObject(); @@ -10214,9 +10600,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record AddressObject { + [Newtonsoft.Json.JsonProperty("address", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Address { get; init; } @@ -10239,9 +10626,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Settlement { + /// /// Unique system generated identifier for the settlement. Can be used to filter for payments settled by this settlement. /// @@ -10307,9 +10695,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BasicChargebackHistory { + /// /// Enumerated type of the chargeback history event. `1st Chargeback` represents the first stage of the dispute procedure initiated by the cardholder’s issuing bank. `2nd Chargeback` represents the second stage of the dispute procedure initiated by the cardholder’s issuing bank (This stage is MasterCard only). `Chargeback Reversal` represents when 1st Chargeback or 2nd Chargeback is withdrawn by the issuer. `Representment` represents the stage when merchants decided to dispute 1st Chargeback or 2nd Chargeback. `Chargeback Settlement` can imply one of the two: 1) If merchant or marketplace is taking the lost of the chargeback, money will be debit from the wallet during this stage. 2) If merchant of marketplace successfully dispute the chargeback, money will be credit back to the wallet during this stage. /// @@ -10358,9 +10747,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BasicChargeback { + /// /// Unique system generated identifier for the chargeback item. /// @@ -10401,9 +10791,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MockChargebackCreationRequest { + /// /// The id of the payment to be charged back. Each payment can only be charged back once. /// @@ -10422,7 +10813,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record MockChargeback { @@ -10437,9 +10828,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Reversal { + /// /// Unique system generated identifier for the reversal item. /// @@ -10498,7 +10890,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum Anonymous { @@ -10516,7 +10908,7 @@ public enum Anonymous } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum Status { @@ -10537,9 +10929,10 @@ public enum Status } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public Wallet Data { get; init; } @@ -10554,9 +10947,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response2 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.List Data { get; init; } @@ -10571,9 +10965,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response3 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public AddressObject Data { get; init; } @@ -10588,9 +10983,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response4 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.List Data { get; init; } @@ -10605,9 +11001,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response5 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.List Data { get; init; } @@ -10622,9 +11019,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response6 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public Settlement Data { get; init; } @@ -10639,9 +11037,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response7 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.List Data { get; init; } @@ -10656,9 +11055,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response8 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public BasicChargeback Data { get; init; } @@ -10673,9 +11073,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response9 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public MockChargeback Data { get; init; } @@ -10690,9 +11091,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response10 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.List Data { get; init; } @@ -10707,9 +11109,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response11 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.List Data { get; init; } @@ -10724,9 +11127,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response12 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public SignetBank Data { get; init; } @@ -10741,9 +11145,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response13 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public SignetBank Data { get; init; } @@ -10758,9 +11163,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response14 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public SignetBank Data { get; init; } @@ -10775,9 +11181,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response15 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public SilverGateSenBankResponse Data { get; init; } @@ -10792,9 +11199,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response16 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public SilverGateSenBankResponse Data { get; init; } @@ -10809,9 +11217,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response17 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.List Data { get; init; } @@ -10826,9 +11235,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Response18 { + [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public SilverGateBankInstructionResponse Data { get; init; } @@ -10843,9 +11253,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Data { + /// /// Circle tracking reference that needs to be set in the memo filed. This field is retrievable through the response during SEN account creation or via the bank instruction endpoint. /// @@ -10873,9 +11284,10 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BeneficiaryBank { + /// /// Circle corporate Silvergate SEN account number that needs to be set as destination. /// @@ -10893,7 +11305,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum SilverGateSenBankResponseStatus { @@ -10908,7 +11320,7 @@ public enum SilverGateSenBankResponseStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum SourceType { @@ -10926,7 +11338,7 @@ public enum SourceType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum SignetBankStatus { @@ -10941,7 +11353,7 @@ public enum SignetBankStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum SourceBlockchainLocationType { @@ -10950,7 +11362,7 @@ public enum SourceBlockchainLocationType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum SourceWalletLocationType { @@ -10959,7 +11371,7 @@ public enum SourceWalletLocationType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DestinationWalletLocationType { @@ -10968,7 +11380,7 @@ public enum DestinationWalletLocationType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DestinationBlockchainLocationType { @@ -10977,7 +11389,7 @@ public enum DestinationBlockchainLocationType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum TransferSource { @@ -10992,9 +11404,10 @@ public enum TransferSource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Destination2 { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public Destination2Type? Type { get; set; } @@ -11028,7 +11441,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum TransferStatus { @@ -11043,7 +11456,7 @@ public enum TransferStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum TransferErrorCode { @@ -11061,7 +11474,7 @@ public enum TransferErrorCode } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedTransferStatus { @@ -11076,7 +11489,7 @@ public enum DetailedTransferStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DestinationStatus { @@ -11091,7 +11504,7 @@ public enum DestinationStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum RequestWalletLocationType { @@ -11100,7 +11513,7 @@ public enum RequestWalletLocationType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum RequestBlockchainLocationType { @@ -11109,7 +11522,7 @@ public enum RequestBlockchainLocationType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum PaymentInfoPaymentAndRefundType { @@ -11121,7 +11534,7 @@ public enum PaymentInfoPaymentAndRefundType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum PaymentInfoPaymentAndRefundDescription { @@ -11130,7 +11543,7 @@ public enum PaymentInfoPaymentAndRefundDescription } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum PaymentInfoCancelType { @@ -11139,7 +11552,7 @@ public enum PaymentInfoCancelType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum CardPaymentCreationRequestVerification { @@ -11151,7 +11564,7 @@ public enum CardPaymentCreationRequestVerification } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum RiskEvaluationDecision { @@ -11166,7 +11579,7 @@ public enum RiskEvaluationDecision } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedPaymentType { @@ -11175,7 +11588,7 @@ public enum DetailedPaymentType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedPaymentDescription { @@ -11184,7 +11597,7 @@ public enum DetailedPaymentDescription } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum BasicPaymentType { @@ -11196,7 +11609,7 @@ public enum BasicPaymentType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum BasicCancelType { @@ -11205,7 +11618,7 @@ public enum BasicCancelType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum BasicRefundType { @@ -11214,7 +11627,7 @@ public enum BasicRefundType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedPaymentPolymorphicType { @@ -11229,7 +11642,7 @@ public enum DetailedPaymentPolymorphicType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedPaymentPolymorphicDescription { @@ -11238,7 +11651,7 @@ public enum DetailedPaymentPolymorphicDescription } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedCancelType { @@ -11247,7 +11660,7 @@ public enum DetailedCancelType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedRefundType { @@ -11256,7 +11669,7 @@ public enum DetailedRefundType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DetailedRefundDescription { @@ -11265,9 +11678,10 @@ public enum DetailedRefundDescription } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Data2 { + /// /// Wire tracking reference that needs to be set in the wire reference to beneficiary field. This field is retrievable through the response during wire creation or via the bank instruction endpoint. /// @@ -11294,7 +11708,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum CardStatus { @@ -11309,7 +11723,7 @@ public enum CardStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum ACHStatus { @@ -11324,9 +11738,10 @@ public enum ACHStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record Data3 { + /// /// The processor token needs to be provided when linking an ACH account against this mock. /// @@ -11353,7 +11768,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum WalletType { @@ -11362,7 +11777,7 @@ public enum WalletType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum BasicChargebackHistoryType { @@ -11383,9 +11798,10 @@ public enum BasicChargebackHistoryType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial record BeneficiaryBank2 { + /// /// Circle corporate Silvergate SEN account number that needs to be set as destination. /// @@ -11403,7 +11819,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum DataStatus { @@ -11418,7 +11834,7 @@ public enum DataStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public enum Destination2Type { @@ -11432,7 +11848,7 @@ public enum Destination2Type - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApiException : System.Exception { public int StatusCode { get; private set; } @@ -11455,7 +11871,7 @@ public override string ToString() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApiException : ApiException { public TResult Result { get; private set; } @@ -11473,10 +11889,14 @@ public ApiException(string message, int statusCode, string response, System.Coll #pragma warning restore 114 #pragma warning restore 472 #pragma warning restore 612 +#pragma warning restore 649 #pragma warning restore 1573 #pragma warning restore 1591 #pragma warning restore 8073 #pragma warning restore 3016 +#pragma warning restore 8600 +#pragma warning restore 8602 #pragma warning restore 8603 #pragma warning restore 8604 -#pragma warning restore 8625 \ No newline at end of file +#pragma warning restore 8625 +#pragma warning restore 8765 \ No newline at end of file diff --git a/src/Trakx.Circle.ApiClient/AuthorisedClient.cs b/src/Trakx.Circle.ApiClient/AuthorisedClient.cs index 92e8c5f..65149f5 100644 --- a/src/Trakx.Circle.ApiClient/AuthorisedClient.cs +++ b/src/Trakx.Circle.ApiClient/AuthorisedClient.cs @@ -5,11 +5,9 @@ namespace Trakx.Circle.ApiClient; internal abstract class AuthorisedClient { protected readonly ICredentialsProvider CredentialProvider; - protected string BaseUrl { get; } protected AuthorisedClient(ClientConfigurator configurator) { CredentialProvider = configurator.CredentialsProvider; - BaseUrl = configurator.ApiConfiguration.BaseUrl.AbsoluteUri; } } diff --git a/src/Trakx.Circle.ApiClient/CircleApiConfiguration.cs b/src/Trakx.Circle.ApiClient/CircleApiConfiguration.cs index dc4cff0..6355a09 100644 --- a/src/Trakx.Circle.ApiClient/CircleApiConfiguration.cs +++ b/src/Trakx.Circle.ApiClient/CircleApiConfiguration.cs @@ -7,7 +7,7 @@ public record CircleApiConfiguration public Uri BaseUrl { get; init; } = new("about:blank"); [AwsParameter, SecretEnvironmentVariable] - public string ApiKey { get; init; } = default!; + public string ApiKey { get; init; } = null!; public double? InitialRetryDelayInMilliseconds { get; init; } public int? MaxRetryCount { get; init; } } diff --git a/src/Trakx.Circle.ApiClient/ClientRegistrations.cs b/src/Trakx.Circle.ApiClient/ClientRegistrations.cs index 02de3d2..5b301f8 100644 --- a/src/Trakx.Circle.ApiClient/ClientRegistrations.cs +++ b/src/Trakx.Circle.ApiClient/ClientRegistrations.cs @@ -14,7 +14,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig medianFirstRetryDelay: TimeSpan.FromMilliseconds(configuration.InitialRetryDelayInMilliseconds ?? 100), retryCount: configuration.MaxRetryCount ?? 10, fastFirst: true); - services.AddHttpClient("Trakx.Circle.ApiClient.AccountsClient") + services.AddHttpClient("Trakx.Circle.ApiClient.AccountsClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() @@ -29,7 +29,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WithPolicyKey("Trakx.Circle.ApiClient.AccountsClient")); - services.AddHttpClient("Trakx.Circle.ApiClient.PaymentsClient") + services.AddHttpClient("Trakx.Circle.ApiClient.PaymentsClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() @@ -44,7 +44,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WithPolicyKey("Trakx.Circle.ApiClient.PaymentsClient")); - services.AddHttpClient("Trakx.Circle.ApiClient.CardsClient") + services.AddHttpClient("Trakx.Circle.ApiClient.CardsClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() @@ -59,7 +59,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WithPolicyKey("Trakx.Circle.ApiClient.CardsClient")); - services.AddHttpClient("Trakx.Circle.ApiClient.BankAccountsClient") + services.AddHttpClient("Trakx.Circle.ApiClient.BankAccountsClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() @@ -74,7 +74,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WithPolicyKey("Trakx.Circle.ApiClient.BankAccountsClient")); - services.AddHttpClient("Trakx.Circle.ApiClient.SettlementsClient") + services.AddHttpClient("Trakx.Circle.ApiClient.SettlementsClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() @@ -89,7 +89,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WithPolicyKey("Trakx.Circle.ApiClient.SettlementsClient")); - services.AddHttpClient("Trakx.Circle.ApiClient.ChargebacksClient") + services.AddHttpClient("Trakx.Circle.ApiClient.ChargebacksClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() @@ -104,7 +104,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WithPolicyKey("Trakx.Circle.ApiClient.ChargebacksClient")); - services.AddHttpClient("Trakx.Circle.ApiClient.ReversalsClient") + services.AddHttpClient("Trakx.Circle.ApiClient.ReversalsClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() @@ -119,7 +119,7 @@ private static void AddClients(this IServiceCollection services, CircleApiConfig .WithPolicyKey("Trakx.Circle.ApiClient.ReversalsClient")); - services.AddHttpClient("Trakx.Circle.ApiClient.BusinessAccountClient") + services.AddHttpClient("Trakx.Circle.ApiClient.BusinessAccountClient", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() diff --git a/src/Trakx.Circle.ApiClient/ClientRegistrations.tt b/src/Trakx.Circle.ApiClient/ClientRegistrations.tt index 6cf6ba5..6588f35 100644 --- a/src/Trakx.Circle.ApiClient/ClientRegistrations.tt +++ b/src/Trakx.Circle.ApiClient/ClientRegistrations.tt @@ -36,7 +36,7 @@ namespace <#= nameSpace #> { #> - services.AddHttpClient, <#= name #>>("<#= nameSpace #>.<#= name #>") + services.AddHttpClient, <#= name #>>("<#= nameSpace #>.<#= name #>", client => client.BaseAddress = configuration.BaseUrl) .AddPolicyHandler((s, request) => Policy .Handle() diff --git a/src/Trakx.Circle.ApiClient/Trakx.Circle.ApiClient.csproj b/src/Trakx.Circle.ApiClient/Trakx.Circle.ApiClient.csproj index 07060bb..73f9806 100644 --- a/src/Trakx.Circle.ApiClient/Trakx.Circle.ApiClient.csproj +++ b/src/Trakx.Circle.ApiClient/Trakx.Circle.ApiClient.csproj @@ -70,7 +70,7 @@ - + diff --git a/src/Trakx.Circle.ApiClient/nswag.json b/src/Trakx.Circle.ApiClient/nswag.json index 5798707..326952c 100644 --- a/src/Trakx.Circle.ApiClient/nswag.json +++ b/src/Trakx.Circle.ApiClient/nswag.json @@ -1,5 +1,5 @@ { - "runtime": "Net80", + "runtime": "Net100", "defaultVariables": null, "documentGenerator": { "fromDocument": { @@ -23,7 +23,7 @@ "useHttpClientCreationMethod": false, "httpClientType": "System.Net.Http.HttpClient", "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": true, + "useBaseUrl": false, "generateBaseUrlProperty": false, "generateSyncMethods": false, "exposeJsonSerializerSettings": false,