diff --git a/Adyen.Test/Capital/DynamicOffersServiceTests.cs b/Adyen.Test/Capital/DynamicOffersServiceTests.cs new file mode 100644 index 000000000..f3bac1054 --- /dev/null +++ b/Adyen.Test/Capital/DynamicOffersServiceTests.cs @@ -0,0 +1,168 @@ +using System.Net; +using System.Text; +using Adyen.Core.Options; +using Adyen.Capital.Extensions; +using Adyen.Capital.Models; +using Adyen.Capital.Services; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Capital +{ + [TestClass] + public class DynamicOffersServiceTests + { + [TestMethod] + public async Task GetAllDynamicOffersAsync_Returns200Ok_WithCorrectVerbAndPath() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/capital/dynamic-offers-success.json"); + var accountHolderId = "AH00000000000000000000001"; + + HttpRequestMessage? capturedRequest = null; + var mockHandler = new MockDelegatingHandler(request => + { + capturedRequest = request; + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(json, Encoding.UTF8, "application/json") + }; + }); + + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCapital((context, services, config) => + { + config.ConfigureAdyenOptions(options => { options.Environment = AdyenEnvironment.Test; }); + services.AddDynamicOffersService(httpClientBuilderOptions: builder => + { + builder.AddHttpMessageHandler(() => mockHandler); + }); + }) + .Build(); + + var dynamicOffersService = testHost.Services.GetRequiredService(); + + // Act + var response = await dynamicOffersService.GetAllDynamicOffersAsync(accountHolderId); + + // Assert - response + Assert.IsTrue(response.TryDeserializeOkResponse(out var result)); + Assert.IsNotNull(result); + Assert.AreEqual(1, result.DynamicOffers.Count); + Assert.AreEqual("DO00000000000000000000001", result.DynamicOffers[0].Id); + Assert.AreEqual("AH00000000000000000000001", result.DynamicOffers[0].AccountHolderId); + Assert.AreEqual("EUR", result.DynamicOffers[0].MinimumAmount.Currency); + Assert.AreEqual(5000, result.DynamicOffers[0].MinimumAmount.Value); + Assert.AreEqual("EUR", result.DynamicOffers[0].MaximumAmount.Currency); + Assert.AreEqual(25000, result.DynamicOffers[0].MaximumAmount.Value); + + // Assert - HTTP verb and path + Assert.IsNotNull(capturedRequest); + Assert.AreEqual(HttpMethod.Get, capturedRequest.Method); + Assert.IsNotNull(capturedRequest.RequestUri); + Assert.AreEqual("/capital/v1/dynamicOffers", capturedRequest.RequestUri.AbsolutePath); + StringAssert.Contains(capturedRequest.RequestUri.Query, $"accountHolderId={accountHolderId}"); + } + + [TestMethod] + public async Task CalculatePreliminaryOfferFromDynamicOfferAsync_Returns200Ok_WithCorrectVerbAndPath() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/capital/dynamic-offer-calculate-preliminary.json"); + var dynamicOfferId = "DO00000000000000000000001"; + var request = new CalculateGrantOfferRequest { Amount = new Amount { Currency = "EUR", Value = 10000 } }; + + HttpRequestMessage? capturedRequest = null; + var mockHandler = new MockDelegatingHandler(req => + { + capturedRequest = req; + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(json, Encoding.UTF8, "application/json") + }; + }); + + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCapital((context, services, config) => + { + config.ConfigureAdyenOptions(options => { options.Environment = AdyenEnvironment.Test; }); + services.AddDynamicOffersService(httpClientBuilderOptions: builder => + { + builder.AddHttpMessageHandler(() => mockHandler); + }); + }) + .Build(); + + var dynamicOffersService = testHost.Services.GetRequiredService(); + + // Act + var response = await dynamicOffersService.CalculatePreliminaryOfferFromDynamicOfferAsync(dynamicOfferId, request); + + // Assert - response + Assert.IsTrue(response.TryDeserializeOkResponse(out var result)); + Assert.IsNotNull(result); + Assert.AreEqual("EUR", result.Amount.Currency); + Assert.AreEqual(10000, result.Amount.Value); + Assert.AreEqual("EUR", result.Fee.Amount.Currency); + Assert.AreEqual(1000, result.Fee.Amount.Value); + Assert.AreEqual(1000, result.Repayment.BasisPoints); + + // Assert - HTTP verb and path + Assert.IsNotNull(capturedRequest); + Assert.AreEqual(HttpMethod.Post, capturedRequest.Method); + Assert.IsNotNull(capturedRequest.RequestUri); + Assert.AreEqual($"/capital/v1/dynamicOffers/{dynamicOfferId}/calculate", capturedRequest.RequestUri.AbsolutePath); + } + + [TestMethod] + public async Task CreateStaticOfferFromDynamicOfferAsync_Returns200Ok_WithCorrectVerbAndPath() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/capital/dynamic-offer-create-static-offer.json"); + var dynamicOfferId = "DO00000000000000000000001"; + var request = new CreateGrantOfferRequest { Amount = new Amount { Currency = "EUR", Value = 10000 } }; + + HttpRequestMessage? capturedRequest = null; + var mockHandler = new MockDelegatingHandler(req => + { + capturedRequest = req; + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(json, Encoding.UTF8, "application/json") + }; + }); + + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCapital((context, services, config) => + { + config.ConfigureAdyenOptions(options => { options.Environment = AdyenEnvironment.Test; }); + services.AddDynamicOffersService(httpClientBuilderOptions: builder => + { + builder.AddHttpMessageHandler(() => mockHandler); + }); + }) + .Build(); + + var dynamicOffersService = testHost.Services.GetRequiredService(); + + // Act + var response = await dynamicOffersService.CreateStaticOfferFromDynamicOfferAsync(dynamicOfferId, request); + + // Assert - response + Assert.IsTrue(response.TryDeserializeOkResponse(out var result)); + Assert.IsNotNull(result); + Assert.AreEqual("GO00000000000000000000002", result.Id); + Assert.AreEqual("AH00000000000000000000001", result.AccountHolderId); + Assert.AreEqual(GrantOffer.ContractTypeEnum.CashAdvance, result.ContractType); + Assert.AreEqual("EUR", result.Amount.Currency); + Assert.AreEqual(10000, result.Amount.Value); + + // Assert - HTTP verb and path + Assert.IsNotNull(capturedRequest); + Assert.AreEqual(HttpMethod.Post, capturedRequest.Method); + Assert.IsNotNull(capturedRequest.RequestUri); + Assert.AreEqual($"/capital/v1/dynamicOffers/{dynamicOfferId}/grantOffer", capturedRequest.RequestUri.AbsolutePath); + } + } +} diff --git a/Adyen.Test/Capital/DynamicOffersTest.cs b/Adyen.Test/Capital/DynamicOffersTest.cs new file mode 100644 index 000000000..f6d928dbd --- /dev/null +++ b/Adyen.Test/Capital/DynamicOffersTest.cs @@ -0,0 +1,96 @@ +using Adyen.Capital.Client; +using Adyen.Capital.Extensions; +using Adyen.Capital.Models; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.Capital +{ + [TestClass] + public class DynamicOffersTest + { + private static IHost _host; + private static JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + [ClassInitialize] + public static void ClassInitialize(TestContext context) + { + _host = Host.CreateDefaultBuilder() + .ConfigureCapital((ctx, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = _host.Services.GetRequiredService(); + } + + [ClassCleanup] + public static void ClassCleanup() + { + _host?.Dispose(); + } + + [TestMethod] + public void Given_Deserialize_When_GetDynamicOffersResponse_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/capital/dynamic-offers-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(response); + Assert.AreEqual(1, response.DynamicOffers.Count); + Assert.AreEqual("DO00000000000000000000001", response.DynamicOffers[0].Id); + Assert.AreEqual("AH00000000000000000000001", response.DynamicOffers[0].AccountHolderId); + Assert.AreEqual("EUR", response.DynamicOffers[0].MinimumAmount.Currency); + Assert.AreEqual(5000, response.DynamicOffers[0].MinimumAmount.Value); + Assert.AreEqual("EUR", response.DynamicOffers[0].MaximumAmount.Currency); + Assert.AreEqual(25000, response.DynamicOffers[0].MaximumAmount.Value); + } + + [TestMethod] + public void Given_Deserialize_When_CalculatedGrantOffer_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/capital/dynamic-offer-calculate-preliminary.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(response); + Assert.AreEqual("EUR", response.Amount.Currency); + Assert.AreEqual(10000, response.Amount.Value); + Assert.AreEqual("EUR", response.Fee.Amount.Currency); + Assert.AreEqual(1000, response.Fee.Amount.Value); + Assert.AreEqual(1000, response.Repayment.BasisPoints); + } + + [TestMethod] + public void Given_Deserialize_When_GrantOffer_From_DynamicOffer_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/capital/dynamic-offer-create-static-offer.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(response); + Assert.AreEqual("GO00000000000000000000002", response.Id); + Assert.AreEqual("AH00000000000000000000001", response.AccountHolderId); + Assert.AreEqual(GrantOffer.ContractTypeEnum.CashAdvance, response.ContractType); + Assert.AreEqual("EUR", response.Amount.Currency); + Assert.AreEqual(10000, response.Amount.Value); + } + } +} diff --git a/Adyen.Test/Capital/GrantsOffersServiceTests.cs b/Adyen.Test/Capital/GrantsOffersServiceTests.cs index 4577c6abd..30d910921 100644 --- a/Adyen.Test/Capital/GrantsOffersServiceTests.cs +++ b/Adyen.Test/Capital/GrantsOffersServiceTests.cs @@ -43,7 +43,7 @@ public async Task GetAllGrantOffersAsync_Success() var accountHolderId = "AH00000000000001"; _grantsOffersService.GetAllGrantOffersAsync( - Arg.Any>(), + Arg.Any(), Arg.Any(), Arg.Any()) .Returns( diff --git a/Adyen.Test/mocks/capital/dynamic-offer-calculate-preliminary.json b/Adyen.Test/mocks/capital/dynamic-offer-calculate-preliminary.json new file mode 100644 index 000000000..dfa7f5386 --- /dev/null +++ b/Adyen.Test/mocks/capital/dynamic-offer-calculate-preliminary.json @@ -0,0 +1,20 @@ +{ + "id": "DO00000000000000000000001", + "accountHolderId": "AH00000000000000000000001", + "contractType": "cashAdvance", + "amount": { + "currency": "EUR", + "value": 10000 + }, + "fee": { + "amount": { + "currency": "EUR", + "value": 1000 + } + }, + "repayment": { + "basisPoints": 1000 + }, + "startsAt": "2024-01-01T00:00:00.0000000Z", + "expiresAt": "2024-12-31T00:00:00.0000000Z" +} diff --git a/Adyen.Test/mocks/capital/dynamic-offer-create-static-offer.json b/Adyen.Test/mocks/capital/dynamic-offer-create-static-offer.json new file mode 100644 index 000000000..a77c712d5 --- /dev/null +++ b/Adyen.Test/mocks/capital/dynamic-offer-create-static-offer.json @@ -0,0 +1,9 @@ +{ + "id": "GO00000000000000000000002", + "accountHolderId": "AH00000000000000000000001", + "contractType": "cashAdvance", + "amount": { + "currency": "EUR", + "value": 10000 + } +} diff --git a/Adyen.Test/mocks/capital/dynamic-offers-success.json b/Adyen.Test/mocks/capital/dynamic-offers-success.json new file mode 100644 index 000000000..fb021177e --- /dev/null +++ b/Adyen.Test/mocks/capital/dynamic-offers-success.json @@ -0,0 +1,25 @@ +{ + "dynamicOffers": [ + { + "id": "DO00000000000000000000001", + "accountHolderId": "AH00000000000000000000001", + "contractType": "cashAdvance", + "financingType": "businessFinancing", + "minimumAmount": { + "currency": "EUR", + "value": 5000 + }, + "maximumAmount": { + "currency": "EUR", + "value": 25000 + }, + "repayment": { + "term": { + "estimatedDays": 90 + } + }, + "startsAt": "2024-01-01T00:00:00.0000000Z", + "expiresAt": "2024-12-31T00:00:00.0000000Z" + } + ] +} diff --git a/Adyen/Capital/Client/ClientUtils.cs b/Adyen/Capital/Client/ClientUtils.cs index 7e523a600..030fbf9e6 100644 --- a/Adyen/Capital/Client/ClientUtils.cs +++ b/Adyen/Capital/Client/ClientUtils.cs @@ -1,11 +1,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -101,6 +104,8 @@ public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOp /// Formatted string. public static string? ParameterToString(object? obj, string? format = ISO8601_DATETIME_FORMAT) { + if (obj is System.Collections.Specialized.NameValueCollection nameValueCollection) + return BuildQueryString(nameValueCollection); if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") @@ -117,18 +122,24 @@ public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOp return dateOnly.ToString(format); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is Models.AdditionalBankIdentificationTypes additionalBankIdentificationTypes) - return AdditionalBankIdentificationTypesValueConverter.ToJsonValue(additionalBankIdentificationTypes); + if (obj is Models.AdditionalBankIdentification.TypeEnum additionalBankIdentificationTypeEnum) + return Models.AdditionalBankIdentification.TypeEnum.ToJsonValue(additionalBankIdentificationTypeEnum); if (obj is Models.CALocalBankAccountType cALocalBankAccountType) - return CALocalBankAccountTypeValueConverter.ToJsonValue(cALocalBankAccountType); + return CALocalBankAccountType.ToJsonValue(cALocalBankAccountType); + if (obj is Models.CalculatedGrantOffer.ContractTypeEnum calculatedGrantOfferContractTypeEnum) + return Models.CalculatedGrantOffer.ContractTypeEnum.ToJsonValue(calculatedGrantOfferContractTypeEnum); + if (obj is Models.DynamicOffer.ContractTypeEnum dynamicOfferContractTypeEnum) + return Models.DynamicOffer.ContractTypeEnum.ToJsonValue(dynamicOfferContractTypeEnum); + if (obj is Models.FinancingType financingType) + return FinancingType.ToJsonValue(financingType); if (obj is Models.FundsCollectionType fundsCollectionType) - return FundsCollectionTypeValueConverter.ToJsonValue(fundsCollectionType); + return FundsCollectionType.ToJsonValue(fundsCollectionType); if (obj is Models.GrantOffer.ContractTypeEnum grantOfferContractTypeEnum) return Models.GrantOffer.ContractTypeEnum.ToJsonValue(grantOfferContractTypeEnum); if (obj is Models.Status.CodeEnum statusCodeEnum) return Models.Status.CodeEnum.ToJsonValue(statusCodeEnum); if (obj is Models.USLocalBankAccountType uSLocalBankAccountType) - return USLocalBankAccountTypeValueConverter.ToJsonValue(uSLocalBankAccountType); + return USLocalBankAccountType.ToJsonValue(uSLocalBankAccountType); if (obj is ICollection collection) { List entries = new(); @@ -140,6 +151,74 @@ public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOp return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } + /// + /// Builds a query string from a + /// using minimal percent-encoding that only escapes characters which would break query string + /// structure, while leaving all other characters (including +, /, !) unencoded. + /// + /// This follows RFC 3986 and does not encode sub-delimiters or unreserved characters in + /// query values. + /// + /// + /// + /// The % character is not encoded by this method. If a value contains a + /// literal % that is not part of a percent-encoded sequence (e.g. 50%off), + /// the caller must encode it as %25 before passing it to this method. This design + /// intentionally preserves already-encoded sequences such as opaque tokens or redirect URLs. + /// + /// The query string parameters. + /// A query string (without leading '?'). + internal static string BuildQueryString(System.Collections.Specialized.NameValueCollection parameters) + { + var parts = new List(); + foreach (string key in parameters.AllKeys) + { + var value = parameters[key] ?? string.Empty; + // keys are always encoded (must be ASCII identifiers) + var encodedKey = Uri.EscapeDataString(key); + // only encode characters that would break query string structure, + // while preserving sub-delimiters (+, /, !) and non-ASCII via Uri.EscapeDataString + var sb = new System.Text.StringBuilder(value.Length); + for (int i = 0; i < value.Length; i++) + { + char c = value[i]; + switch (c) + { + case '&': sb.Append("%26"); break; + case '=': sb.Append("%3D"); break; + case '#': sb.Append("%23"); break; + case ' ': sb.Append("%20"); break; + default: + if (c < 32 || c >= 127) + { + if (char.IsHighSurrogate(c) && i + 1 < value.Length && char.IsLowSurrogate(value[i + 1])) + { + sb.Append(Uri.EscapeDataString(value.Substring(i++, 2))); + } + else if (!char.IsSurrogate(c)) + { + sb.Append(Uri.EscapeDataString(c.ToString())); + } + else + { + // Append the Unicode replacement character for unpaired surrogates + // to avoid ArgumentException in some frameworks (e.g. .NET Framework) + sb.Append("%EF%BF%BD"); + } + } + else + { + sb.Append(c); + } + break; + } + } + var encodedValue = sb.ToString(); + parts.Add(encodedKey + "=" + encodedValue); + } + return string.Join("&", parts); + } + /// /// URL encode a string /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 diff --git a/Adyen/Capital/Client/HostConfiguration.cs b/Adyen/Capital/Client/HostConfiguration.cs index e2cc156c3..691c83cc3 100644 --- a/Adyen/Capital/Client/HostConfiguration.cs +++ b/Adyen/Capital/Client/HostConfiguration.cs @@ -1,11 +1,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -14,7 +17,6 @@ using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; -using System.Net.Http; using Microsoft.Extensions.DependencyInjection; using Adyen.Capital.Services; using Adyen.Capital.Client; @@ -59,16 +61,16 @@ public HostConfiguration(IServiceCollection services) _jsonOptions.Converters.Add(new AULocalAccountIdentificationJsonConverter()); _jsonOptions.Converters.Add(new ActionJsonConverter()); _jsonOptions.Converters.Add(new AdditionalBankIdentificationJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalBankIdentificationTypesJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalBankIdentificationTypesNullableJsonConverter()); _jsonOptions.Converters.Add(new AmountJsonConverter()); _jsonOptions.Converters.Add(new BRLocalAccountIdentificationJsonConverter()); _jsonOptions.Converters.Add(new BalanceJsonConverter()); _jsonOptions.Converters.Add(new BankAccountIdentificationJsonConverter()); _jsonOptions.Converters.Add(new CALocalAccountIdentificationJsonConverter()); - _jsonOptions.Converters.Add(new CALocalBankAccountTypeJsonConverter()); - _jsonOptions.Converters.Add(new CALocalBankAccountTypeNullableJsonConverter()); + _jsonOptions.Converters.Add(new CALocalBankAccountType.CALocalBankAccountTypeJsonConverter()); _jsonOptions.Converters.Add(new CZLocalAccountIdentificationJsonConverter()); + _jsonOptions.Converters.Add(new CalculateGrantOfferRequestJsonConverter()); + _jsonOptions.Converters.Add(new CalculatedGrantOfferJsonConverter()); + _jsonOptions.Converters.Add(new CreateGrantOfferRequestJsonConverter()); _jsonOptions.Converters.Add(new DKLocalAccountIdentificationJsonConverter()); _jsonOptions.Converters.Add(new DefaultErrorResponseEntityJsonConverter()); _jsonOptions.Converters.Add(new DisbursementJsonConverter()); @@ -76,10 +78,13 @@ public HostConfiguration(IServiceCollection services) _jsonOptions.Converters.Add(new DisbursementRepaymentJsonConverter()); _jsonOptions.Converters.Add(new DisbursementRepaymentInfoUpdateJsonConverter()); _jsonOptions.Converters.Add(new DisbursementsJsonConverter()); + _jsonOptions.Converters.Add(new DynamicOfferJsonConverter()); + _jsonOptions.Converters.Add(new DynamicOfferRepaymentJsonConverter()); _jsonOptions.Converters.Add(new FeeJsonConverter()); + _jsonOptions.Converters.Add(new FinancingType.FinancingTypeJsonConverter()); _jsonOptions.Converters.Add(new FundsCollectionJsonConverter()); - _jsonOptions.Converters.Add(new FundsCollectionTypeJsonConverter()); - _jsonOptions.Converters.Add(new FundsCollectionTypeNullableJsonConverter()); + _jsonOptions.Converters.Add(new FundsCollectionType.FundsCollectionTypeJsonConverter()); + _jsonOptions.Converters.Add(new GetDynamicOffersResponseJsonConverter()); _jsonOptions.Converters.Add(new GrantJsonConverter()); _jsonOptions.Converters.Add(new GrantAccountJsonConverter()); _jsonOptions.Converters.Add(new GrantCounterpartyJsonConverter()); @@ -106,8 +111,7 @@ public HostConfiguration(IServiceCollection services) _jsonOptions.Converters.Add(new ThresholdRepaymentJsonConverter()); _jsonOptions.Converters.Add(new UKLocalAccountIdentificationJsonConverter()); _jsonOptions.Converters.Add(new USLocalAccountIdentificationJsonConverter()); - _jsonOptions.Converters.Add(new USLocalBankAccountTypeJsonConverter()); - _jsonOptions.Converters.Add(new USLocalBankAccountTypeNullableJsonConverter()); + _jsonOptions.Converters.Add(new USLocalBankAccountType.USLocalBankAccountTypeJsonConverter()); JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new(_jsonOptions); _services.AddSingleton(jsonSerializerOptionsProvider); } diff --git a/Adyen/Capital/Extensions/HostBuilderExtensions.cs b/Adyen/Capital/Extensions/HostBuilderExtensions.cs index ad69b2929..0f094ebec 100644 --- a/Adyen/Capital/Extensions/HostBuilderExtensions.cs +++ b/Adyen/Capital/Extensions/HostBuilderExtensions.cs @@ -1,11 +1,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable diff --git a/Adyen/Capital/Extensions/ServiceCollectionExtensions.cs b/Adyen/Capital/Extensions/ServiceCollectionExtensions.cs index d021f143a..d5863d026 100644 --- a/Adyen/Capital/Extensions/ServiceCollectionExtensions.cs +++ b/Adyen/Capital/Extensions/ServiceCollectionExtensions.cs @@ -1,11 +1,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -28,7 +31,7 @@ public static class ServiceCollectionExtensions /// /// Add all Capital services using the extension methods in and configures the and . - /// See: , , , + /// See: , , , , /// /// . /// . @@ -37,6 +40,7 @@ public static class ServiceCollectionExtensions /// . public static IServiceCollection AddAllCapitalServices(this IServiceCollection services, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton, Action? httpClientOptions = null, Action? httpClientBuilderOptions = null) { + services.AddDynamicOffersService(serviceLifetime, httpClientOptions, httpClientBuilderOptions); services.AddGrantAccountsService(serviceLifetime, httpClientOptions, httpClientBuilderOptions); services.AddGrantOffersService(serviceLifetime, httpClientOptions, httpClientBuilderOptions); services.AddGrantsService(serviceLifetime, httpClientOptions, httpClientBuilderOptions); @@ -46,6 +50,27 @@ public static IServiceCollection AddAllCapitalServices(this IServiceCollection s + /// + /// Add as the implementation of to the Dependency Injection container . + /// + /// . + /// Configures the , defaults to . + /// . + public static IServiceCollection AddDynamicOffersService(this IServiceCollection services, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton, Action? httpClientOptions = null, Action? httpClientBuilderOptions = null) + { + services.AddSingleton(); + + services.Add(new ServiceDescriptor(typeof(IDynamicOffersService), typeof(DynamicOffersService), serviceLifetime)); + + IHttpClientBuilder builder = services.AddHttpClient(typeof(IDynamicOffersService).FullName!, httpClient => + { + httpClientOptions?.Invoke(httpClient); + }); + + httpClientBuilderOptions?.Invoke(builder); + return services; + } + /// /// Add as the implementation of to the Dependency Injection container . /// diff --git a/Adyen/Capital/Models/AULocalAccountIdentification.cs b/Adyen/Capital/Models/AULocalAccountIdentification.cs index 7512b1edd..41344ead0 100644 --- a/Adyen/Capital/Models/AULocalAccountIdentification.cs +++ b/Adyen/Capital/Models/AULocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,22 +37,10 @@ public partial class AULocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The bank account number, without separators or whitespace. - /// The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. - [JsonConstructor] - public AULocalAccountIdentification(string accountNumber, string bsbCode) : base() + public AULocalAccountIdentification() : base() { - AccountNumber = accountNumber; - BsbCode = bsbCode; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public AULocalAccountIdentification() - { - } partial void OnCreated(); @@ -148,7 +139,10 @@ public override AULocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class AULocalAccountIdentification.", nameof(type)); - return new AULocalAccountIdentification(accountNumber.Value!, bsbCode.Value!); + var aULocalAccountIdentification = new AULocalAccountIdentification(); + aULocalAccountIdentification.AccountNumber = accountNumber.Value!; + aULocalAccountIdentification.BsbCode = bsbCode.Value!; + return aULocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/Action.cs b/Adyen/Capital/Models/Action.cs index ba36ef595..7c842e733 100644 --- a/Adyen/Capital/Models/Action.cs +++ b/Adyen/Capital/Models/Action.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class Action /// /// Initializes a new instance of the class. /// - /// The code identifying the action that needs to be completed. - /// Indicates whether this action has been successfully completed. - [JsonConstructor] - public Action(string actionCode, bool resolved) - { - ActionCode = actionCode; - Resolved = resolved; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Action() { + OnCreated(); } partial void OnCreated(); @@ -140,7 +131,10 @@ public override Action Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver if (!resolved.IsSet) throw new ArgumentException("Property is required for class Action.", nameof(resolved)); - return new Action(actionCode.Value!, resolved.Value!.Value!); + var action = new Action(); + action.ActionCode = actionCode.Value!; + action.Resolved = resolved.Value!.Value; + return action; } /// diff --git a/Adyen/Capital/Models/AdditionalBankIdentification.cs b/Adyen/Capital/Models/AdditionalBankIdentification.cs index 7eaa92152..d571bef0a 100644 --- a/Adyen/Capital/Models/AdditionalBankIdentification.cs +++ b/Adyen/Capital/Models/AdditionalBankIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,37 +37,167 @@ public partial class AdditionalBankIdentification /// /// Initializes a new instance of the class. /// - /// The value of the additional bank identification. - /// type - [JsonConstructor] - public AdditionalBankIdentification(Option code = default, Option type = default) + public AdditionalBankIdentification() { - _CodeOption = code; - _TypeOption = type; OnCreated(); } - + + partial void OnCreated(); + /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. /// - public AdditionalBankIdentification() + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + [JsonConverter(typeof(TypeEnumJsonConverter))] + public class TypeEnum : IEnum { - } + /// + /// Returns the value of the TypeEnum. + /// + public string? Value { get; set; } - partial void OnCreated(); + /// + /// TypeEnum.AuBsbCode - auBsbCode + /// + public static readonly TypeEnum AuBsbCode = new("auBsbCode"); + + /// + /// TypeEnum.CaRoutingNumber - caRoutingNumber + /// + public static readonly TypeEnum CaRoutingNumber = new("caRoutingNumber"); + + /// + /// TypeEnum.GbSortCode - gbSortCode + /// + public static readonly TypeEnum GbSortCode = new("gbSortCode"); + + /// + /// TypeEnum.UsRoutingNumber - usRoutingNumber + /// + public static readonly TypeEnum UsRoutingNumber = new("usRoutingNumber"); + + private TypeEnum(string? value) + { + Value = value; + } + + /// + /// Converts a string to a implicitly. + /// + /// The string value to convert. Defaults to null. + /// A new instance initialized with the string value. + public static implicit operator TypeEnum?(string? value) => value == null ? null : new TypeEnum(value); + + /// + /// Converts a instance to a string implicitly. + /// + /// The instance. Default to null. + /// String value of the instance. + public static implicit operator string?(TypeEnum? option) => option?.Value; + + /// + /// Compares two instances for equality. + /// + public static bool operator ==(TypeEnum? left, TypeEnum? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Compares two instances for inequality. + /// + public static bool operator !=(TypeEnum? left, TypeEnum? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns true if the given object is equal to this instance. + /// + public override bool Equals(object? obj) => obj is TypeEnum other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns a hash code for this instance. + /// + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + + /// + /// Returns the string value of the instance. + /// + public override string ToString() => Value ?? string.Empty; + + /// + /// Returns a . + /// + /// + /// or null. + public static TypeEnum? FromStringOrDefault(string value) + { + return value switch { + "auBsbCode" => TypeEnum.AuBsbCode, + "caRoutingNumber" => TypeEnum.CaRoutingNumber, + "gbSortCode" => TypeEnum.GbSortCode, + "usRoutingNumber" => TypeEnum.UsRoutingNumber, + _ => null, + }; + } + + /// + /// Converts the to the json value. + /// + /// + /// String value of the enum. + public static string? ToJsonValue(TypeEnum? value) + { + if (value == null) + return null; + + if (value == TypeEnum.AuBsbCode) + return "auBsbCode"; + + if (value == TypeEnum.CaRoutingNumber) + return "caRoutingNumber"; + + if (value == TypeEnum.GbSortCode) + return "gbSortCode"; + + if (value == TypeEnum.UsRoutingNumber) + return "usRoutingNumber"; + + return value.Value; + } + + /// + /// JsonConverter for writing TypeEnum. + /// + public class TypeEnumJsonConverter : JsonConverter + { + /// + /// Deserializes a from JSON. + /// + public override TypeEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions jsonOptions) + { + string value = reader.GetString(); + return value == null ? null : TypeEnum.FromStringOrDefault(value) ?? new TypeEnum(value); + } + + /// + /// Serializes a to JSON. + /// + public override void Write(Utf8JsonWriter writer, TypeEnum value, JsonSerializerOptions jsonOptions) + { + writer.WriteStringValue(TypeEnum.ToJsonValue(value)); + } + } + } /// /// This is used to track if an optional field is set. If set, will be populated. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option _TypeOption { get; private set; } + public Option _TypeOption { get; private set; } /// - /// . + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. /// + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. [JsonPropertyName("type")] - public AdditionalBankIdentificationTypes? Type { get { return this._TypeOption; } set { this._TypeOption = new(value); } } + public TypeEnum? Type { get { return this._TypeOption; } set { this._TypeOption = new(value); } } /// /// This is used to track if an optional field is set. If set, will be populated. @@ -118,7 +251,7 @@ public override AdditionalBankIdentification Read(ref Utf8JsonReader utf8JsonRea JsonTokenType startingTokenType = utf8JsonReader.TokenType; Option code = default; - Option type = default; + Option type = default; while (utf8JsonReader.Read()) { @@ -140,8 +273,7 @@ public override AdditionalBankIdentification Read(ref Utf8JsonReader utf8JsonRea break; case "type": string? typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(AdditionalBankIdentificationTypesValueConverter.FromStringOrDefault(typeRawValue)); + type = new Option(AdditionalBankIdentification.TypeEnum.FromStringOrDefault(typeRawValue) ?? (AdditionalBankIdentification.TypeEnum)typeRawValue); break; default: break; @@ -149,8 +281,12 @@ public override AdditionalBankIdentification Read(ref Utf8JsonReader utf8JsonRea } } - - return new AdditionalBankIdentification(code, type); + var additionalBankIdentification = new AdditionalBankIdentification(); + if (code.IsSet) + additionalBankIdentification.Code = code.Value; + if (type.IsSet) + additionalBankIdentification.Type = type.Value; + return additionalBankIdentification; } /// @@ -183,9 +319,9 @@ public void WriteProperties(Utf8JsonWriter writer, AdditionalBankIdentification if (additionalBankIdentification.Code != null) writer.WriteString("code", additionalBankIdentification.Code); - if (additionalBankIdentification._TypeOption.IsSet) + if (additionalBankIdentification._TypeOption.IsSet && additionalBankIdentification.Type != null) { - var typeRawValue = AdditionalBankIdentificationTypesValueConverter.ToJsonValue(additionalBankIdentification.Type!.Value); + string? typeRawValue = AdditionalBankIdentification.TypeEnum.ToJsonValue(additionalBankIdentification._TypeOption.Value!.Value); writer.WriteString("type", typeRawValue); } } diff --git a/Adyen/Capital/Models/AdditionalBankIdentificationTypes.cs b/Adyen/Capital/Models/AdditionalBankIdentificationTypes.cs deleted file mode 100644 index 513d39a50..000000000 --- a/Adyen/Capital/Models/AdditionalBankIdentificationTypes.cs +++ /dev/null @@ -1,246 +0,0 @@ -// -/* - * Capital API - * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. - * - * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -#nullable enable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.ComponentModel.DataAnnotations; -using Adyen.Core; -using Adyen.Capital.Client; - -namespace Adyen.Capital.Models -{ - /// - /// Defines AdditionalBankIdentificationTypes - /// - public enum AdditionalBankIdentificationTypes - { - /// - /// Enum AuBsbCode for value: auBsbCode - /// - AuBsbCode = 1, - - /// - /// Enum CaRoutingNumber for value: caRoutingNumber - /// - CaRoutingNumber = 2, - - /// - /// Enum GbSortCode for value: gbSortCode - /// - GbSortCode = 3, - - /// - /// Enum HkBankCode for value: hkBankCode - /// - HkBankCode = 4, - - /// - /// Enum JpZenginCode for value: jpZenginCode - /// - JpZenginCode = 5, - - /// - /// Enum NzBankBranchCode for value: nzBankBranchCode - /// - NzBankBranchCode = 6, - - /// - /// Enum UsRoutingNumber for value: usRoutingNumber - /// - UsRoutingNumber = 7 - } - - /// - /// Converts to and from the JSON value - /// - public static class AdditionalBankIdentificationTypesValueConverter - { - /// - /// Parses a given value to - /// - /// - /// - public static AdditionalBankIdentificationTypes FromString(string value) - { - if (value.Equals("auBsbCode")) - return AdditionalBankIdentificationTypes.AuBsbCode; - - if (value.Equals("caRoutingNumber")) - return AdditionalBankIdentificationTypes.CaRoutingNumber; - - if (value.Equals("gbSortCode")) - return AdditionalBankIdentificationTypes.GbSortCode; - - if (value.Equals("hkBankCode")) - return AdditionalBankIdentificationTypes.HkBankCode; - - if (value.Equals("jpZenginCode")) - return AdditionalBankIdentificationTypes.JpZenginCode; - - if (value.Equals("nzBankBranchCode")) - return AdditionalBankIdentificationTypes.NzBankBranchCode; - - if (value.Equals("usRoutingNumber")) - return AdditionalBankIdentificationTypes.UsRoutingNumber; - - throw new NotImplementedException($"Could not convert value to type AdditionalBankIdentificationTypes: '{value}'"); - } - - /// - /// Parses a given value to - /// - /// - /// - public static AdditionalBankIdentificationTypes? FromStringOrDefault(string value) - { - if (value.Equals("auBsbCode")) - return AdditionalBankIdentificationTypes.AuBsbCode; - - if (value.Equals("caRoutingNumber")) - return AdditionalBankIdentificationTypes.CaRoutingNumber; - - if (value.Equals("gbSortCode")) - return AdditionalBankIdentificationTypes.GbSortCode; - - if (value.Equals("hkBankCode")) - return AdditionalBankIdentificationTypes.HkBankCode; - - if (value.Equals("jpZenginCode")) - return AdditionalBankIdentificationTypes.JpZenginCode; - - if (value.Equals("nzBankBranchCode")) - return AdditionalBankIdentificationTypes.NzBankBranchCode; - - if (value.Equals("usRoutingNumber")) - return AdditionalBankIdentificationTypes.UsRoutingNumber; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ToJsonValue(AdditionalBankIdentificationTypes value) - { - if (value == AdditionalBankIdentificationTypes.AuBsbCode) - return "auBsbCode"; - - if (value == AdditionalBankIdentificationTypes.CaRoutingNumber) - return "caRoutingNumber"; - - if (value == AdditionalBankIdentificationTypes.GbSortCode) - return "gbSortCode"; - - if (value == AdditionalBankIdentificationTypes.HkBankCode) - return "hkBankCode"; - - if (value == AdditionalBankIdentificationTypes.JpZenginCode) - return "jpZenginCode"; - - if (value == AdditionalBankIdentificationTypes.NzBankBranchCode) - return "nzBankBranchCode"; - - if (value == AdditionalBankIdentificationTypes.UsRoutingNumber) - return "usRoutingNumber"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - } - - /// - /// A Json converter for type - /// - /// - public class AdditionalBankIdentificationTypesJsonConverter : JsonConverter - { - /// - /// Returns a from the Json object - /// - /// - /// - /// - /// - public override AdditionalBankIdentificationTypes Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string? rawValue = reader.GetString(); - - AdditionalBankIdentificationTypes? result = rawValue == null - ? null - : AdditionalBankIdentificationTypesValueConverter.FromStringOrDefault(rawValue); - - if (result != null) - return result.Value; - - throw new JsonException(); - } - - /// - /// Writes the AdditionalBankIdentificationTypes to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalBankIdentificationTypes additionalBankIdentificationTypes, JsonSerializerOptions options) - { - writer.WriteStringValue(AdditionalBankIdentificationTypesValueConverter.ToJsonValue(additionalBankIdentificationTypes).ToString()); - } - } - - /// - /// A Json converter for type - /// - public class AdditionalBankIdentificationTypesNullableJsonConverter : JsonConverter - { - /// - /// Returns a AdditionalBankIdentificationTypes from the Json object - /// - /// - /// - /// - /// - public override AdditionalBankIdentificationTypes? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string? rawValue = reader.GetString(); - - AdditionalBankIdentificationTypes? result = rawValue == null - ? null - : AdditionalBankIdentificationTypesValueConverter.FromStringOrDefault(rawValue); - - if (result != null) - return result.Value; - - throw new JsonException(); - } - - /// - /// Writes the AdditionalBankIdentificationTypes to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalBankIdentificationTypes? additionalBankIdentificationTypes, JsonSerializerOptions options) - { - writer.WriteStringValue(additionalBankIdentificationTypes.HasValue ? AdditionalBankIdentificationTypesValueConverter.ToJsonValue(additionalBankIdentificationTypes.Value).ToString() : "null"); - } - } -} diff --git a/Adyen/Capital/Models/Amount.cs b/Adyen/Capital/Models/Amount.cs index 79073b1c0..a7710855b 100644 --- a/Adyen/Capital/Models/Amount.cs +++ b/Adyen/Capital/Models/Amount.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class Amount /// /// Initializes a new instance of the class. /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount. - /// The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). - [JsonConstructor] - public Amount(string currency, long value) - { - Currency = currency; - Value = value; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Amount() { + OnCreated(); } partial void OnCreated(); @@ -140,7 +131,10 @@ public override Amount Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver if (!value.IsSet) throw new ArgumentException("Property is required for class Amount.", nameof(value)); - return new Amount(currency.Value!, value.Value!.Value!); + var amount = new Amount(); + amount.Currency = currency.Value!; + amount.Value = value.Value!.Value; + return amount; } /// diff --git a/Adyen/Capital/Models/BRLocalAccountIdentification.cs b/Adyen/Capital/Models/BRLocalAccountIdentification.cs index 7a7f18ef5..4f414c1f0 100644 --- a/Adyen/Capital/Models/BRLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/BRLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,26 +37,10 @@ public partial class BRLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The bank account number, without separators or whitespace. - /// The 3-digit bank code, with leading zeros. - /// The bank account branch number, without separators or whitespace. - /// The 8-digit ISPB, with leading zeros. - [JsonConstructor] - public BRLocalAccountIdentification(string accountNumber, string bankCode, string branchNumber, Option ispb = default) : base() + public BRLocalAccountIdentification() : base() { - AccountNumber = accountNumber; - BankCode = bankCode; - BranchNumber = branchNumber; - _IspbOption = ispb; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public BRLocalAccountIdentification() - { - } partial void OnCreated(); @@ -186,7 +173,13 @@ public override BRLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class BRLocalAccountIdentification.", nameof(type)); - return new BRLocalAccountIdentification(accountNumber.Value!, bankCode.Value!, branchNumber.Value!, ispb); + var bRLocalAccountIdentification = new BRLocalAccountIdentification(); + bRLocalAccountIdentification.AccountNumber = accountNumber.Value!; + bRLocalAccountIdentification.BankCode = bankCode.Value!; + bRLocalAccountIdentification.BranchNumber = branchNumber.Value!; + if (ispb.IsSet) + bRLocalAccountIdentification.Ispb = ispb.Value; + return bRLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/Balance.cs b/Adyen/Capital/Models/Balance.cs index d4fbb2bd5..fe1f2eb98 100644 --- a/Adyen/Capital/Models/Balance.cs +++ b/Adyen/Capital/Models/Balance.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,25 +37,9 @@ public partial class Balance /// /// Initializes a new instance of the class. /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). - /// The amount of the grant fee. - /// The grant amount that is paid out to the user for business financing. - /// The total amount of the grant that the user must repay. It is the sum of the fee amount and the principal amount. - [JsonConstructor] - public Balance(string currency, long fee, long principal, long total) - { - Currency = currency; - Fee = fee; - Principal = principal; - Total = total; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Balance() { + OnCreated(); } partial void OnCreated(); @@ -174,7 +161,12 @@ public override Balance Read(ref Utf8JsonReader utf8JsonReader, Type typeToConve if (!total.IsSet) throw new ArgumentException("Property is required for class Balance.", nameof(total)); - return new Balance(currency.Value!, fee.Value!.Value!, principal.Value!.Value!, total.Value!.Value!); + var balance = new Balance(); + balance.Currency = currency.Value!; + balance.Fee = fee.Value!.Value; + balance.Principal = principal.Value!.Value; + balance.Total = total.Value!.Value; + return balance; } /// diff --git a/Adyen/Capital/Models/BankAccountIdentification.cs b/Adyen/Capital/Models/BankAccountIdentification.cs index f7629c572..319c3277c 100644 --- a/Adyen/Capital/Models/BankAccountIdentification.cs +++ b/Adyen/Capital/Models/BankAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,13 +37,11 @@ public partial class BankAccountIdentification /// /// Initializes a new instance of the class. /// - [JsonConstructor] public BankAccountIdentification() { Type = this.GetType().Name; OnCreated(); } - partial void OnCreated(); @@ -162,8 +163,8 @@ public override BankAccountIdentification Read(ref Utf8JsonReader utf8JsonReader } } - - return new BankAccountIdentification(); + var bankAccountIdentification = new BankAccountIdentification(); + return bankAccountIdentification; } /// diff --git a/Adyen/Capital/Models/CALocalAccountIdentification.cs b/Adyen/Capital/Models/CALocalAccountIdentification.cs index 2a074e0a6..d3a1531ea 100644 --- a/Adyen/Capital/Models/CALocalAccountIdentification.cs +++ b/Adyen/Capital/Models/CALocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,26 +37,10 @@ public partial class CALocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 5- to 12-digit bank account number, without separators or whitespace. - /// The 3-digit institution number, without separators or whitespace. - /// The 5-digit transit number, without separators or whitespace. - /// accountType - [JsonConstructor] - public CALocalAccountIdentification(string accountNumber, string institutionNumber, string transitNumber, Option accountType = default) : base() + public CALocalAccountIdentification() : base() { - AccountNumber = accountNumber; - InstitutionNumber = institutionNumber; - TransitNumber = transitNumber; - _AccountTypeOption = accountType; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public CALocalAccountIdentification() - { - } partial void OnCreated(); @@ -166,8 +153,7 @@ public override CALocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea break; case "accountType": string? accountTypeRawValue = utf8JsonReader.GetString(); - if (accountTypeRawValue != null) - accountType = new Option(CALocalBankAccountTypeValueConverter.FromStringOrDefault(accountTypeRawValue)); + accountType = new Option(CALocalBankAccountType.FromStringOrDefault(accountTypeRawValue) ?? (CALocalBankAccountType)accountTypeRawValue); break; default: break; @@ -187,7 +173,13 @@ public override CALocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class CALocalAccountIdentification.", nameof(type)); - return new CALocalAccountIdentification(accountNumber.Value!, institutionNumber.Value!, transitNumber.Value!, accountType); + var cALocalAccountIdentification = new CALocalAccountIdentification(); + cALocalAccountIdentification.AccountNumber = accountNumber.Value!; + cALocalAccountIdentification.InstitutionNumber = institutionNumber.Value!; + cALocalAccountIdentification.TransitNumber = transitNumber.Value!; + if (accountType.IsSet) + cALocalAccountIdentification.AccountType = accountType.Value; + return cALocalAccountIdentification; } /// @@ -230,7 +222,7 @@ public void WriteProperties(Utf8JsonWriter writer, CALocalAccountIdentification if (cALocalAccountIdentification._AccountTypeOption.IsSet) { - var accountTypeRawValue = CALocalBankAccountTypeValueConverter.ToJsonValue(cALocalAccountIdentification.AccountType!.Value); + var accountTypeRawValue = CALocalBankAccountType.ToJsonValue(cALocalAccountIdentification.AccountType); writer.WriteString("accountType", accountTypeRawValue); } } diff --git a/Adyen/Capital/Models/CALocalBankAccountType.cs b/Adyen/Capital/Models/CALocalBankAccountType.cs index 323c411d0..6de764965 100644 --- a/Adyen/Capital/Models/CALocalBankAccountType.cs +++ b/Adyen/Capital/Models/CALocalBankAccountType.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -29,148 +32,117 @@ namespace Adyen.Capital.Models /// /// Defines CALocalBankAccountType /// - public enum CALocalBankAccountType + [JsonConverter(typeof(CALocalBankAccountType.CALocalBankAccountTypeJsonConverter))] + public class CALocalBankAccountType : IEnum { /// - /// Enum Checking for value: checking + /// Returns the value of the CALocalBankAccountType. /// - Checking = 1, + public string? Value { get; set; } /// - /// Enum Savings for value: savings + /// CALocalBankAccountType.Checking - checking /// - Savings = 2 - } + public static readonly CALocalBankAccountType Checking = new("checking"); - /// - /// Converts to and from the JSON value - /// - public static class CALocalBankAccountTypeValueConverter - { /// - /// Parses a given value to + /// CALocalBankAccountType.Savings - savings /// - /// - /// - public static CALocalBankAccountType FromString(string value) - { - if (value.Equals("checking")) - return CALocalBankAccountType.Checking; + public static readonly CALocalBankAccountType Savings = new("savings"); - if (value.Equals("savings")) - return CALocalBankAccountType.Savings; - - throw new NotImplementedException($"Could not convert value to type CALocalBankAccountType: '{value}'"); + private CALocalBankAccountType(string? value) + { + Value = value; } /// - /// Parses a given value to + /// Converts a string to a implicitly. /// - /// - /// - public static CALocalBankAccountType? FromStringOrDefault(string value) - { - if (value.Equals("checking")) - return CALocalBankAccountType.Checking; - - if (value.Equals("savings")) - return CALocalBankAccountType.Savings; - - return null; - } + public static implicit operator CALocalBankAccountType?(string? value) => value == null ? null : new CALocalBankAccountType(value); /// - /// Converts the to the json value + /// Converts a instance to a string implicitly. /// - /// - /// - /// - public static string ToJsonValue(CALocalBankAccountType value) - { - if (value == CALocalBankAccountType.Checking) - return "checking"; - - if (value == CALocalBankAccountType.Savings) - return "savings"; + public static implicit operator string?(CALocalBankAccountType? option) => option?.Value; - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - } + /// + /// Compares two instances for equality. + /// + public static bool operator ==(CALocalBankAccountType? left, CALocalBankAccountType? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - /// - /// A Json converter for type - /// - /// - public class CALocalBankAccountTypeJsonConverter : JsonConverter - { /// - /// Returns a from the Json object + /// Compares two instances for inequality. /// - /// - /// - /// - /// - public override CALocalBankAccountType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string? rawValue = reader.GetString(); + public static bool operator !=(CALocalBankAccountType? left, CALocalBankAccountType? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - CALocalBankAccountType? result = rawValue == null - ? null - : CALocalBankAccountTypeValueConverter.FromStringOrDefault(rawValue); + /// + /// Returns true if the given object is equal to this instance. + /// + public override bool Equals(object? obj) => obj is CALocalBankAccountType other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); - if (result != null) - return result.Value; + /// + /// Returns a hash code for this instance. + /// + public override int GetHashCode() => Value?.GetHashCode() ?? 0; - throw new JsonException(); - } + /// + /// Returns the string value of the instance. + /// + public override string ToString() => Value ?? string.Empty; /// - /// Writes the CALocalBankAccountType to the json writer + /// Returns a , or null if the value is not recognized. /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CALocalBankAccountType cALocalBankAccountType, JsonSerializerOptions options) + public static CALocalBankAccountType? FromStringOrDefault(string? value) { - writer.WriteStringValue(CALocalBankAccountTypeValueConverter.ToJsonValue(cALocalBankAccountType).ToString()); + return value switch { + "checking" => CALocalBankAccountType.Checking, + "savings" => CALocalBankAccountType.Savings, + _ => null, + }; } - } - /// - /// A Json converter for type - /// - public class CALocalBankAccountTypeNullableJsonConverter : JsonConverter - { /// - /// Returns a CALocalBankAccountType from the Json object + /// Converts the to the json value. + /// Returns the raw string value, preserving unknown values for round-trip safety. /// - /// - /// - /// - /// - public override CALocalBankAccountType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public static string? ToJsonValue(CALocalBankAccountType? value) { - string? rawValue = reader.GetString(); + if (value == null) + return null; - CALocalBankAccountType? result = rawValue == null - ? null - : CALocalBankAccountTypeValueConverter.FromStringOrDefault(rawValue); + if (value == CALocalBankAccountType.Checking) + return "checking"; - if (result != null) - return result.Value; + if (value == CALocalBankAccountType.Savings) + return "savings"; - throw new JsonException(); + return value.Value; } /// - /// Writes the CALocalBankAccountType to the json writer + /// JsonConverter for . + /// Preserves unknown values instead of throwing an exception. /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CALocalBankAccountType? cALocalBankAccountType, JsonSerializerOptions options) + public class CALocalBankAccountTypeJsonConverter : JsonConverter { - writer.WriteStringValue(cALocalBankAccountType.HasValue ? CALocalBankAccountTypeValueConverter.ToJsonValue(cALocalBankAccountType.Value).ToString() : "null"); + /// + /// Deserializes a from JSON. + /// Unknown values are preserved as-is rather than throwing an exception. + /// + public override CALocalBankAccountType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string? rawValue = reader.GetString(); + return rawValue == null ? null : CALocalBankAccountType.FromStringOrDefault(rawValue) ?? new CALocalBankAccountType(rawValue); + } + + /// + /// Serializes a to JSON. + /// + public override void Write(Utf8JsonWriter writer, CALocalBankAccountType value, JsonSerializerOptions options) + { + writer.WriteStringValue(CALocalBankAccountType.ToJsonValue(value)); + } } } } diff --git a/Adyen/Capital/Models/CZLocalAccountIdentification.cs b/Adyen/Capital/Models/CZLocalAccountIdentification.cs index 12e1aa012..1bbfb62d7 100644 --- a/Adyen/Capital/Models/CZLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/CZLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,22 +37,10 @@ public partial class CZLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized) - /// The 4-digit bank code (Kód banky), without separators or whitespace. - [JsonConstructor] - public CZLocalAccountIdentification(string accountNumber, string bankCode) : base() + public CZLocalAccountIdentification() : base() { - AccountNumber = accountNumber; - BankCode = bankCode; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public CZLocalAccountIdentification() - { - } partial void OnCreated(); @@ -148,7 +139,10 @@ public override CZLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class CZLocalAccountIdentification.", nameof(type)); - return new CZLocalAccountIdentification(accountNumber.Value!, bankCode.Value!); + var cZLocalAccountIdentification = new CZLocalAccountIdentification(); + cZLocalAccountIdentification.AccountNumber = accountNumber.Value!; + cZLocalAccountIdentification.BankCode = bankCode.Value!; + return cZLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/CalculateGrantOfferRequest.cs b/Adyen/Capital/Models/CalculateGrantOfferRequest.cs new file mode 100644 index 000000000..7162bbcdc --- /dev/null +++ b/Adyen/Capital/Models/CalculateGrantOfferRequest.cs @@ -0,0 +1,153 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Core; +using Adyen.Capital.Client; + +namespace Adyen.Capital.Models +{ + /// + /// CalculateGrantOfferRequest. + /// + public partial class CalculateGrantOfferRequest + { + /// + /// Initializes a new instance of the class. + /// + public CalculateGrantOfferRequest() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// . + /// + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CalculateGrantOfferRequest {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class CalculateGrantOfferRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to . + /// + /// . + /// . + /// The , initialized from . + /// . + /// + public override CalculateGrantOfferRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (jsonPropertyName) + { + case "amount": + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class CalculateGrantOfferRequest.", nameof(amount)); + + var calculateGrantOfferRequest = new CalculateGrantOfferRequest(); + calculateGrantOfferRequest.Amount = amount.Value!; + return calculateGrantOfferRequest; + } + + /// + /// Serializes a . + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CalculateGrantOfferRequest calculateGrantOfferRequest, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WriteStartObject(); + + WriteProperties(writer, calculateGrantOfferRequest, jsonSerializerOptions); + + writer.WriteEndObject(); + + } + + /// + /// Serializes the properties of . + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CalculateGrantOfferRequest calculateGrantOfferRequest, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, calculateGrantOfferRequest.Amount, jsonSerializerOptions); + } + } +} diff --git a/Adyen/Capital/Models/CalculatedGrantOffer.cs b/Adyen/Capital/Models/CalculatedGrantOffer.cs new file mode 100644 index 000000000..7e8faa366 --- /dev/null +++ b/Adyen/Capital/Models/CalculatedGrantOffer.cs @@ -0,0 +1,397 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Core; +using Adyen.Capital.Client; + +namespace Adyen.Capital.Models +{ + /// + /// CalculatedGrantOffer. + /// + public partial class CalculatedGrantOffer + { + /// + /// Initializes a new instance of the class. + /// + public CalculatedGrantOffer() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + [JsonConverter(typeof(ContractTypeEnumJsonConverter))] + public class ContractTypeEnum : IEnum + { + /// + /// Returns the value of the ContractTypeEnum. + /// + public string? Value { get; set; } + + /// + /// ContractTypeEnum.CashAdvance - cashAdvance + /// + public static readonly ContractTypeEnum CashAdvance = new("cashAdvance"); + + /// + /// ContractTypeEnum.Loan - loan + /// + public static readonly ContractTypeEnum Loan = new("loan"); + + private ContractTypeEnum(string? value) + { + Value = value; + } + + /// + /// Converts a string to a implicitly. + /// + /// The string value to convert. Defaults to null. + /// A new instance initialized with the string value. + public static implicit operator ContractTypeEnum?(string? value) => value == null ? null : new ContractTypeEnum(value); + + /// + /// Converts a instance to a string implicitly. + /// + /// The instance. Default to null. + /// String value of the instance. + public static implicit operator string?(ContractTypeEnum? option) => option?.Value; + + /// + /// Compares two instances for equality. + /// + public static bool operator ==(ContractTypeEnum? left, ContractTypeEnum? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Compares two instances for inequality. + /// + public static bool operator !=(ContractTypeEnum? left, ContractTypeEnum? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns true if the given object is equal to this instance. + /// + public override bool Equals(object? obj) => obj is ContractTypeEnum other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns a hash code for this instance. + /// + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + + /// + /// Returns the string value of the instance. + /// + public override string ToString() => Value ?? string.Empty; + + /// + /// Returns a . + /// + /// + /// or null. + public static ContractTypeEnum? FromStringOrDefault(string value) + { + return value switch { + "cashAdvance" => ContractTypeEnum.CashAdvance, + "loan" => ContractTypeEnum.Loan, + _ => null, + }; + } + + /// + /// Converts the to the json value. + /// + /// + /// String value of the enum. + public static string? ToJsonValue(ContractTypeEnum? value) + { + if (value == null) + return null; + + if (value == ContractTypeEnum.CashAdvance) + return "cashAdvance"; + + if (value == ContractTypeEnum.Loan) + return "loan"; + + return value.Value; + } + + /// + /// JsonConverter for writing ContractTypeEnum. + /// + public class ContractTypeEnumJsonConverter : JsonConverter + { + /// + /// Deserializes a from JSON. + /// + public override ContractTypeEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions jsonOptions) + { + string value = reader.GetString(); + return value == null ? null : ContractTypeEnum.FromStringOrDefault(value) ?? new ContractTypeEnum(value); + } + + /// + /// Serializes a to JSON. + /// + public override void Write(Utf8JsonWriter writer, ContractTypeEnum value, JsonSerializerOptions jsonOptions) + { + writer.WriteStringValue(ContractTypeEnum.ToJsonValue(value)); + } + } + } + + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + [JsonPropertyName("contractType")] + public ContractTypeEnum ContractType { get; set; } + + /// + /// The unique identifier of the account holder that the dynamic offer is for. + /// + /// The unique identifier of the account holder that the dynamic offer is for. + [JsonPropertyName("accountHolderId")] + public string AccountHolderId { get; set; } + + /// + /// . + /// + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + + /// + /// The expiration date and time of the offer validity period. + /// + /// The expiration date and time of the offer validity period. + [JsonPropertyName("expiresAt")] + public DateTimeOffset ExpiresAt { get; set; } + + /// + /// . + /// + [JsonPropertyName("fee")] + public GrantOfferFee Fee { get; set; } + + /// + /// . + /// + [JsonPropertyName("repayment")] + public Repayment Repayment { get; set; } + + /// + /// The starting date and time of the offer validity period. + /// + /// The starting date and time of the offer validity period. + [JsonPropertyName("startsAt")] + public DateTimeOffset StartsAt { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CalculatedGrantOffer {\n"); + sb.Append(" AccountHolderId: ").Append(AccountHolderId).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ContractType: ").Append(ContractType).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" Fee: ").Append(Fee).Append("\n"); + sb.Append(" Repayment: ").Append(Repayment).Append("\n"); + sb.Append(" StartsAt: ").Append(StartsAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class CalculatedGrantOfferJsonConverter : JsonConverter + { + /// + /// The format to use to serialize ExpiresAt. + /// + public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize StartsAt. + /// + public static string StartsAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to . + /// + /// . + /// . + /// The , initialized from . + /// . + /// + public override CalculatedGrantOffer Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accountHolderId = default; + Option amount = default; + Option contractType = default; + Option expiresAt = default; + Option fee = default; + Option repayment = default; + Option startsAt = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (jsonPropertyName) + { + case "accountHolderId": + accountHolderId = new Option(utf8JsonReader.GetString()!); + break; + case "amount": + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + case "contractType": + string? contractTypeRawValue = utf8JsonReader.GetString(); + contractType = new Option(CalculatedGrantOffer.ContractTypeEnum.FromStringOrDefault(contractTypeRawValue) ?? (CalculatedGrantOffer.ContractTypeEnum)contractTypeRawValue); + break; + case "expiresAt": + expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fee": + fee = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + case "repayment": + repayment = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + case "startsAt": + startsAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!accountHolderId.IsSet) + throw new ArgumentException("Property is required for class CalculatedGrantOffer.", nameof(accountHolderId)); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class CalculatedGrantOffer.", nameof(amount)); + + if (!contractType.IsSet) + throw new ArgumentException("Property is required for class CalculatedGrantOffer.", nameof(contractType)); + + if (!expiresAt.IsSet) + throw new ArgumentException("Property is required for class CalculatedGrantOffer.", nameof(expiresAt)); + + if (!fee.IsSet) + throw new ArgumentException("Property is required for class CalculatedGrantOffer.", nameof(fee)); + + if (!repayment.IsSet) + throw new ArgumentException("Property is required for class CalculatedGrantOffer.", nameof(repayment)); + + if (!startsAt.IsSet) + throw new ArgumentException("Property is required for class CalculatedGrantOffer.", nameof(startsAt)); + + var calculatedGrantOffer = new CalculatedGrantOffer(); + calculatedGrantOffer.AccountHolderId = accountHolderId.Value!; + calculatedGrantOffer.Amount = amount.Value!; + calculatedGrantOffer.ContractType = contractType.Value!; + calculatedGrantOffer.ExpiresAt = expiresAt.Value!.Value; + calculatedGrantOffer.Fee = fee.Value!; + calculatedGrantOffer.Repayment = repayment.Value!; + calculatedGrantOffer.StartsAt = startsAt.Value!.Value; + return calculatedGrantOffer; + } + + /// + /// Serializes a . + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CalculatedGrantOffer calculatedGrantOffer, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WriteStartObject(); + + WriteProperties(writer, calculatedGrantOffer, jsonSerializerOptions); + + writer.WriteEndObject(); + + } + + /// + /// Serializes the properties of . + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CalculatedGrantOffer calculatedGrantOffer, JsonSerializerOptions jsonSerializerOptions) + { + + if (calculatedGrantOffer.AccountHolderId != null) + writer.WriteString("accountHolderId", calculatedGrantOffer.AccountHolderId); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, calculatedGrantOffer.Amount, jsonSerializerOptions); + if (calculatedGrantOffer.ContractType != null) + { + string? contractTypeRawValue = CalculatedGrantOffer.ContractTypeEnum.ToJsonValue(calculatedGrantOffer.ContractType); + writer.WriteString("contractType", contractTypeRawValue); + } + + writer.WriteString("expiresAt", calculatedGrantOffer.ExpiresAt.ToString(ExpiresAtFormat)); + + writer.WritePropertyName("fee"); + JsonSerializer.Serialize(writer, calculatedGrantOffer.Fee, jsonSerializerOptions); + writer.WritePropertyName("repayment"); + JsonSerializer.Serialize(writer, calculatedGrantOffer.Repayment, jsonSerializerOptions); + writer.WriteString("startsAt", calculatedGrantOffer.StartsAt.ToString(StartsAtFormat)); + } + } +} diff --git a/Adyen/Capital/Models/CreateGrantOfferRequest.cs b/Adyen/Capital/Models/CreateGrantOfferRequest.cs new file mode 100644 index 000000000..c028d57ab --- /dev/null +++ b/Adyen/Capital/Models/CreateGrantOfferRequest.cs @@ -0,0 +1,153 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Core; +using Adyen.Capital.Client; + +namespace Adyen.Capital.Models +{ + /// + /// CreateGrantOfferRequest. + /// + public partial class CreateGrantOfferRequest + { + /// + /// Initializes a new instance of the class. + /// + public CreateGrantOfferRequest() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// . + /// + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CreateGrantOfferRequest {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class CreateGrantOfferRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to . + /// + /// . + /// . + /// The , initialized from . + /// . + /// + public override CreateGrantOfferRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (jsonPropertyName) + { + case "amount": + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class CreateGrantOfferRequest.", nameof(amount)); + + var createGrantOfferRequest = new CreateGrantOfferRequest(); + createGrantOfferRequest.Amount = amount.Value!; + return createGrantOfferRequest; + } + + /// + /// Serializes a . + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CreateGrantOfferRequest createGrantOfferRequest, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WriteStartObject(); + + WriteProperties(writer, createGrantOfferRequest, jsonSerializerOptions); + + writer.WriteEndObject(); + + } + + /// + /// Serializes the properties of . + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CreateGrantOfferRequest createGrantOfferRequest, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, createGrantOfferRequest.Amount, jsonSerializerOptions); + } + } +} diff --git a/Adyen/Capital/Models/DKLocalAccountIdentification.cs b/Adyen/Capital/Models/DKLocalAccountIdentification.cs index 0ebef678b..f66c79f19 100644 --- a/Adyen/Capital/Models/DKLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/DKLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,22 +37,10 @@ public partial class DKLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). - /// The 4-digit bank code (Registreringsnummer) (without separators or whitespace). - [JsonConstructor] - public DKLocalAccountIdentification(string accountNumber, string bankCode) : base() + public DKLocalAccountIdentification() : base() { - AccountNumber = accountNumber; - BankCode = bankCode; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public DKLocalAccountIdentification() - { - } partial void OnCreated(); @@ -148,7 +139,10 @@ public override DKLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class DKLocalAccountIdentification.", nameof(type)); - return new DKLocalAccountIdentification(accountNumber.Value!, bankCode.Value!); + var dKLocalAccountIdentification = new DKLocalAccountIdentification(); + dKLocalAccountIdentification.AccountNumber = accountNumber.Value!; + dKLocalAccountIdentification.BankCode = bankCode.Value!; + return dKLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/DefaultErrorResponseEntity.cs b/Adyen/Capital/Models/DefaultErrorResponseEntity.cs index ab8e0e3ae..70a590715 100644 --- a/Adyen/Capital/Models/DefaultErrorResponseEntity.cs +++ b/Adyen/Capital/Models/DefaultErrorResponseEntity.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,33 +37,9 @@ public partial class DefaultErrorResponseEntity /// /// Initializes a new instance of the class. /// - /// A human-readable explanation specific to this occurrence of the problem. - /// Unique business error code. - /// A URI that identifies the specific occurrence of the problem if applicable. - /// Array of fields with validation errors when applicable. - /// The unique reference for the request. - /// The HTTP status code. - /// A short, human-readable summary of the problem type. - /// A URI that identifies the validation error type. It points to human-readable documentation for the problem type. - [JsonConstructor] - public DefaultErrorResponseEntity(Option detail = default, Option errorCode = default, Option instance = default, Option?> invalidFields = default, Option requestId = default, Option status = default, Option title = default, Option type = default) - { - _DetailOption = detail; - _ErrorCodeOption = errorCode; - _InstanceOption = instance; - _InvalidFieldsOption = invalidFields; - _RequestIdOption = requestId; - _StatusOption = status; - _TitleOption = title; - _TypeOption = type; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public DefaultErrorResponseEntity() { + OnCreated(); } partial void OnCreated(); @@ -274,8 +253,24 @@ public override DefaultErrorResponseEntity Read(ref Utf8JsonReader utf8JsonReade } } - - return new DefaultErrorResponseEntity(detail, errorCode, instance, invalidFields, requestId, status, title, type); + var defaultErrorResponseEntity = new DefaultErrorResponseEntity(); + if (detail.IsSet) + defaultErrorResponseEntity.Detail = detail.Value; + if (errorCode.IsSet) + defaultErrorResponseEntity.ErrorCode = errorCode.Value; + if (instance.IsSet) + defaultErrorResponseEntity.Instance = instance.Value; + if (invalidFields.IsSet) + defaultErrorResponseEntity.InvalidFields = invalidFields.Value; + if (requestId.IsSet) + defaultErrorResponseEntity.RequestId = requestId.Value; + if (status.IsSet) + defaultErrorResponseEntity.Status = status.Value; + if (title.IsSet) + defaultErrorResponseEntity.Title = title.Value; + if (type.IsSet) + defaultErrorResponseEntity.Type = type.Value; + return defaultErrorResponseEntity; } /// @@ -326,7 +321,8 @@ public void WriteProperties(Utf8JsonWriter writer, DefaultErrorResponseEntity de writer.WriteString("requestId", defaultErrorResponseEntity.RequestId); if (defaultErrorResponseEntity._StatusOption.IsSet) - writer.WriteNumber("status", defaultErrorResponseEntity._StatusOption.Value!.Value); + if (defaultErrorResponseEntity._StatusOption.Value != null) + writer.WriteNumber("status", defaultErrorResponseEntity._StatusOption.Value!.Value); if (defaultErrorResponseEntity._TitleOption.IsSet) if (defaultErrorResponseEntity.Title != null) diff --git a/Adyen/Capital/Models/Disbursement.cs b/Adyen/Capital/Models/Disbursement.cs index 742dfdf60..01725ac9e 100644 --- a/Adyen/Capital/Models/Disbursement.cs +++ b/Adyen/Capital/Models/Disbursement.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,35 +37,9 @@ public partial class Disbursement /// /// Initializes a new instance of the class. /// - /// The unique identifier of the account holder that received the disbursement. - /// amount - /// The unique identifier of the balance account that received the disbursement. - /// balances - /// fee - /// The unique identifier of the grant related to the disbursement. - /// The unique identifier of the disbursement. - /// repayment - /// Contains information about the accounts that Adyen uses to collect funds related to repayments. - [JsonConstructor] - public Disbursement(string accountHolderId, Amount amount, string balanceAccountId, Balance balances, Fee fee, string grantId, string id, DisbursementRepayment repayment, Option?> fundsCollections = default) - { - AccountHolderId = accountHolderId; - Amount = amount; - BalanceAccountId = balanceAccountId; - Balances = balances; - Fee = fee; - GrantId = grantId; - Id = id; - Repayment = repayment; - _FundsCollectionsOption = fundsCollections; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Disbursement() { + OnCreated(); } partial void OnCreated(); @@ -259,7 +236,18 @@ public override Disbursement Read(ref Utf8JsonReader utf8JsonReader, Type typeTo if (!repayment.IsSet) throw new ArgumentException("Property is required for class Disbursement.", nameof(repayment)); - return new Disbursement(accountHolderId.Value!, amount.Value!, balanceAccountId.Value!, balances.Value!, fee.Value!, grantId.Value!, id.Value!, repayment.Value!, fundsCollections); + var disbursement = new Disbursement(); + disbursement.AccountHolderId = accountHolderId.Value!; + disbursement.Amount = amount.Value!; + disbursement.BalanceAccountId = balanceAccountId.Value!; + disbursement.Balances = balances.Value!; + disbursement.Fee = fee.Value!; + disbursement.GrantId = grantId.Value!; + disbursement.Id = id.Value!; + disbursement.Repayment = repayment.Value!; + if (fundsCollections.IsSet) + disbursement.FundsCollections = fundsCollections.Value; + return disbursement; } /// diff --git a/Adyen/Capital/Models/DisbursementInfoUpdate.cs b/Adyen/Capital/Models/DisbursementInfoUpdate.cs index 8dd40e6d6..74ea6c93c 100644 --- a/Adyen/Capital/Models/DisbursementInfoUpdate.cs +++ b/Adyen/Capital/Models/DisbursementInfoUpdate.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,19 +37,9 @@ public partial class DisbursementInfoUpdate /// /// Initializes a new instance of the class. /// - /// repayment - [JsonConstructor] - public DisbursementInfoUpdate(Option repayment = default) - { - _RepaymentOption = repayment; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public DisbursementInfoUpdate() { + OnCreated(); } partial void OnCreated(); @@ -126,8 +119,10 @@ public override DisbursementInfoUpdate Read(ref Utf8JsonReader utf8JsonReader, T } } - - return new DisbursementInfoUpdate(repayment); + var disbursementInfoUpdate = new DisbursementInfoUpdate(); + if (repayment.IsSet) + disbursementInfoUpdate.Repayment = repayment.Value; + return disbursementInfoUpdate; } /// diff --git a/Adyen/Capital/Models/DisbursementRepayment.cs b/Adyen/Capital/Models/DisbursementRepayment.cs index cc3ec3cf1..f0e51d855 100644 --- a/Adyen/Capital/Models/DisbursementRepayment.cs +++ b/Adyen/Capital/Models/DisbursementRepayment.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class DisbursementRepayment /// /// Initializes a new instance of the class. /// - /// The percentage of your user's incoming net volume that is deducted for repaying the grant. The percentage expressed in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - /// updateDescription - [JsonConstructor] - public DisbursementRepayment(int basisPoints, string updateDescription) - { - BasisPoints = basisPoints; - UpdateDescription = updateDescription; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public DisbursementRepayment() { + OnCreated(); } partial void OnCreated(); @@ -64,6 +55,8 @@ public DisbursementRepayment() /// . /// [JsonPropertyName("updateDescription")] + /* Deprecated */ + [Obsolete("")] public string UpdateDescription { get; set; } /// @@ -139,7 +132,10 @@ public override DisbursementRepayment Read(ref Utf8JsonReader utf8JsonReader, Ty if (!updateDescription.IsSet) throw new ArgumentException("Property is required for class DisbursementRepayment.", nameof(updateDescription)); - return new DisbursementRepayment(basisPoints.Value!.Value!, updateDescription.Value!); + var disbursementRepayment = new DisbursementRepayment(); + disbursementRepayment.BasisPoints = basisPoints.Value!.Value; + disbursementRepayment.UpdateDescription = updateDescription.Value!; + return disbursementRepayment; } /// diff --git a/Adyen/Capital/Models/DisbursementRepaymentInfoUpdate.cs b/Adyen/Capital/Models/DisbursementRepaymentInfoUpdate.cs index 77917d577..4ee5f7b14 100644 --- a/Adyen/Capital/Models/DisbursementRepaymentInfoUpdate.cs +++ b/Adyen/Capital/Models/DisbursementRepaymentInfoUpdate.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class DisbursementRepaymentInfoUpdate /// /// Initializes a new instance of the class. /// - /// The percentage of your user's incoming net volume that is deducted for repaying the grant. The percentage expressed in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - /// updateDescription - [JsonConstructor] - public DisbursementRepaymentInfoUpdate(Option basisPoints = default, Option updateDescription = default) - { - _BasisPointsOption = basisPoints; - _UpdateDescriptionOption = updateDescription; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public DisbursementRepaymentInfoUpdate() { + OnCreated(); } partial void OnCreated(); @@ -78,6 +69,8 @@ public DisbursementRepaymentInfoUpdate() /// . /// [JsonPropertyName("updateDescription")] + /* Deprecated */ + [Obsolete("")] public string? UpdateDescription { get { return this._UpdateDescriptionOption; } set { this._UpdateDescriptionOption = new(value); } } /// @@ -147,8 +140,12 @@ public override DisbursementRepaymentInfoUpdate Read(ref Utf8JsonReader utf8Json } } - - return new DisbursementRepaymentInfoUpdate(basisPoints, updateDescription); + var disbursementRepaymentInfoUpdate = new DisbursementRepaymentInfoUpdate(); + if (basisPoints.IsSet) + disbursementRepaymentInfoUpdate.BasisPoints = basisPoints.Value; + if (updateDescription.IsSet) + disbursementRepaymentInfoUpdate.UpdateDescription = updateDescription.Value; + return disbursementRepaymentInfoUpdate; } /// @@ -178,7 +175,8 @@ public void WriteProperties(Utf8JsonWriter writer, DisbursementRepaymentInfoUpda { if (disbursementRepaymentInfoUpdate._BasisPointsOption.IsSet) - writer.WriteNumber("basisPoints", disbursementRepaymentInfoUpdate._BasisPointsOption.Value!.Value); + if (disbursementRepaymentInfoUpdate._BasisPointsOption.Value != null) + writer.WriteNumber("basisPoints", disbursementRepaymentInfoUpdate._BasisPointsOption.Value!.Value); if (disbursementRepaymentInfoUpdate._UpdateDescriptionOption.IsSet) if (disbursementRepaymentInfoUpdate.UpdateDescription != null) diff --git a/Adyen/Capital/Models/Disbursements.cs b/Adyen/Capital/Models/Disbursements.cs index 970d000ce..c4a03855e 100644 --- a/Adyen/Capital/Models/Disbursements.cs +++ b/Adyen/Capital/Models/Disbursements.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,19 +37,9 @@ public partial class Disbursements /// /// Initializes a new instance of the class. /// - /// Contains a list of all disbursements related to the specified grant. - [JsonConstructor] - public Disbursements(List varDisbursements) - { - VarDisbursements = varDisbursements; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Disbursements() { + OnCreated(); } partial void OnCreated(); @@ -123,7 +116,9 @@ public override Disbursements Read(ref Utf8JsonReader utf8JsonReader, Type typeT if (!varDisbursements.IsSet) throw new ArgumentException("Property is required for class Disbursements.", nameof(varDisbursements)); - return new Disbursements(varDisbursements.Value!); + var disbursements = new Disbursements(); + disbursements.VarDisbursements = varDisbursements.Value!; + return disbursements; } /// diff --git a/Adyen/Capital/Models/DynamicOffer.cs b/Adyen/Capital/Models/DynamicOffer.cs new file mode 100644 index 000000000..f1720c8f7 --- /dev/null +++ b/Adyen/Capital/Models/DynamicOffer.cs @@ -0,0 +1,435 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Core; +using Adyen.Capital.Client; + +namespace Adyen.Capital.Models +{ + /// + /// DynamicOffer. + /// + public partial class DynamicOffer + { + /// + /// Initializes a new instance of the class. + /// + public DynamicOffer() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + [JsonConverter(typeof(ContractTypeEnumJsonConverter))] + public class ContractTypeEnum : IEnum + { + /// + /// Returns the value of the ContractTypeEnum. + /// + public string? Value { get; set; } + + /// + /// ContractTypeEnum.CashAdvance - cashAdvance + /// + public static readonly ContractTypeEnum CashAdvance = new("cashAdvance"); + + /// + /// ContractTypeEnum.Loan - loan + /// + public static readonly ContractTypeEnum Loan = new("loan"); + + private ContractTypeEnum(string? value) + { + Value = value; + } + + /// + /// Converts a string to a implicitly. + /// + /// The string value to convert. Defaults to null. + /// A new instance initialized with the string value. + public static implicit operator ContractTypeEnum?(string? value) => value == null ? null : new ContractTypeEnum(value); + + /// + /// Converts a instance to a string implicitly. + /// + /// The instance. Default to null. + /// String value of the instance. + public static implicit operator string?(ContractTypeEnum? option) => option?.Value; + + /// + /// Compares two instances for equality. + /// + public static bool operator ==(ContractTypeEnum? left, ContractTypeEnum? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Compares two instances for inequality. + /// + public static bool operator !=(ContractTypeEnum? left, ContractTypeEnum? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns true if the given object is equal to this instance. + /// + public override bool Equals(object? obj) => obj is ContractTypeEnum other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns a hash code for this instance. + /// + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + + /// + /// Returns the string value of the instance. + /// + public override string ToString() => Value ?? string.Empty; + + /// + /// Returns a . + /// + /// + /// or null. + public static ContractTypeEnum? FromStringOrDefault(string value) + { + return value switch { + "cashAdvance" => ContractTypeEnum.CashAdvance, + "loan" => ContractTypeEnum.Loan, + _ => null, + }; + } + + /// + /// Converts the to the json value. + /// + /// + /// String value of the enum. + public static string? ToJsonValue(ContractTypeEnum? value) + { + if (value == null) + return null; + + if (value == ContractTypeEnum.CashAdvance) + return "cashAdvance"; + + if (value == ContractTypeEnum.Loan) + return "loan"; + + return value.Value; + } + + /// + /// JsonConverter for writing ContractTypeEnum. + /// + public class ContractTypeEnumJsonConverter : JsonConverter + { + /// + /// Deserializes a from JSON. + /// + public override ContractTypeEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions jsonOptions) + { + string value = reader.GetString(); + return value == null ? null : ContractTypeEnum.FromStringOrDefault(value) ?? new ContractTypeEnum(value); + } + + /// + /// Serializes a to JSON. + /// + public override void Write(Utf8JsonWriter writer, ContractTypeEnum value, JsonSerializerOptions jsonOptions) + { + writer.WriteStringValue(ContractTypeEnum.ToJsonValue(value)); + } + } + } + + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + /// + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** + [JsonPropertyName("contractType")] + public ContractTypeEnum ContractType { get; set; } + + /// + /// . + /// + [JsonPropertyName("financingType")] + public FinancingType FinancingType { get; set; } + + /// + /// The unique identifier of the account holder that the dynamic offer is for. + /// + /// The unique identifier of the account holder that the dynamic offer is for. + [JsonPropertyName("accountHolderId")] + public string AccountHolderId { get; set; } + + /// + /// The expiration date and time of the offer validity period. + /// + /// The expiration date and time of the offer validity period. + [JsonPropertyName("expiresAt")] + public DateTimeOffset ExpiresAt { get; set; } + + /// + /// The unique identifier of the dynamic offer. + /// + /// The unique identifier of the dynamic offer. + [JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// . + /// + [JsonPropertyName("maximumAmount")] + public Amount MaximumAmount { get; set; } + + /// + /// . + /// + [JsonPropertyName("minimumAmount")] + public Amount MinimumAmount { get; set; } + + /// + /// . + /// + [JsonPropertyName("repayment")] + public DynamicOfferRepayment Repayment { get; set; } + + /// + /// The starting date and time of the offer validity period. + /// + /// The starting date and time of the offer validity period. + [JsonPropertyName("startsAt")] + public DateTimeOffset StartsAt { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DynamicOffer {\n"); + sb.Append(" AccountHolderId: ").Append(AccountHolderId).Append("\n"); + sb.Append(" ContractType: ").Append(ContractType).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" FinancingType: ").Append(FinancingType).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MaximumAmount: ").Append(MaximumAmount).Append("\n"); + sb.Append(" MinimumAmount: ").Append(MinimumAmount).Append("\n"); + sb.Append(" Repayment: ").Append(Repayment).Append("\n"); + sb.Append(" StartsAt: ").Append(StartsAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class DynamicOfferJsonConverter : JsonConverter + { + /// + /// The format to use to serialize ExpiresAt. + /// + public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize StartsAt. + /// + public static string StartsAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to . + /// + /// . + /// . + /// The , initialized from . + /// . + /// + public override DynamicOffer Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accountHolderId = default; + Option contractType = default; + Option expiresAt = default; + Option financingType = default; + Option id = default; + Option maximumAmount = default; + Option minimumAmount = default; + Option repayment = default; + Option startsAt = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (jsonPropertyName) + { + case "accountHolderId": + accountHolderId = new Option(utf8JsonReader.GetString()!); + break; + case "contractType": + string? contractTypeRawValue = utf8JsonReader.GetString(); + contractType = new Option(DynamicOffer.ContractTypeEnum.FromStringOrDefault(contractTypeRawValue) ?? (DynamicOffer.ContractTypeEnum)contractTypeRawValue); + break; + case "expiresAt": + expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "financingType": + string? financingTypeRawValue = utf8JsonReader.GetString(); + financingType = new Option(FinancingType.FromStringOrDefault(financingTypeRawValue) ?? (FinancingType)financingTypeRawValue); + break; + case "id": + id = new Option(utf8JsonReader.GetString()!); + break; + case "maximumAmount": + maximumAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + case "minimumAmount": + minimumAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + case "repayment": + repayment = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + case "startsAt": + startsAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!accountHolderId.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(accountHolderId)); + + if (!contractType.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(contractType)); + + if (!expiresAt.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(expiresAt)); + + if (!financingType.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(financingType)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(id)); + + if (!maximumAmount.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(maximumAmount)); + + if (!minimumAmount.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(minimumAmount)); + + if (!repayment.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(repayment)); + + if (!startsAt.IsSet) + throw new ArgumentException("Property is required for class DynamicOffer.", nameof(startsAt)); + + var dynamicOffer = new DynamicOffer(); + dynamicOffer.AccountHolderId = accountHolderId.Value!; + dynamicOffer.ContractType = contractType.Value!; + dynamicOffer.ExpiresAt = expiresAt.Value!.Value; + dynamicOffer.FinancingType = financingType.Value!; + dynamicOffer.Id = id.Value!; + dynamicOffer.MaximumAmount = maximumAmount.Value!; + dynamicOffer.MinimumAmount = minimumAmount.Value!; + dynamicOffer.Repayment = repayment.Value!; + dynamicOffer.StartsAt = startsAt.Value!.Value; + return dynamicOffer; + } + + /// + /// Serializes a . + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DynamicOffer dynamicOffer, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WriteStartObject(); + + WriteProperties(writer, dynamicOffer, jsonSerializerOptions); + + writer.WriteEndObject(); + + } + + /// + /// Serializes the properties of . + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DynamicOffer dynamicOffer, JsonSerializerOptions jsonSerializerOptions) + { + + if (dynamicOffer.AccountHolderId != null) + writer.WriteString("accountHolderId", dynamicOffer.AccountHolderId); + + if (dynamicOffer.ContractType != null) + { + string? contractTypeRawValue = DynamicOffer.ContractTypeEnum.ToJsonValue(dynamicOffer.ContractType); + writer.WriteString("contractType", contractTypeRawValue); + } + + writer.WriteString("expiresAt", dynamicOffer.ExpiresAt.ToString(ExpiresAtFormat)); + + var financingTypeRawValue = FinancingType.ToJsonValue(dynamicOffer.FinancingType); + writer.WriteString("financingType", financingTypeRawValue); + + if (dynamicOffer.Id != null) + writer.WriteString("id", dynamicOffer.Id); + + writer.WritePropertyName("maximumAmount"); + JsonSerializer.Serialize(writer, dynamicOffer.MaximumAmount, jsonSerializerOptions); + writer.WritePropertyName("minimumAmount"); + JsonSerializer.Serialize(writer, dynamicOffer.MinimumAmount, jsonSerializerOptions); + writer.WritePropertyName("repayment"); + JsonSerializer.Serialize(writer, dynamicOffer.Repayment, jsonSerializerOptions); + writer.WriteString("startsAt", dynamicOffer.StartsAt.ToString(StartsAtFormat)); + } + } +} diff --git a/Adyen/Capital/Models/DynamicOfferRepayment.cs b/Adyen/Capital/Models/DynamicOfferRepayment.cs new file mode 100644 index 000000000..16715c3ac --- /dev/null +++ b/Adyen/Capital/Models/DynamicOfferRepayment.cs @@ -0,0 +1,153 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Core; +using Adyen.Capital.Client; + +namespace Adyen.Capital.Models +{ + /// + /// DynamicOfferRepayment. + /// + public partial class DynamicOfferRepayment + { + /// + /// Initializes a new instance of the class. + /// + public DynamicOfferRepayment() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// . + /// + [JsonPropertyName("term")] + public RepaymentTerm Term { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DynamicOfferRepayment {\n"); + sb.Append(" Term: ").Append(Term).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class DynamicOfferRepaymentJsonConverter : JsonConverter + { + /// + /// Deserializes json to . + /// + /// . + /// . + /// The , initialized from . + /// . + /// + public override DynamicOfferRepayment Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option term = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (jsonPropertyName) + { + case "term": + term = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (!term.IsSet) + throw new ArgumentException("Property is required for class DynamicOfferRepayment.", nameof(term)); + + var dynamicOfferRepayment = new DynamicOfferRepayment(); + dynamicOfferRepayment.Term = term.Value!; + return dynamicOfferRepayment; + } + + /// + /// Serializes a . + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DynamicOfferRepayment dynamicOfferRepayment, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WriteStartObject(); + + WriteProperties(writer, dynamicOfferRepayment, jsonSerializerOptions); + + writer.WriteEndObject(); + + } + + /// + /// Serializes the properties of . + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DynamicOfferRepayment dynamicOfferRepayment, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WritePropertyName("term"); + JsonSerializer.Serialize(writer, dynamicOfferRepayment.Term, jsonSerializerOptions); + } + } +} diff --git a/Adyen/Capital/Models/Fee.cs b/Adyen/Capital/Models/Fee.cs index 1d8b3fbfa..4f7582f8c 100644 --- a/Adyen/Capital/Models/Fee.cs +++ b/Adyen/Capital/Models/Fee.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,19 +37,9 @@ public partial class Fee /// /// Initializes a new instance of the class. /// - /// amount - [JsonConstructor] - public Fee(Amount amount) - { - Amount = amount; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Fee() { + OnCreated(); } partial void OnCreated(); @@ -122,7 +115,9 @@ public override Fee Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, if (!amount.IsSet) throw new ArgumentException("Property is required for class Fee.", nameof(amount)); - return new Fee(amount.Value!); + var fee = new Fee(); + fee.Amount = amount.Value!; + return fee; } /// diff --git a/Adyen/Capital/Models/FinancingType.cs b/Adyen/Capital/Models/FinancingType.cs new file mode 100644 index 000000000..b32758eda --- /dev/null +++ b/Adyen/Capital/Models/FinancingType.cs @@ -0,0 +1,148 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Core; +using Adyen.Capital.Client; + +namespace Adyen.Capital.Models +{ + /// + /// Defines FinancingType + /// + [JsonConverter(typeof(FinancingType.FinancingTypeJsonConverter))] + public class FinancingType : IEnum + { + /// + /// Returns the value of the FinancingType. + /// + public string? Value { get; set; } + + /// + /// FinancingType.HardwareFinancing - hardwareFinancing + /// + public static readonly FinancingType HardwareFinancing = new("hardwareFinancing"); + + /// + /// FinancingType.BusinessFinancing - businessFinancing + /// + public static readonly FinancingType BusinessFinancing = new("businessFinancing"); + + private FinancingType(string? value) + { + Value = value; + } + + /// + /// Converts a string to a implicitly. + /// + public static implicit operator FinancingType?(string? value) => value == null ? null : new FinancingType(value); + + /// + /// Converts a instance to a string implicitly. + /// + public static implicit operator string?(FinancingType? option) => option?.Value; + + /// + /// Compares two instances for equality. + /// + public static bool operator ==(FinancingType? left, FinancingType? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Compares two instances for inequality. + /// + public static bool operator !=(FinancingType? left, FinancingType? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns true if the given object is equal to this instance. + /// + public override bool Equals(object? obj) => obj is FinancingType other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + /// Returns a hash code for this instance. + /// + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + + /// + /// Returns the string value of the instance. + /// + public override string ToString() => Value ?? string.Empty; + + /// + /// Returns a , or null if the value is not recognized. + /// + public static FinancingType? FromStringOrDefault(string? value) + { + return value switch { + "hardwareFinancing" => FinancingType.HardwareFinancing, + "businessFinancing" => FinancingType.BusinessFinancing, + _ => null, + }; + } + + /// + /// Converts the to the json value. + /// Returns the raw string value, preserving unknown values for round-trip safety. + /// + public static string? ToJsonValue(FinancingType? value) + { + if (value == null) + return null; + + if (value == FinancingType.HardwareFinancing) + return "hardwareFinancing"; + + if (value == FinancingType.BusinessFinancing) + return "businessFinancing"; + + return value.Value; + } + + /// + /// JsonConverter for . + /// Preserves unknown values instead of throwing an exception. + /// + public class FinancingTypeJsonConverter : JsonConverter + { + /// + /// Deserializes a from JSON. + /// Unknown values are preserved as-is rather than throwing an exception. + /// + public override FinancingType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string? rawValue = reader.GetString(); + return rawValue == null ? null : FinancingType.FromStringOrDefault(rawValue) ?? new FinancingType(rawValue); + } + + /// + /// Serializes a to JSON. + /// + public override void Write(Utf8JsonWriter writer, FinancingType value, JsonSerializerOptions options) + { + writer.WriteStringValue(FinancingType.ToJsonValue(value)); + } + } + } +} diff --git a/Adyen/Capital/Models/FundsCollection.cs b/Adyen/Capital/Models/FundsCollection.cs index 026f91bd5..f4640b392 100644 --- a/Adyen/Capital/Models/FundsCollection.cs +++ b/Adyen/Capital/Models/FundsCollection.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class FundsCollection /// /// Initializes a new instance of the class. /// - /// accountIdentification - /// fundsCollectionType - [JsonConstructor] - public FundsCollection(Option accountIdentification = default, Option fundsCollectionType = default) - { - _AccountIdentificationOption = accountIdentification; - _FundsCollectionTypeOption = fundsCollectionType; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public FundsCollection() { + OnCreated(); } partial void OnCreated(); @@ -139,8 +130,7 @@ public override FundsCollection Read(ref Utf8JsonReader utf8JsonReader, Type typ break; case "fundsCollectionType": string? fundsCollectionTypeRawValue = utf8JsonReader.GetString(); - if (fundsCollectionTypeRawValue != null) - fundsCollectionType = new Option(FundsCollectionTypeValueConverter.FromStringOrDefault(fundsCollectionTypeRawValue)); + fundsCollectionType = new Option(FundsCollectionType.FromStringOrDefault(fundsCollectionTypeRawValue) ?? (FundsCollectionType)fundsCollectionTypeRawValue); break; default: break; @@ -148,8 +138,12 @@ public override FundsCollection Read(ref Utf8JsonReader utf8JsonReader, Type typ } } - - return new FundsCollection(accountIdentification, fundsCollectionType); + var fundsCollection = new FundsCollection(); + if (accountIdentification.IsSet) + fundsCollection.AccountIdentification = accountIdentification.Value; + if (fundsCollectionType.IsSet) + fundsCollection.FundsCollectionType = fundsCollectionType.Value; + return fundsCollection; } /// @@ -185,7 +179,7 @@ public void WriteProperties(Utf8JsonWriter writer, FundsCollection fundsCollecti } if (fundsCollection._FundsCollectionTypeOption.IsSet) { - var fundsCollectionTypeRawValue = FundsCollectionTypeValueConverter.ToJsonValue(fundsCollection.FundsCollectionType!.Value); + var fundsCollectionTypeRawValue = FundsCollectionType.ToJsonValue(fundsCollection.FundsCollectionType); writer.WriteString("fundsCollectionType", fundsCollectionTypeRawValue); } } diff --git a/Adyen/Capital/Models/FundsCollectionType.cs b/Adyen/Capital/Models/FundsCollectionType.cs index 7d85e4327..15745ecc1 100644 --- a/Adyen/Capital/Models/FundsCollectionType.cs +++ b/Adyen/Capital/Models/FundsCollectionType.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -29,148 +32,117 @@ namespace Adyen.Capital.Models /// /// Defines FundsCollectionType /// - public enum FundsCollectionType + [JsonConverter(typeof(FundsCollectionType.FundsCollectionTypeJsonConverter))] + public class FundsCollectionType : IEnum { /// - /// Enum UnscheduledRepayment for value: UnscheduledRepayment + /// Returns the value of the FundsCollectionType. /// - UnscheduledRepayment = 1, + public string? Value { get; set; } /// - /// Enum Revocation for value: Revocation + /// FundsCollectionType.UnscheduledRepayment - UnscheduledRepayment /// - Revocation = 2 - } + public static readonly FundsCollectionType UnscheduledRepayment = new("UnscheduledRepayment"); - /// - /// Converts to and from the JSON value - /// - public static class FundsCollectionTypeValueConverter - { /// - /// Parses a given value to + /// FundsCollectionType.Revocation - Revocation /// - /// - /// - public static FundsCollectionType FromString(string value) - { - if (value.Equals("UnscheduledRepayment")) - return FundsCollectionType.UnscheduledRepayment; + public static readonly FundsCollectionType Revocation = new("Revocation"); - if (value.Equals("Revocation")) - return FundsCollectionType.Revocation; - - throw new NotImplementedException($"Could not convert value to type FundsCollectionType: '{value}'"); + private FundsCollectionType(string? value) + { + Value = value; } /// - /// Parses a given value to + /// Converts a string to a implicitly. /// - /// - /// - public static FundsCollectionType? FromStringOrDefault(string value) - { - if (value.Equals("UnscheduledRepayment")) - return FundsCollectionType.UnscheduledRepayment; - - if (value.Equals("Revocation")) - return FundsCollectionType.Revocation; - - return null; - } + public static implicit operator FundsCollectionType?(string? value) => value == null ? null : new FundsCollectionType(value); /// - /// Converts the to the json value + /// Converts a instance to a string implicitly. /// - /// - /// - /// - public static string ToJsonValue(FundsCollectionType value) - { - if (value == FundsCollectionType.UnscheduledRepayment) - return "UnscheduledRepayment"; - - if (value == FundsCollectionType.Revocation) - return "Revocation"; + public static implicit operator string?(FundsCollectionType? option) => option?.Value; - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - } + /// + /// Compares two instances for equality. + /// + public static bool operator ==(FundsCollectionType? left, FundsCollectionType? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - /// - /// A Json converter for type - /// - /// - public class FundsCollectionTypeJsonConverter : JsonConverter - { /// - /// Returns a from the Json object + /// Compares two instances for inequality. /// - /// - /// - /// - /// - public override FundsCollectionType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string? rawValue = reader.GetString(); + public static bool operator !=(FundsCollectionType? left, FundsCollectionType? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - FundsCollectionType? result = rawValue == null - ? null - : FundsCollectionTypeValueConverter.FromStringOrDefault(rawValue); + /// + /// Returns true if the given object is equal to this instance. + /// + public override bool Equals(object? obj) => obj is FundsCollectionType other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); - if (result != null) - return result.Value; + /// + /// Returns a hash code for this instance. + /// + public override int GetHashCode() => Value?.GetHashCode() ?? 0; - throw new JsonException(); - } + /// + /// Returns the string value of the instance. + /// + public override string ToString() => Value ?? string.Empty; /// - /// Writes the FundsCollectionType to the json writer + /// Returns a , or null if the value is not recognized. /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, FundsCollectionType fundsCollectionType, JsonSerializerOptions options) + public static FundsCollectionType? FromStringOrDefault(string? value) { - writer.WriteStringValue(FundsCollectionTypeValueConverter.ToJsonValue(fundsCollectionType).ToString()); + return value switch { + "UnscheduledRepayment" => FundsCollectionType.UnscheduledRepayment, + "Revocation" => FundsCollectionType.Revocation, + _ => null, + }; } - } - /// - /// A Json converter for type - /// - public class FundsCollectionTypeNullableJsonConverter : JsonConverter - { /// - /// Returns a FundsCollectionType from the Json object + /// Converts the to the json value. + /// Returns the raw string value, preserving unknown values for round-trip safety. /// - /// - /// - /// - /// - public override FundsCollectionType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public static string? ToJsonValue(FundsCollectionType? value) { - string? rawValue = reader.GetString(); + if (value == null) + return null; - FundsCollectionType? result = rawValue == null - ? null - : FundsCollectionTypeValueConverter.FromStringOrDefault(rawValue); + if (value == FundsCollectionType.UnscheduledRepayment) + return "UnscheduledRepayment"; - if (result != null) - return result.Value; + if (value == FundsCollectionType.Revocation) + return "Revocation"; - throw new JsonException(); + return value.Value; } /// - /// Writes the FundsCollectionType to the json writer + /// JsonConverter for . + /// Preserves unknown values instead of throwing an exception. /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, FundsCollectionType? fundsCollectionType, JsonSerializerOptions options) + public class FundsCollectionTypeJsonConverter : JsonConverter { - writer.WriteStringValue(fundsCollectionType.HasValue ? FundsCollectionTypeValueConverter.ToJsonValue(fundsCollectionType.Value).ToString() : "null"); + /// + /// Deserializes a from JSON. + /// Unknown values are preserved as-is rather than throwing an exception. + /// + public override FundsCollectionType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string? rawValue = reader.GetString(); + return rawValue == null ? null : FundsCollectionType.FromStringOrDefault(rawValue) ?? new FundsCollectionType(rawValue); + } + + /// + /// Serializes a to JSON. + /// + public override void Write(Utf8JsonWriter writer, FundsCollectionType value, JsonSerializerOptions options) + { + writer.WriteStringValue(FundsCollectionType.ToJsonValue(value)); + } } } } diff --git a/Adyen/Capital/Models/GetDynamicOffersResponse.cs b/Adyen/Capital/Models/GetDynamicOffersResponse.cs new file mode 100644 index 000000000..3b7e45806 --- /dev/null +++ b/Adyen/Capital/Models/GetDynamicOffersResponse.cs @@ -0,0 +1,154 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Core; +using Adyen.Capital.Client; + +namespace Adyen.Capital.Models +{ + /// + /// GetDynamicOffersResponse. + /// + public partial class GetDynamicOffersResponse + { + /// + /// Initializes a new instance of the class. + /// + public GetDynamicOffersResponse() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Contains a list of available dynamic offers for the specified account holder. + /// + /// Contains a list of available dynamic offers for the specified account holder. + [JsonPropertyName("dynamicOffers")] + public List DynamicOffers { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GetDynamicOffersResponse {\n"); + sb.Append(" DynamicOffers: ").Append(DynamicOffers).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class GetDynamicOffersResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to . + /// + /// . + /// . + /// The , initialized from . + /// . + /// + public override GetDynamicOffersResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option?> dynamicOffers = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (jsonPropertyName) + { + case "dynamicOffers": + dynamicOffers = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (!dynamicOffers.IsSet) + throw new ArgumentException("Property is required for class GetDynamicOffersResponse.", nameof(dynamicOffers)); + + var getDynamicOffersResponse = new GetDynamicOffersResponse(); + getDynamicOffersResponse.DynamicOffers = dynamicOffers.Value!; + return getDynamicOffersResponse; + } + + /// + /// Serializes a . + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GetDynamicOffersResponse getDynamicOffersResponse, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WriteStartObject(); + + WriteProperties(writer, getDynamicOffersResponse, jsonSerializerOptions); + + writer.WriteEndObject(); + + } + + /// + /// Serializes the properties of . + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GetDynamicOffersResponse getDynamicOffersResponse, JsonSerializerOptions jsonSerializerOptions) + { + + writer.WritePropertyName("dynamicOffers"); + JsonSerializer.Serialize(writer, getDynamicOffersResponse.DynamicOffers, jsonSerializerOptions); + } + } +} diff --git a/Adyen/Capital/Models/Grant.cs b/Adyen/Capital/Models/Grant.cs index 3f5439f98..1440a656f 100644 --- a/Adyen/Capital/Models/Grant.cs +++ b/Adyen/Capital/Models/Grant.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,29 +37,9 @@ public partial class Grant /// /// Initializes a new instance of the class. /// - /// balances - /// The unique identifier of the grant account that tracks this grant. - /// The unique identifier of the selected grant offer. Adyen uses the details of the selected grant offer to create a grant. - /// The unique identifier of the grant reference. - /// status - /// counterparty - [JsonConstructor] - public Grant(Balance balances, string grantAccountId, string grantOfferId, string id, Status status, Option counterparty = default) - { - Balances = balances; - GrantAccountId = grantAccountId; - GrantOfferId = grantOfferId; - Id = id; - Status = status; - _CounterpartyOption = counterparty; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Grant() { + OnCreated(); } partial void OnCreated(); @@ -75,9 +58,9 @@ public Grant() public string GrantAccountId { get; set; } /// - /// The unique identifier of the selected grant offer. Adyen uses the details of the selected grant offer to create a grant. + /// The unique identifier of the selected offer. Adyen uses the details of the selected offer to create a grant. /// - /// The unique identifier of the selected grant offer. Adyen uses the details of the selected grant offer to create a grant. + /// The unique identifier of the selected offer. Adyen uses the details of the selected offer to create a grant. [JsonPropertyName("grantOfferId")] public string GrantOfferId { get; set; } @@ -209,7 +192,15 @@ public override Grant Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (!status.IsSet) throw new ArgumentException("Property is required for class Grant.", nameof(status)); - return new Grant(balances.Value!, grantAccountId.Value!, grantOfferId.Value!, id.Value!, status.Value!, counterparty); + var grant = new Grant(); + grant.Balances = balances.Value!; + grant.GrantAccountId = grantAccountId.Value!; + grant.GrantOfferId = grantOfferId.Value!; + grant.Id = id.Value!; + grant.Status = status.Value!; + if (counterparty.IsSet) + grant.Counterparty = counterparty.Value; + return grant; } /// diff --git a/Adyen/Capital/Models/GrantAccount.cs b/Adyen/Capital/Models/GrantAccount.cs index 68ef9040f..0a2e0b658 100644 --- a/Adyen/Capital/Models/GrantAccount.cs +++ b/Adyen/Capital/Models/GrantAccount.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,25 +37,9 @@ public partial class GrantAccount /// /// Initializes a new instance of the class. /// - /// Contains the sum of the balances of all grants tracked by this grant account. The balances are separated by currency. - /// The unique identifier of the balance account used to fund the grant. - /// The unique identifier of the grant account. - /// Contains the maximum amount of funds that you can disburse for grants. - [JsonConstructor] - public GrantAccount(Option?> balances = default, Option fundingBalanceAccountId = default, Option id = default, Option?> limits = default) - { - _BalancesOption = balances; - _FundingBalanceAccountIdOption = fundingBalanceAccountId; - _IdOption = id; - _LimitsOption = limits; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantAccount() { + OnCreated(); } partial void OnCreated(); @@ -190,8 +177,16 @@ public override GrantAccount Read(ref Utf8JsonReader utf8JsonReader, Type typeTo } } - - return new GrantAccount(balances, fundingBalanceAccountId, id, limits); + var grantAccount = new GrantAccount(); + if (balances.IsSet) + grantAccount.Balances = balances.Value; + if (fundingBalanceAccountId.IsSet) + grantAccount.FundingBalanceAccountId = fundingBalanceAccountId.Value; + if (id.IsSet) + grantAccount.Id = id.Value; + if (limits.IsSet) + grantAccount.Limits = limits.Value; + return grantAccount; } /// diff --git a/Adyen/Capital/Models/GrantCounterparty.cs b/Adyen/Capital/Models/GrantCounterparty.cs index 53c463bf5..72e416959 100644 --- a/Adyen/Capital/Models/GrantCounterparty.cs +++ b/Adyen/Capital/Models/GrantCounterparty.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,23 +37,9 @@ public partial class GrantCounterparty /// /// Initializes a new instance of the class. /// - /// The unique identifier of the account holder that receives the grant. - /// The unique identifier of the balance account where the funds are disbursed. The balance account must belong to the specified account holder. - /// The unique identifier of the transfer instrument where the funds are disbursed. The transfer instrument must belong to the legal entity of the specified account holder. - [JsonConstructor] - public GrantCounterparty(Option accountHolderId = default, Option balanceAccountId = default, Option transferInstrumentId = default) - { - _AccountHolderIdOption = accountHolderId; - _BalanceAccountIdOption = balanceAccountId; - _TransferInstrumentIdOption = transferInstrumentId; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantCounterparty() { + OnCreated(); } partial void OnCreated(); @@ -169,8 +158,14 @@ public override GrantCounterparty Read(ref Utf8JsonReader utf8JsonReader, Type t } } - - return new GrantCounterparty(accountHolderId, balanceAccountId, transferInstrumentId); + var grantCounterparty = new GrantCounterparty(); + if (accountHolderId.IsSet) + grantCounterparty.AccountHolderId = accountHolderId.Value; + if (balanceAccountId.IsSet) + grantCounterparty.BalanceAccountId = balanceAccountId.Value; + if (transferInstrumentId.IsSet) + grantCounterparty.TransferInstrumentId = transferInstrumentId.Value; + return grantCounterparty; } /// diff --git a/Adyen/Capital/Models/GrantInfo.cs b/Adyen/Capital/Models/GrantInfo.cs index 082af406a..fe370df8d 100644 --- a/Adyen/Capital/Models/GrantInfo.cs +++ b/Adyen/Capital/Models/GrantInfo.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,23 +37,9 @@ public partial class GrantInfo /// /// Initializes a new instance of the class. /// - /// The unique identifier of the grant account that tracks this grant. - /// The unique identifier of the selected grant offer. Adyen uses the details of the selected grant offer to create a grant. - /// counterparty - [JsonConstructor] - public GrantInfo(string grantAccountId, string grantOfferId, Option counterparty = default) - { - GrantAccountId = grantAccountId; - GrantOfferId = grantOfferId; - _CounterpartyOption = counterparty; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantInfo() { + OnCreated(); } partial void OnCreated(); @@ -63,9 +52,9 @@ public GrantInfo() public string GrantAccountId { get; set; } /// - /// The unique identifier of the selected grant offer. Adyen uses the details of the selected grant offer to create a grant. + /// The unique identifier of the selected offer. Adyen uses the details of the selected offer to create a grant. /// - /// The unique identifier of the selected grant offer. Adyen uses the details of the selected grant offer to create a grant. + /// The unique identifier of the selected offer. Adyen uses the details of the selected offer to create a grant. [JsonPropertyName("grantOfferId")] public string GrantOfferId { get; set; } @@ -160,7 +149,12 @@ public override GrantInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToCon if (!grantOfferId.IsSet) throw new ArgumentException("Property is required for class GrantInfo.", nameof(grantOfferId)); - return new GrantInfo(grantAccountId.Value!, grantOfferId.Value!, counterparty); + var grantInfo = new GrantInfo(); + grantInfo.GrantAccountId = grantAccountId.Value!; + grantInfo.GrantOfferId = grantOfferId.Value!; + if (counterparty.IsSet) + grantInfo.Counterparty = counterparty.Value; + return grantInfo; } /// diff --git a/Adyen/Capital/Models/GrantInfoCounterparty.cs b/Adyen/Capital/Models/GrantInfoCounterparty.cs index 188afe026..e9b626da5 100644 --- a/Adyen/Capital/Models/GrantInfoCounterparty.cs +++ b/Adyen/Capital/Models/GrantInfoCounterparty.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class GrantInfoCounterparty /// /// Initializes a new instance of the class. /// - /// The unique identifier of the balance account where the funds are disbursed. The balance account must belong to the specified account holder. - /// The unique identifier of the transfer instrument where the funds are disbursed. The transfer instrument must belong to the legal entity of the specified account holder. - [JsonConstructor] - public GrantInfoCounterparty(Option balanceAccountId = default, Option transferInstrumentId = default) - { - _BalanceAccountIdOption = balanceAccountId; - _TransferInstrumentIdOption = transferInstrumentId; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantInfoCounterparty() { + OnCreated(); } partial void OnCreated(); @@ -148,8 +139,12 @@ public override GrantInfoCounterparty Read(ref Utf8JsonReader utf8JsonReader, Ty } } - - return new GrantInfoCounterparty(balanceAccountId, transferInstrumentId); + var grantInfoCounterparty = new GrantInfoCounterparty(); + if (balanceAccountId.IsSet) + grantInfoCounterparty.BalanceAccountId = balanceAccountId.Value; + if (transferInstrumentId.IsSet) + grantInfoCounterparty.TransferInstrumentId = transferInstrumentId.Value; + return grantInfoCounterparty; } /// diff --git a/Adyen/Capital/Models/GrantLimit.cs b/Adyen/Capital/Models/GrantLimit.cs index bc635e91d..a14041fc6 100644 --- a/Adyen/Capital/Models/GrantLimit.cs +++ b/Adyen/Capital/Models/GrantLimit.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,19 +37,9 @@ public partial class GrantLimit /// /// Initializes a new instance of the class. /// - /// amount - [JsonConstructor] - public GrantLimit(Option amount = default) - { - _AmountOption = amount; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantLimit() { + OnCreated(); } partial void OnCreated(); @@ -126,8 +119,10 @@ public override GrantLimit Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo } } - - return new GrantLimit(amount); + var grantLimit = new GrantLimit(); + if (amount.IsSet) + grantLimit.Amount = amount.Value; + return grantLimit; } /// diff --git a/Adyen/Capital/Models/GrantOffer.cs b/Adyen/Capital/Models/GrantOffer.cs index 2e232c515..f08a97ac9 100644 --- a/Adyen/Capital/Models/GrantOffer.cs +++ b/Adyen/Capital/Models/GrantOffer.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,41 +37,17 @@ public partial class GrantOffer /// /// Initializes a new instance of the class. /// - /// The unique identifier of the account holder to which the grant is offered. - /// amount - /// The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. - /// The date when the grant offer expires. - /// fee - /// The unique identifier of the grant offer. - /// repayment - /// The date when the grant offer becomes available. - [JsonConstructor] - public GrantOffer(string accountHolderId, Option amount = default, Option contractType = default, Option expiresAt = default, Option fee = default, Option id = default, Option repayment = default, Option startsAt = default) - { - AccountHolderId = accountHolderId; - _AmountOption = amount; - _ContractTypeOption = contractType; - _ExpiresAtOption = expiresAt; - _FeeOption = fee; - _IdOption = id; - _RepaymentOption = repayment; - _StartsAtOption = startsAt; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantOffer() { + OnCreated(); } partial void OnCreated(); /// - /// The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** /// - /// The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** [JsonConverter(typeof(ContractTypeEnumJsonConverter))] public class ContractTypeEnum : IEnum { @@ -103,17 +82,32 @@ private ContractTypeEnum(string? value) /// Converts a instance to a string implicitly. /// /// The instance. Default to null. - /// String value of the instance./// + /// String value of the instance. public static implicit operator string?(ContractTypeEnum? option) => option?.Value; + /// + /// Compares two instances for equality. + /// public static bool operator ==(ContractTypeEnum? left, ContractTypeEnum? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - + + /// + /// Compares two instances for inequality. + /// public static bool operator !=(ContractTypeEnum? left, ContractTypeEnum? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + /// + /// Returns true if the given object is equal to this instance. + /// public override bool Equals(object? obj) => obj is ContractTypeEnum other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); - + + /// + /// Returns a hash code for this instance. + /// public override int GetHashCode() => Value?.GetHashCode() ?? 0; - + + /// + /// Returns the string value of the instance. + /// public override string ToString() => Value ?? string.Empty; /// @@ -135,7 +129,6 @@ private ContractTypeEnum(string? value) /// /// /// String value of the enum. - /// public static string? ToJsonValue(ContractTypeEnum? value) { if (value == null) @@ -147,7 +140,7 @@ private ContractTypeEnum(string? value) if (value == ContractTypeEnum.Loan) return "loan"; - return null; + return value.Value; } /// @@ -155,12 +148,18 @@ private ContractTypeEnum(string? value) /// public class ContractTypeEnumJsonConverter : JsonConverter { + /// + /// Deserializes a from JSON. + /// public override ContractTypeEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions jsonOptions) { string value = reader.GetString(); return value == null ? null : ContractTypeEnum.FromStringOrDefault(value) ?? new ContractTypeEnum(value); } + /// + /// Serializes a to JSON. + /// public override void Write(Utf8JsonWriter writer, ContractTypeEnum value, JsonSerializerOptions jsonOptions) { writer.WriteStringValue(ContractTypeEnum.ToJsonValue(value)); @@ -176,9 +175,9 @@ public override void Write(Utf8JsonWriter writer, ContractTypeEnum value, JsonSe public Option _ContractTypeOption { get; private set; } /// - /// The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** /// - /// The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. + /// The contract type of the offer. Possible values: * **loan** * **cashAdvance** [JsonPropertyName("contractType")] public ContractTypeEnum? ContractType { get { return this._ContractTypeOption; } set { this._ContractTypeOption = new(value); } } @@ -210,9 +209,9 @@ public override void Write(Utf8JsonWriter writer, ContractTypeEnum value, JsonSe public Option _ExpiresAtOption { get; private set; } /// - /// The date when the grant offer expires. + /// The expiration date and time of the offer validity period. /// - /// The date when the grant offer expires. + /// The expiration date and time of the offer validity period. [JsonPropertyName("expiresAt")] public DateTimeOffset? ExpiresAt { get { return this._ExpiresAtOption; } set { this._ExpiresAtOption = new(value); } } @@ -237,9 +236,9 @@ public override void Write(Utf8JsonWriter writer, ContractTypeEnum value, JsonSe public Option _IdOption { get; private set; } /// - /// The unique identifier of the grant offer. + /// The unique identifier of the offer. /// - /// The unique identifier of the grant offer. + /// The unique identifier of the offer. [JsonPropertyName("id")] public string? Id { get { return this._IdOption; } set { this._IdOption = new(value); } } @@ -264,9 +263,9 @@ public override void Write(Utf8JsonWriter writer, ContractTypeEnum value, JsonSe public Option _StartsAtOption { get; private set; } /// - /// The date when the grant offer becomes available. + /// The starting date and time of the offer validity period. /// - /// The date when the grant offer becomes available. + /// The starting date and time of the offer validity period. [JsonPropertyName("startsAt")] public DateTimeOffset? StartsAt { get { return this._StartsAtOption; } set { this._StartsAtOption = new(value); } } @@ -355,7 +354,7 @@ public override GrantOffer Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo break; case "contractType": string? contractTypeRawValue = utf8JsonReader.GetString(); - contractType = new Option(GrantOffer.ContractTypeEnum.FromStringOrDefault(contractTypeRawValue)); + contractType = new Option(GrantOffer.ContractTypeEnum.FromStringOrDefault(contractTypeRawValue) ?? (GrantOffer.ContractTypeEnum)contractTypeRawValue); break; case "expiresAt": expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); @@ -381,7 +380,23 @@ public override GrantOffer Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (!accountHolderId.IsSet) throw new ArgumentException("Property is required for class GrantOffer.", nameof(accountHolderId)); - return new GrantOffer(accountHolderId.Value!, amount, contractType, expiresAt, fee, id, repayment, startsAt); + var grantOffer = new GrantOffer(); + grantOffer.AccountHolderId = accountHolderId.Value!; + if (amount.IsSet) + grantOffer.Amount = amount.Value; + if (contractType.IsSet) + grantOffer.ContractType = contractType.Value; + if (expiresAt.IsSet) + grantOffer.ExpiresAt = expiresAt.Value; + if (fee.IsSet) + grantOffer.Fee = fee.Value; + if (id.IsSet) + grantOffer.Id = id.Value; + if (repayment.IsSet) + grantOffer.Repayment = repayment.Value; + if (startsAt.IsSet) + grantOffer.StartsAt = startsAt.Value; + return grantOffer; } /// @@ -425,7 +440,8 @@ public void WriteProperties(Utf8JsonWriter writer, GrantOffer grantOffer, JsonSe } if (grantOffer._ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", grantOffer._ExpiresAtOption.Value!.Value.ToString(ExpiresAtFormat)); + if (grantOffer._ExpiresAtOption.Value != null) + writer.WriteString("expiresAt", grantOffer._ExpiresAtOption.Value!.Value.ToString(ExpiresAtFormat)); if (grantOffer._FeeOption.IsSet) { @@ -442,7 +458,8 @@ public void WriteProperties(Utf8JsonWriter writer, GrantOffer grantOffer, JsonSe JsonSerializer.Serialize(writer, grantOffer.Repayment, jsonSerializerOptions); } if (grantOffer._StartsAtOption.IsSet) - writer.WriteString("startsAt", grantOffer._StartsAtOption.Value!.Value.ToString(StartsAtFormat)); + if (grantOffer._StartsAtOption.Value != null) + writer.WriteString("startsAt", grantOffer._StartsAtOption.Value!.Value.ToString(StartsAtFormat)); } } } diff --git a/Adyen/Capital/Models/GrantOfferFee.cs b/Adyen/Capital/Models/GrantOfferFee.cs index 5a932b3cf..dd9e258f5 100644 --- a/Adyen/Capital/Models/GrantOfferFee.cs +++ b/Adyen/Capital/Models/GrantOfferFee.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class GrantOfferFee /// /// Initializes a new instance of the class. /// - /// amount - /// Annual Percentage Rate (APR) of the offer. The percentage is expressed in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - [JsonConstructor] - public GrantOfferFee(Amount amount, Option aprBasisPoints = default) - { - Amount = amount; - _AprBasisPointsOption = aprBasisPoints; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantOfferFee() { + OnCreated(); } partial void OnCreated(); @@ -143,7 +134,11 @@ public override GrantOfferFee Read(ref Utf8JsonReader utf8JsonReader, Type typeT if (!amount.IsSet) throw new ArgumentException("Property is required for class GrantOfferFee.", nameof(amount)); - return new GrantOfferFee(amount.Value!, aprBasisPoints); + var grantOfferFee = new GrantOfferFee(); + grantOfferFee.Amount = amount.Value!; + if (aprBasisPoints.IsSet) + grantOfferFee.AprBasisPoints = aprBasisPoints.Value; + return grantOfferFee; } /// @@ -175,7 +170,8 @@ public void WriteProperties(Utf8JsonWriter writer, GrantOfferFee grantOfferFee, writer.WritePropertyName("amount"); JsonSerializer.Serialize(writer, grantOfferFee.Amount, jsonSerializerOptions); if (grantOfferFee._AprBasisPointsOption.IsSet) - writer.WriteNumber("aprBasisPoints", grantOfferFee._AprBasisPointsOption.Value!.Value); + if (grantOfferFee._AprBasisPointsOption.Value != null) + writer.WriteNumber("aprBasisPoints", grantOfferFee._AprBasisPointsOption.Value!.Value); } } } diff --git a/Adyen/Capital/Models/GrantOffers.cs b/Adyen/Capital/Models/GrantOffers.cs index e6f547232..864de8444 100644 --- a/Adyen/Capital/Models/GrantOffers.cs +++ b/Adyen/Capital/Models/GrantOffers.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,27 +37,17 @@ public partial class GrantOffers /// /// Initializes a new instance of the class. /// - /// Contains a list of available grant offers for the specified account holder. - [JsonConstructor] - public GrantOffers(List varGrantOffers) - { - VarGrantOffers = varGrantOffers; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public GrantOffers() { + OnCreated(); } partial void OnCreated(); /// - /// Contains a list of available grant offers for the specified account holder. + /// Contains a list of available offers for the specified account holder. /// - /// Contains a list of available grant offers for the specified account holder. + /// Contains a list of available offers for the specified account holder. [JsonPropertyName("grantOffers")] public List VarGrantOffers { get; set; } @@ -123,7 +116,9 @@ public override GrantOffers Read(ref Utf8JsonReader utf8JsonReader, Type typeToC if (!varGrantOffers.IsSet) throw new ArgumentException("Property is required for class GrantOffers.", nameof(varGrantOffers)); - return new GrantOffers(varGrantOffers.Value!); + var grantOffers = new GrantOffers(); + grantOffers.VarGrantOffers = varGrantOffers.Value!; + return grantOffers; } /// diff --git a/Adyen/Capital/Models/Grants.cs b/Adyen/Capital/Models/Grants.cs index 777b63077..b5a888d3b 100644 --- a/Adyen/Capital/Models/Grants.cs +++ b/Adyen/Capital/Models/Grants.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,19 +37,9 @@ public partial class Grants /// /// Initializes a new instance of the class. /// - /// Contains a list of the grants that the account holder has received. - [JsonConstructor] - public Grants(List varGrants) - { - VarGrants = varGrants; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Grants() { + OnCreated(); } partial void OnCreated(); @@ -123,7 +116,9 @@ public override Grants Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver if (!varGrants.IsSet) throw new ArgumentException("Property is required for class Grants.", nameof(varGrants)); - return new Grants(varGrants.Value!); + var grants = new Grants(); + grants.VarGrants = varGrants.Value!; + return grants; } /// diff --git a/Adyen/Capital/Models/HKLocalAccountIdentification.cs b/Adyen/Capital/Models/HKLocalAccountIdentification.cs index 28299da1b..86320c6b9 100644 --- a/Adyen/Capital/Models/HKLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/HKLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,22 +37,10 @@ public partial class HKLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 9- to 17-digit bank account number, without separators or whitespace. Starts with the 3-digit branch code. - /// The 3-digit clearing code, without separators or whitespace. - [JsonConstructor] - public HKLocalAccountIdentification(string accountNumber, string clearingCode) : base() + public HKLocalAccountIdentification() : base() { - AccountNumber = accountNumber; - ClearingCode = clearingCode; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public HKLocalAccountIdentification() - { - } partial void OnCreated(); @@ -148,7 +139,10 @@ public override HKLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class HKLocalAccountIdentification.", nameof(type)); - return new HKLocalAccountIdentification(accountNumber.Value!, clearingCode.Value!); + var hKLocalAccountIdentification = new HKLocalAccountIdentification(); + hKLocalAccountIdentification.AccountNumber = accountNumber.Value!; + hKLocalAccountIdentification.ClearingCode = clearingCode.Value!; + return hKLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/HULocalAccountIdentification.cs b/Adyen/Capital/Models/HULocalAccountIdentification.cs index 718403bb8..fccd5669b 100644 --- a/Adyen/Capital/Models/HULocalAccountIdentification.cs +++ b/Adyen/Capital/Models/HULocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,20 +37,10 @@ public partial class HULocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 24-digit bank account number, without separators or whitespace. - [JsonConstructor] - public HULocalAccountIdentification(string accountNumber) : base() + public HULocalAccountIdentification() : base() { - AccountNumber = accountNumber; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public HULocalAccountIdentification() - { - } partial void OnCreated(); @@ -131,7 +124,9 @@ public override HULocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class HULocalAccountIdentification.", nameof(type)); - return new HULocalAccountIdentification(accountNumber.Value!); + var hULocalAccountIdentification = new HULocalAccountIdentification(); + hULocalAccountIdentification.AccountNumber = accountNumber.Value!; + return hULocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/IbanAccountIdentification.cs b/Adyen/Capital/Models/IbanAccountIdentification.cs index 099dccb4c..d5c60d545 100644 --- a/Adyen/Capital/Models/IbanAccountIdentification.cs +++ b/Adyen/Capital/Models/IbanAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,20 +37,10 @@ public partial class IbanAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. - [JsonConstructor] - public IbanAccountIdentification(string iban) : base() + public IbanAccountIdentification() : base() { - Iban = iban; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public IbanAccountIdentification() - { - } partial void OnCreated(); @@ -58,6 +51,20 @@ public IbanAccountIdentification() [JsonPropertyName("iban")] public string Iban { get; set; } + /// + /// This is used to track if an optional field is set. If set, will be populated. + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option _BicOption { get; private set; } + + /// + /// The bank's 8- or 11-character BIC or SWIFT code. + /// + /// The bank's 8- or 11-character BIC or SWIFT code. + [JsonPropertyName("bic")] + public string? Bic { get { return this._BicOption; } set { this._BicOption = new(value); } } + /// /// Returns the string presentation of the object /// @@ -68,6 +75,7 @@ public override string ToString() sb.Append("class IbanAccountIdentification {\n"); sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); sb.Append(" Iban: ").Append(Iban).Append("\n"); + sb.Append(" Bic: ").Append(Bic).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -97,6 +105,7 @@ public override IbanAccountIdentification Read(ref Utf8JsonReader utf8JsonReader Option iban = default; Option type = default; + Option bic = default; while (utf8JsonReader.Read()) { @@ -119,6 +128,9 @@ public override IbanAccountIdentification Read(ref Utf8JsonReader utf8JsonReader case "type": type = new Option(utf8JsonReader.GetString()!); break; + case "bic": + bic = new Option(utf8JsonReader.GetString()!); + break; default: break; } @@ -131,7 +143,11 @@ public override IbanAccountIdentification Read(ref Utf8JsonReader utf8JsonReader if (!type.IsSet) throw new ArgumentException("Property is required for class IbanAccountIdentification.", nameof(type)); - return new IbanAccountIdentification(iban.Value!); + var ibanAccountIdentification = new IbanAccountIdentification(); + ibanAccountIdentification.Iban = iban.Value!; + if (bic.IsSet) + ibanAccountIdentification.Bic = bic.Value; + return ibanAccountIdentification; } /// @@ -165,6 +181,10 @@ public void WriteProperties(Utf8JsonWriter writer, IbanAccountIdentification iba if (ibanAccountIdentification.Type != null) writer.WriteString("type", ibanAccountIdentification.Type); + + if (ibanAccountIdentification._BicOption.IsSet) + if (ibanAccountIdentification.Bic != null) + writer.WriteString("bic", ibanAccountIdentification.Bic); } } } diff --git a/Adyen/Capital/Models/InvalidField.cs b/Adyen/Capital/Models/InvalidField.cs index 06405a4fa..d914de421 100644 --- a/Adyen/Capital/Models/InvalidField.cs +++ b/Adyen/Capital/Models/InvalidField.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,27 +37,20 @@ public partial class InvalidField /// /// Initializes a new instance of the class. /// - /// The field that has an invalid value. - /// The invalid value. - /// Description of the validation error. - [JsonConstructor] - public InvalidField(string name, string value, string message) - { - Name = name; - Value = value; - Message = message; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public InvalidField() { + OnCreated(); } partial void OnCreated(); + /// + /// Description of the validation error. + /// + /// Description of the validation error. + [JsonPropertyName("message")] + public string Message { get; set; } + /// /// The field that has an invalid value. /// @@ -69,13 +65,6 @@ public InvalidField() [JsonPropertyName("value")] public string Value { get; set; } - /// - /// Description of the validation error. - /// - /// Description of the validation error. - [JsonPropertyName("message")] - public string Message { get; set; } - /// /// Returns the string presentation of the object /// @@ -84,9 +73,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class InvalidField {\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Value: ").Append(Value).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -114,9 +103,9 @@ public override InvalidField Read(ref Utf8JsonReader utf8JsonReader, Type typeTo JsonTokenType startingTokenType = utf8JsonReader.TokenType; + Option message = default; Option name = default; Option value = default; - Option message = default; while (utf8JsonReader.Read()) { @@ -133,31 +122,35 @@ public override InvalidField Read(ref Utf8JsonReader utf8JsonReader, Type typeTo switch (jsonPropertyName) { + case "message": + message = new Option(utf8JsonReader.GetString()!); + break; case "name": name = new Option(utf8JsonReader.GetString()!); break; case "value": value = new Option(utf8JsonReader.GetString()!); break; - case "message": - message = new Option(utf8JsonReader.GetString()!); - break; default: break; } } } + if (!message.IsSet) + throw new ArgumentException("Property is required for class InvalidField.", nameof(message)); + if (!name.IsSet) throw new ArgumentException("Property is required for class InvalidField.", nameof(name)); if (!value.IsSet) throw new ArgumentException("Property is required for class InvalidField.", nameof(value)); - if (!message.IsSet) - throw new ArgumentException("Property is required for class InvalidField.", nameof(message)); - - return new InvalidField(name.Value!, value.Value!, message.Value!); + var invalidField = new InvalidField(); + invalidField.Message = message.Value!; + invalidField.Name = name.Value!; + invalidField.Value = value.Value!; + return invalidField; } /// @@ -186,14 +179,14 @@ public override void Write(Utf8JsonWriter writer, InvalidField invalidField, Jso public void WriteProperties(Utf8JsonWriter writer, InvalidField invalidField, JsonSerializerOptions jsonSerializerOptions) { + if (invalidField.Message != null) + writer.WriteString("message", invalidField.Message); + if (invalidField.Name != null) writer.WriteString("name", invalidField.Name); if (invalidField.Value != null) writer.WriteString("value", invalidField.Value); - - if (invalidField.Message != null) - writer.WriteString("message", invalidField.Message); } } } diff --git a/Adyen/Capital/Models/NOLocalAccountIdentification.cs b/Adyen/Capital/Models/NOLocalAccountIdentification.cs index 946224063..f7c83a1ae 100644 --- a/Adyen/Capital/Models/NOLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/NOLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,20 +37,10 @@ public partial class NOLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 11-digit bank account number, without separators or whitespace. - [JsonConstructor] - public NOLocalAccountIdentification(string accountNumber) : base() + public NOLocalAccountIdentification() : base() { - AccountNumber = accountNumber; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public NOLocalAccountIdentification() - { - } partial void OnCreated(); @@ -131,7 +124,9 @@ public override NOLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class NOLocalAccountIdentification.", nameof(type)); - return new NOLocalAccountIdentification(accountNumber.Value!); + var nOLocalAccountIdentification = new NOLocalAccountIdentification(); + nOLocalAccountIdentification.AccountNumber = accountNumber.Value!; + return nOLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/NZLocalAccountIdentification.cs b/Adyen/Capital/Models/NZLocalAccountIdentification.cs index 80edacb3c..0314ba580 100644 --- a/Adyen/Capital/Models/NZLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/NZLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,20 +37,10 @@ public partial class NZLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. - [JsonConstructor] - public NZLocalAccountIdentification(string accountNumber) : base() + public NZLocalAccountIdentification() : base() { - AccountNumber = accountNumber; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public NZLocalAccountIdentification() - { - } partial void OnCreated(); @@ -131,7 +124,9 @@ public override NZLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class NZLocalAccountIdentification.", nameof(type)); - return new NZLocalAccountIdentification(accountNumber.Value!); + var nZLocalAccountIdentification = new NZLocalAccountIdentification(); + nZLocalAccountIdentification.AccountNumber = accountNumber.Value!; + return nZLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/NumberAndBicAccountIdentification.cs b/Adyen/Capital/Models/NumberAndBicAccountIdentification.cs index 42172551d..0848a592a 100644 --- a/Adyen/Capital/Models/NumberAndBicAccountIdentification.cs +++ b/Adyen/Capital/Models/NumberAndBicAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,24 +37,10 @@ public partial class NumberAndBicAccountIdentification : BankAccountIdentificati /// /// Initializes a new instance of the class. /// - /// The bank account number, without separators or whitespace. The length and format depends on the bank or country. - /// The bank's 8- or 11-character BIC or SWIFT code. - /// additionalBankIdentification - [JsonConstructor] - public NumberAndBicAccountIdentification(string accountNumber, string bic, Option additionalBankIdentification = default) : base() + public NumberAndBicAccountIdentification() : base() { - AccountNumber = accountNumber; - Bic = bic; - _AdditionalBankIdentificationOption = additionalBankIdentification; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public NumberAndBicAccountIdentification() - { - } partial void OnCreated(); @@ -168,7 +157,12 @@ public override NumberAndBicAccountIdentification Read(ref Utf8JsonReader utf8Js if (!type.IsSet) throw new ArgumentException("Property is required for class NumberAndBicAccountIdentification.", nameof(type)); - return new NumberAndBicAccountIdentification(accountNumber.Value!, bic.Value!, additionalBankIdentification); + var numberAndBicAccountIdentification = new NumberAndBicAccountIdentification(); + numberAndBicAccountIdentification.AccountNumber = accountNumber.Value!; + numberAndBicAccountIdentification.Bic = bic.Value!; + if (additionalBankIdentification.IsSet) + numberAndBicAccountIdentification.AdditionalBankIdentification = additionalBankIdentification.Value; + return numberAndBicAccountIdentification; } /// diff --git a/Adyen/Capital/Models/PLLocalAccountIdentification.cs b/Adyen/Capital/Models/PLLocalAccountIdentification.cs index 245967f70..fd62c49b1 100644 --- a/Adyen/Capital/Models/PLLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/PLLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,20 +37,10 @@ public partial class PLLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace. - [JsonConstructor] - public PLLocalAccountIdentification(string accountNumber) : base() + public PLLocalAccountIdentification() : base() { - AccountNumber = accountNumber; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public PLLocalAccountIdentification() - { - } partial void OnCreated(); @@ -131,7 +124,9 @@ public override PLLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class PLLocalAccountIdentification.", nameof(type)); - return new PLLocalAccountIdentification(accountNumber.Value!); + var pLLocalAccountIdentification = new PLLocalAccountIdentification(); + pLLocalAccountIdentification.AccountNumber = accountNumber.Value!; + return pLLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/Repayment.cs b/Adyen/Capital/Models/Repayment.cs index 80e02b0be..6847fddbc 100644 --- a/Adyen/Capital/Models/Repayment.cs +++ b/Adyen/Capital/Models/Repayment.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,23 +37,9 @@ public partial class Repayment /// /// Initializes a new instance of the class. /// - /// The percentage of your user's incoming net volume that is deducted for repaying the grant. The percentage expressed in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - /// term - /// threshold - [JsonConstructor] - public Repayment(int basisPoints, Option term = default, Option threshold = default) - { - BasisPoints = basisPoints; - _TermOption = term; - _ThresholdOption = threshold; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Repayment() { + OnCreated(); } partial void OnCreated(); @@ -163,7 +152,13 @@ public override Repayment Read(ref Utf8JsonReader utf8JsonReader, Type typeToCon if (!basisPoints.IsSet) throw new ArgumentException("Property is required for class Repayment.", nameof(basisPoints)); - return new Repayment(basisPoints.Value!.Value!, term, threshold); + var repayment = new Repayment(); + repayment.BasisPoints = basisPoints.Value!.Value; + if (term.IsSet) + repayment.Term = term.Value; + if (threshold.IsSet) + repayment.Threshold = threshold.Value; + return repayment; } /// diff --git a/Adyen/Capital/Models/RepaymentTerm.cs b/Adyen/Capital/Models/RepaymentTerm.cs index 9d63eb5f6..74a695483 100644 --- a/Adyen/Capital/Models/RepaymentTerm.cs +++ b/Adyen/Capital/Models/RepaymentTerm.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class RepaymentTerm /// /// Initializes a new instance of the class. /// - /// The estimated duration of the repayment term, in days. - /// The maximum duration of the repayment term, in days. Only applies when `contractType` is **loan**. - [JsonConstructor] - public RepaymentTerm(int estimatedDays, Option maximumDays = default) - { - EstimatedDays = estimatedDays; - _MaximumDaysOption = maximumDays; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public RepaymentTerm() { + OnCreated(); } partial void OnCreated(); @@ -144,7 +135,11 @@ public override RepaymentTerm Read(ref Utf8JsonReader utf8JsonReader, Type typeT if (!estimatedDays.IsSet) throw new ArgumentException("Property is required for class RepaymentTerm.", nameof(estimatedDays)); - return new RepaymentTerm(estimatedDays.Value!.Value!, maximumDays); + var repaymentTerm = new RepaymentTerm(); + repaymentTerm.EstimatedDays = estimatedDays.Value!.Value; + if (maximumDays.IsSet) + repaymentTerm.MaximumDays = maximumDays.Value; + return repaymentTerm; } /// @@ -176,7 +171,8 @@ public void WriteProperties(Utf8JsonWriter writer, RepaymentTerm repaymentTerm, writer.WriteNumber("estimatedDays", repaymentTerm.EstimatedDays); if (repaymentTerm._MaximumDaysOption.IsSet) - writer.WriteNumber("maximumDays", repaymentTerm._MaximumDaysOption.Value!.Value); + if (repaymentTerm._MaximumDaysOption.Value != null) + writer.WriteNumber("maximumDays", repaymentTerm._MaximumDaysOption.Value!.Value); } } } diff --git a/Adyen/Capital/Models/SELocalAccountIdentification.cs b/Adyen/Capital/Models/SELocalAccountIdentification.cs index 5613acc63..5cba7d604 100644 --- a/Adyen/Capital/Models/SELocalAccountIdentification.cs +++ b/Adyen/Capital/Models/SELocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,22 +37,10 @@ public partial class SELocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace. - /// The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. - [JsonConstructor] - public SELocalAccountIdentification(string accountNumber, string clearingNumber) : base() + public SELocalAccountIdentification() : base() { - AccountNumber = accountNumber; - ClearingNumber = clearingNumber; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public SELocalAccountIdentification() - { - } partial void OnCreated(); @@ -148,7 +139,10 @@ public override SELocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class SELocalAccountIdentification.", nameof(type)); - return new SELocalAccountIdentification(accountNumber.Value!, clearingNumber.Value!); + var sELocalAccountIdentification = new SELocalAccountIdentification(); + sELocalAccountIdentification.AccountNumber = accountNumber.Value!; + sELocalAccountIdentification.ClearingNumber = clearingNumber.Value!; + return sELocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/SGLocalAccountIdentification.cs b/Adyen/Capital/Models/SGLocalAccountIdentification.cs index 15672fdda..81f0566e4 100644 --- a/Adyen/Capital/Models/SGLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/SGLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,22 +37,10 @@ public partial class SGLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 4- to 19-digit bank account number, without separators or whitespace. - /// The bank's 8- or 11-character BIC or SWIFT code. - [JsonConstructor] - public SGLocalAccountIdentification(string accountNumber, string bic) : base() + public SGLocalAccountIdentification() : base() { - AccountNumber = accountNumber; - Bic = bic; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public SGLocalAccountIdentification() - { - } partial void OnCreated(); @@ -145,7 +136,10 @@ public override SGLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!bic.IsSet) throw new ArgumentException("Property is required for class SGLocalAccountIdentification.", nameof(bic)); - return new SGLocalAccountIdentification(accountNumber.Value!, bic.Value!); + var sGLocalAccountIdentification = new SGLocalAccountIdentification(); + sGLocalAccountIdentification.AccountNumber = accountNumber.Value!; + sGLocalAccountIdentification.Bic = bic.Value!; + return sGLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/Status.cs b/Adyen/Capital/Models/Status.cs index e8684cf24..a9b6d3257 100644 --- a/Adyen/Capital/Models/Status.cs +++ b/Adyen/Capital/Models/Status.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,21 +37,9 @@ public partial class Status /// /// Initializes a new instance of the class. /// - /// The code for the status of the grant. Possible values: - **Pending** - **Active** - **Repaid** - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Reviewing** - **Approved** - **Rejected** - **Cancelled** - /// A list of actions that need to be completed to proceed with the grant. - [JsonConstructor] - public Status(CodeEnum code, Option?> actions = default) - { - Code = code; - _ActionsOption = actions; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public Status() { + OnCreated(); } partial void OnCreated(); @@ -136,17 +127,32 @@ private CodeEnum(string? value) /// Converts a instance to a string implicitly. /// /// The instance. Default to null. - /// String value of the instance./// + /// String value of the instance. public static implicit operator string?(CodeEnum? option) => option?.Value; + /// + /// Compares two instances for equality. + /// public static bool operator ==(CodeEnum? left, CodeEnum? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - + + /// + /// Compares two instances for inequality. + /// public static bool operator !=(CodeEnum? left, CodeEnum? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + /// + /// Returns true if the given object is equal to this instance. + /// public override bool Equals(object? obj) => obj is CodeEnum other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); - + + /// + /// Returns a hash code for this instance. + /// public override int GetHashCode() => Value?.GetHashCode() ?? 0; - + + /// + /// Returns the string value of the instance. + /// public override string ToString() => Value ?? string.Empty; /// @@ -177,7 +183,6 @@ private CodeEnum(string? value) /// /// /// String value of the enum. - /// public static string? ToJsonValue(CodeEnum? value) { if (value == null) @@ -216,7 +221,7 @@ private CodeEnum(string? value) if (value == CodeEnum.Cancelled) return "Cancelled"; - return null; + return value.Value; } /// @@ -224,12 +229,18 @@ private CodeEnum(string? value) /// public class CodeEnumJsonConverter : JsonConverter { + /// + /// Deserializes a from JSON. + /// public override CodeEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions jsonOptions) { string value = reader.GetString(); return value == null ? null : CodeEnum.FromStringOrDefault(value) ?? new CodeEnum(value); } + /// + /// Serializes a to JSON. + /// public override void Write(Utf8JsonWriter writer, CodeEnum value, JsonSerializerOptions jsonOptions) { writer.WriteStringValue(CodeEnum.ToJsonValue(value)); @@ -315,7 +326,7 @@ public override Status Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver { case "code": string? codeRawValue = utf8JsonReader.GetString(); - code = new Option(Status.CodeEnum.FromStringOrDefault(codeRawValue)); + code = new Option(Status.CodeEnum.FromStringOrDefault(codeRawValue) ?? (Status.CodeEnum)codeRawValue); break; case "actions": actions = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); @@ -329,7 +340,11 @@ public override Status Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver if (!code.IsSet) throw new ArgumentException("Property is required for class Status.", nameof(code)); - return new Status(code.Value!.Value!, actions); + var status = new Status(); + status.Code = code.Value!; + if (actions.IsSet) + status.Actions = actions.Value; + return status; } /// diff --git a/Adyen/Capital/Models/ThresholdRepayment.cs b/Adyen/Capital/Models/ThresholdRepayment.cs index 579b47b71..0003eaf8a 100644 --- a/Adyen/Capital/Models/ThresholdRepayment.cs +++ b/Adyen/Capital/Models/ThresholdRepayment.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,19 +37,9 @@ public partial class ThresholdRepayment /// /// Initializes a new instance of the class. /// - /// amount - [JsonConstructor] - public ThresholdRepayment(Amount amount) - { - Amount = amount; - OnCreated(); - } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// public ThresholdRepayment() { + OnCreated(); } partial void OnCreated(); @@ -122,7 +115,9 @@ public override ThresholdRepayment Read(ref Utf8JsonReader utf8JsonReader, Type if (!amount.IsSet) throw new ArgumentException("Property is required for class ThresholdRepayment.", nameof(amount)); - return new ThresholdRepayment(amount.Value!); + var thresholdRepayment = new ThresholdRepayment(); + thresholdRepayment.Amount = amount.Value!; + return thresholdRepayment; } /// diff --git a/Adyen/Capital/Models/UKLocalAccountIdentification.cs b/Adyen/Capital/Models/UKLocalAccountIdentification.cs index c9262fa4e..7fb5865fd 100644 --- a/Adyen/Capital/Models/UKLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/UKLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,22 +37,10 @@ public partial class UKLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The 8-digit bank account number, without separators or whitespace. - /// The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. - [JsonConstructor] - public UKLocalAccountIdentification(string accountNumber, string sortCode) : base() + public UKLocalAccountIdentification() : base() { - AccountNumber = accountNumber; - SortCode = sortCode; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public UKLocalAccountIdentification() - { - } partial void OnCreated(); @@ -148,7 +139,10 @@ public override UKLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class UKLocalAccountIdentification.", nameof(type)); - return new UKLocalAccountIdentification(accountNumber.Value!, sortCode.Value!); + var uKLocalAccountIdentification = new UKLocalAccountIdentification(); + uKLocalAccountIdentification.AccountNumber = accountNumber.Value!; + uKLocalAccountIdentification.SortCode = sortCode.Value!; + return uKLocalAccountIdentification; } /// diff --git a/Adyen/Capital/Models/USLocalAccountIdentification.cs b/Adyen/Capital/Models/USLocalAccountIdentification.cs index e695821d4..ada666bd3 100644 --- a/Adyen/Capital/Models/USLocalAccountIdentification.cs +++ b/Adyen/Capital/Models/USLocalAccountIdentification.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -34,24 +37,10 @@ public partial class USLocalAccountIdentification : BankAccountIdentification /// /// Initializes a new instance of the class. /// - /// The bank account number, without separators or whitespace. - /// The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. - /// accountType - [JsonConstructor] - public USLocalAccountIdentification(string accountNumber, string routingNumber, Option accountType = default) : base() + public USLocalAccountIdentification() : base() { - AccountNumber = accountNumber; - RoutingNumber = routingNumber; - _AccountTypeOption = accountType; OnCreated(); } - - /// - /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. - /// - public USLocalAccountIdentification() - { - } partial void OnCreated(); @@ -152,8 +141,7 @@ public override USLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea break; case "accountType": string? accountTypeRawValue = utf8JsonReader.GetString(); - if (accountTypeRawValue != null) - accountType = new Option(USLocalBankAccountTypeValueConverter.FromStringOrDefault(accountTypeRawValue)); + accountType = new Option(USLocalBankAccountType.FromStringOrDefault(accountTypeRawValue) ?? (USLocalBankAccountType)accountTypeRawValue); break; default: break; @@ -170,7 +158,12 @@ public override USLocalAccountIdentification Read(ref Utf8JsonReader utf8JsonRea if (!type.IsSet) throw new ArgumentException("Property is required for class USLocalAccountIdentification.", nameof(type)); - return new USLocalAccountIdentification(accountNumber.Value!, routingNumber.Value!, accountType); + var uSLocalAccountIdentification = new USLocalAccountIdentification(); + uSLocalAccountIdentification.AccountNumber = accountNumber.Value!; + uSLocalAccountIdentification.RoutingNumber = routingNumber.Value!; + if (accountType.IsSet) + uSLocalAccountIdentification.AccountType = accountType.Value; + return uSLocalAccountIdentification; } /// @@ -210,7 +203,7 @@ public void WriteProperties(Utf8JsonWriter writer, USLocalAccountIdentification if (uSLocalAccountIdentification._AccountTypeOption.IsSet) { - var accountTypeRawValue = USLocalBankAccountTypeValueConverter.ToJsonValue(uSLocalAccountIdentification.AccountType!.Value); + var accountTypeRawValue = USLocalBankAccountType.ToJsonValue(uSLocalAccountIdentification.AccountType); writer.WriteString("accountType", accountTypeRawValue); } } diff --git a/Adyen/Capital/Models/USLocalBankAccountType.cs b/Adyen/Capital/Models/USLocalBankAccountType.cs index f2a1ac1e1..d7b29d195 100644 --- a/Adyen/Capital/Models/USLocalBankAccountType.cs +++ b/Adyen/Capital/Models/USLocalBankAccountType.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -29,148 +32,117 @@ namespace Adyen.Capital.Models /// /// Defines USLocalBankAccountType /// - public enum USLocalBankAccountType + [JsonConverter(typeof(USLocalBankAccountType.USLocalBankAccountTypeJsonConverter))] + public class USLocalBankAccountType : IEnum { /// - /// Enum Checking for value: checking + /// Returns the value of the USLocalBankAccountType. /// - Checking = 1, + public string? Value { get; set; } /// - /// Enum Savings for value: savings + /// USLocalBankAccountType.Checking - checking /// - Savings = 2 - } + public static readonly USLocalBankAccountType Checking = new("checking"); - /// - /// Converts to and from the JSON value - /// - public static class USLocalBankAccountTypeValueConverter - { /// - /// Parses a given value to + /// USLocalBankAccountType.Savings - savings /// - /// - /// - public static USLocalBankAccountType FromString(string value) - { - if (value.Equals("checking")) - return USLocalBankAccountType.Checking; + public static readonly USLocalBankAccountType Savings = new("savings"); - if (value.Equals("savings")) - return USLocalBankAccountType.Savings; - - throw new NotImplementedException($"Could not convert value to type USLocalBankAccountType: '{value}'"); + private USLocalBankAccountType(string? value) + { + Value = value; } /// - /// Parses a given value to + /// Converts a string to a implicitly. /// - /// - /// - public static USLocalBankAccountType? FromStringOrDefault(string value) - { - if (value.Equals("checking")) - return USLocalBankAccountType.Checking; - - if (value.Equals("savings")) - return USLocalBankAccountType.Savings; - - return null; - } + public static implicit operator USLocalBankAccountType?(string? value) => value == null ? null : new USLocalBankAccountType(value); /// - /// Converts the to the json value + /// Converts a instance to a string implicitly. /// - /// - /// - /// - public static string ToJsonValue(USLocalBankAccountType value) - { - if (value == USLocalBankAccountType.Checking) - return "checking"; - - if (value == USLocalBankAccountType.Savings) - return "savings"; + public static implicit operator string?(USLocalBankAccountType? option) => option?.Value; - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - } + /// + /// Compares two instances for equality. + /// + public static bool operator ==(USLocalBankAccountType? left, USLocalBankAccountType? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - /// - /// A Json converter for type - /// - /// - public class USLocalBankAccountTypeJsonConverter : JsonConverter - { /// - /// Returns a from the Json object + /// Compares two instances for inequality. /// - /// - /// - /// - /// - public override USLocalBankAccountType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string? rawValue = reader.GetString(); + public static bool operator !=(USLocalBankAccountType? left, USLocalBankAccountType? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); - USLocalBankAccountType? result = rawValue == null - ? null - : USLocalBankAccountTypeValueConverter.FromStringOrDefault(rawValue); + /// + /// Returns true if the given object is equal to this instance. + /// + public override bool Equals(object? obj) => obj is USLocalBankAccountType other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); - if (result != null) - return result.Value; + /// + /// Returns a hash code for this instance. + /// + public override int GetHashCode() => Value?.GetHashCode() ?? 0; - throw new JsonException(); - } + /// + /// Returns the string value of the instance. + /// + public override string ToString() => Value ?? string.Empty; /// - /// Writes the USLocalBankAccountType to the json writer + /// Returns a , or null if the value is not recognized. /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, USLocalBankAccountType uSLocalBankAccountType, JsonSerializerOptions options) + public static USLocalBankAccountType? FromStringOrDefault(string? value) { - writer.WriteStringValue(USLocalBankAccountTypeValueConverter.ToJsonValue(uSLocalBankAccountType).ToString()); + return value switch { + "checking" => USLocalBankAccountType.Checking, + "savings" => USLocalBankAccountType.Savings, + _ => null, + }; } - } - /// - /// A Json converter for type - /// - public class USLocalBankAccountTypeNullableJsonConverter : JsonConverter - { /// - /// Returns a USLocalBankAccountType from the Json object + /// Converts the to the json value. + /// Returns the raw string value, preserving unknown values for round-trip safety. /// - /// - /// - /// - /// - public override USLocalBankAccountType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public static string? ToJsonValue(USLocalBankAccountType? value) { - string? rawValue = reader.GetString(); + if (value == null) + return null; - USLocalBankAccountType? result = rawValue == null - ? null - : USLocalBankAccountTypeValueConverter.FromStringOrDefault(rawValue); + if (value == USLocalBankAccountType.Checking) + return "checking"; - if (result != null) - return result.Value; + if (value == USLocalBankAccountType.Savings) + return "savings"; - throw new JsonException(); + return value.Value; } /// - /// Writes the USLocalBankAccountType to the json writer + /// JsonConverter for . + /// Preserves unknown values instead of throwing an exception. /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, USLocalBankAccountType? uSLocalBankAccountType, JsonSerializerOptions options) + public class USLocalBankAccountTypeJsonConverter : JsonConverter { - writer.WriteStringValue(uSLocalBankAccountType.HasValue ? USLocalBankAccountTypeValueConverter.ToJsonValue(uSLocalBankAccountType.Value).ToString() : "null"); + /// + /// Deserializes a from JSON. + /// Unknown values are preserved as-is rather than throwing an exception. + /// + public override USLocalBankAccountType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string? rawValue = reader.GetString(); + return rawValue == null ? null : USLocalBankAccountType.FromStringOrDefault(rawValue) ?? new USLocalBankAccountType(rawValue); + } + + /// + /// Serializes a to JSON. + /// + public override void Write(Utf8JsonWriter writer, USLocalBankAccountType value, JsonSerializerOptions options) + { + writer.WriteStringValue(USLocalBankAccountType.ToJsonValue(value)); + } } } } diff --git a/Adyen/Capital/Services/DynamicOffersService.cs b/Adyen/Capital/Services/DynamicOffersService.cs new file mode 100644 index 000000000..108e05783 --- /dev/null +++ b/Adyen/Capital/Services/DynamicOffersService.cs @@ -0,0 +1,927 @@ +// +/* + * Capital API + * + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * + * The version of the OpenAPI document: 1 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Core; +using Adyen.Core.Auth; +using Adyen.Core.Client; +using Adyen.Core.Client.Extensions; +using Adyen.Core.Options; +using Adyen.Capital.Client; +using Adyen.Capital.Models; +using System.Diagnostics.CodeAnalysis; + +namespace Adyen.Capital.Services +{ + /// + /// Represents a collection of functions to interact with the API endpoints. + /// This class is registered as transient. + /// + public interface IDynamicOffersService : IAdyenApiService + { + /// + /// The class containing the events. + /// + DynamicOffersServiceEvents? Events { get; } + + /// + /// Calculate a preliminary offer for a selected financing amount + /// + /// + /// Calculates a preliminary offer for the financing amount that the user selected from a [dynamic offer](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/). The preliminary offer is for informational purposes only and cannot be used to initiate a grant. Requests to this endpoint are subject to rate limits: - Live environments: 120 requests per minute. - Test environments: 120 requests per minute. + /// + /// Thrown when fails to make API call. + /// The unique identifier of the dynamic offer from which the user selected the financing amount. + /// + /// . + /// . + /// of . + Task CalculatePreliminaryOfferFromDynamicOfferAsync(string id, CalculateGrantOfferRequest calculateGrantOfferRequest, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create a static offer for a selected financing amount + /// + /// + /// Creates a static offer for the financing amount that the user selected from the [dynamic offer](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/). Requests to this endpoint are subject to rate limits: - Live environments: 30 requests per minute. - Test environments: 30 requests per minute. + /// + /// Thrown when fails to make API call. + /// The unique identifier of the dynamic offer from which the user selected the financing amount. + /// + /// . + /// . + /// of . + Task CreateStaticOfferFromDynamicOfferAsync(string id, CreateGrantOfferRequest createGrantOfferRequest, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get all available dynamic offers + /// + /// + /// Returns a list of all [dynamic offers](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/) available for `accountHolderId` specified as a query parameter. + /// + /// Thrown when fails to make API call. + /// The unique identifier of the account holder that the dynamic offer is for. + /// The type of financing that the offer is for. If the value is not specified, returns all available types. Possible values: **businessFinancing** + /// . + /// . + /// of . + Task GetAllDynamicOffersAsync(string accountHolderId, Option financingType = default, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default); + + } + + /// + /// The , wraps . + /// + public interface ICalculatePreliminaryOfferFromDynamicOfferApiResponse : Adyen.Core.Client.IApiResponse, IOk, IUnprocessableContent + { + /// + /// Returns true if the response is 200 Ok. + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent. + /// + /// + bool IsUnprocessableContent { get; } + } + + /// + /// The , wraps . + /// + public interface ICreateStaticOfferFromDynamicOfferApiResponse : Adyen.Core.Client.IApiResponse, IOk, IUnprocessableContent + { + /// + /// Returns true if the response is 200 Ok. + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent. + /// + /// + bool IsUnprocessableContent { get; } + } + + /// + /// The , wraps . + /// + public interface IGetAllDynamicOffersApiResponse : Adyen.Core.Client.IApiResponse, IOk, IUnprocessableContent + { + /// + /// Returns true if the response is 200 Ok. + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent. + /// + /// + bool IsUnprocessableContent { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints. + /// + public class DynamicOffersServiceEvents + { + /// + /// The event raised after the server response. + /// + public event EventHandler? OnCalculatePreliminaryOfferFromDynamicOffer; + + /// + /// The event raised after an error querying the server. + /// + public event EventHandler? OnErrorCalculatePreliminaryOfferFromDynamicOffer; + + internal void ExecuteOnCalculatePreliminaryOfferFromDynamicOffer(DynamicOffersService.CalculatePreliminaryOfferFromDynamicOfferApiResponse apiResponse) + { + OnCalculatePreliminaryOfferFromDynamicOffer?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCalculatePreliminaryOfferFromDynamicOffer(Exception exception) + { + OnErrorCalculatePreliminaryOfferFromDynamicOffer?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response. + /// + public event EventHandler? OnCreateStaticOfferFromDynamicOffer; + + /// + /// The event raised after an error querying the server. + /// + public event EventHandler? OnErrorCreateStaticOfferFromDynamicOffer; + + internal void ExecuteOnCreateStaticOfferFromDynamicOffer(DynamicOffersService.CreateStaticOfferFromDynamicOfferApiResponse apiResponse) + { + OnCreateStaticOfferFromDynamicOffer?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateStaticOfferFromDynamicOffer(Exception exception) + { + OnErrorCreateStaticOfferFromDynamicOffer?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response. + /// + public event EventHandler? OnGetAllDynamicOffers; + + /// + /// The event raised after an error querying the server. + /// + public event EventHandler? OnErrorGetAllDynamicOffers; + + internal void ExecuteOnGetAllDynamicOffers(DynamicOffersService.GetAllDynamicOffersApiResponse apiResponse) + { + OnGetAllDynamicOffers?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetAllDynamicOffers(Exception exception) + { + OnErrorGetAllDynamicOffers?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints. + /// + public sealed partial class DynamicOffersService : IDynamicOffersService + { + + /// + /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. + /// This value will be used to construct the URL in based on the Environment value set in . + /// + private const string BASE_URL = "https://balanceplatform-api-test.adyen.com/capital/v1"; + + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory. + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger. + /// + public ILogger Logger { get; } + + /// + /// The HttpClient. + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events. + /// + public DynamicOffersServiceEvents? Events { get; } + + /// + /// A token provider of type . + /// + public ITokenProvider ApiKeyProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + public DynamicOffersService(AdyenOptionsProvider adyenOptionsProvider, ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, ITokenProvider apiKeyProvider, DynamicOffersServiceEvents dynamicOffersServiceEvents = null) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = logger ?? Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance; + // Set BaseAddress if it's not set. + if (httpClient.BaseAddress == null) + httpClient.BaseAddress = new Uri(UrlBuilderExtensions.ConstructHostUrl(adyenOptionsProvider.Options, BASE_URL)); + HttpClient = httpClient; + Events = dynamicOffersServiceEvents; + ApiKeyProvider = apiKeyProvider; + } + + /// + /// Calculate a preliminary offer for a selected financing amount Calculates a preliminary offer for the financing amount that the user selected from a [dynamic offer](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/). The preliminary offer is for informational purposes only and cannot be used to initiate a grant. Requests to this endpoint are subject to rate limits: - Live environments: 120 requests per minute. - Test environments: 120 requests per minute. + /// + /// Thrown when fails to make API call. + /// The unique identifier of the dynamic offer from which the user selected the financing amount. + /// () + /// . + /// . + /// of - If 200 OK response, wraps the when `TryDeserializeOk(...)` is called. + public async Task CalculatePreliminaryOfferFromDynamicOfferAsync(string id, CalculateGrantOfferRequest calculateGrantOfferRequest, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilder = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessage = new HttpRequestMessage()) + { + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Port = HttpClient.BaseAddress.Port; + uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilder.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "/dynamicOffers/{id}/calculate" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "/dynamicOffers/{id}/calculate"); + uriBuilder.Path = uriBuilder.Path.Replace("%7Bid%7D", Uri.EscapeDataString(id.ToString())); + + // Adds headers to the HttpRequestMessage header, these can be set in the RequestOptions (Idempotency-Key etc.) + requestOptions?.AddHeadersToHttpRequestMessage(httpRequestMessage); + httpRequestMessage.Content = (calculateGrantOfferRequest as object) is System.IO.Stream stream + ? httpRequestMessage.Content = new StreamContent(stream) + : httpRequestMessage.Content = new StringContent(JsonSerializer.Serialize(calculateGrantOfferRequest, _jsonSerializerOptions)); + httpRequestMessage.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + httpRequestMessage.AddUserAgentToHeaders(); + httpRequestMessage.AddLibraryNameToHeader(); + httpRequestMessage.AddLibraryVersionToHeader(); + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null && httpRequestMessage.Content != null) + httpRequestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + httpRequestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); +#if NET462 || NETSTANDARD2_0 + httpRequestMessage.Method = new HttpMethod("POST"); +#else + httpRequestMessage.Method = HttpMethod.Post; +#endif + + DateTime requestedAt = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessage = await HttpClient.SendAsync(httpRequestMessage, cancellationToken).ConfigureAwait(false)) + { + ILogger apiResponseLogger = LoggerFactory.CreateLogger(); + CalculatePreliminaryOfferFromDynamicOfferApiResponse apiResponse; + + switch ((int)httpResponseMessage.StatusCode) { + default: { +#if NET462 || NETSTANDARD2_0 + // `HttpContent.ReadAsStringAsync(cancellationToken)` doesn't exist in .NET Standard 2.0. Instead, we cancel one-level above in `HttpClient.SendAsync(httpRequestMessage, cancellationToken)`. + string responseContent = await httpResponseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); +#else + string responseContent = await httpResponseMessage.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); +#endif + apiResponse = new(apiResponseLogger, httpRequestMessage, httpResponseMessage, responseContent, "/dynamicOffers/{id}/calculate", requestedAt, _jsonSerializerOptions); + + break; + } + } + + Events?.ExecuteOnCalculatePreliminaryOfferFromDynamicOffer(apiResponse); + return apiResponse; + } + } + } + catch(Exception exception) + { + Events?.ExecuteOnErrorCalculatePreliminaryOfferFromDynamicOffer(exception); + throw; + } + } + + /// + /// The . + /// + public partial class CalculatePreliminaryOfferFromDynamicOfferApiResponse : Adyen.Core.Client.ApiResponse, ICalculatePreliminaryOfferFromDynamicOfferApiResponse + { + /// + /// The logger for . + /// + public ILogger Logger { get; } + + /// + /// The . + /// + /// . + /// . + /// . + /// The raw data. + /// The path used when making the request. + /// The DateTime.UtcNow when the request was retrieved. + /// + public CalculatePreliminaryOfferFromDynamicOfferApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The . + /// + /// . + /// . + /// . + /// The raw binary stream (only set for binary responses). + /// The path used when making the request. + /// The DateTime.UtcNow when the request was retrieved. + /// + public CalculatePreliminaryOfferFromDynamicOfferApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok. + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok. + /// + /// + public Adyen.Capital.Models.CalculatedGrantOffer? Ok() + { + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null. + /// + /// + /// + public bool TryDeserializeOkResponse([NotNullWhen(true)]out Adyen.Capital.Models.CalculatedGrantOffer? result) + { + result = null; + + try + { + result = Ok(); + } + catch (Exception exception) + { + OnDeserializationError(exception, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent. + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent. + /// + /// + public Adyen.Capital.Models.DefaultErrorResponseEntity? UnprocessableContent() + { + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null. + /// + /// + /// + public bool TryDeserializeUnprocessableContentResponse([NotNullWhen(true)]out Adyen.Capital.Models.DefaultErrorResponseEntity? result) + { + result = null; + + try + { + result = UnprocessableContent(); + } + catch (Exception exception) + { + OnDeserializationError(exception, (HttpStatusCode)422); + } + + return result != null; + } + + private void OnDeserializationError(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Create a static offer for a selected financing amount Creates a static offer for the financing amount that the user selected from the [dynamic offer](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/). Requests to this endpoint are subject to rate limits: - Live environments: 30 requests per minute. - Test environments: 30 requests per minute. + /// + /// Thrown when fails to make API call. + /// The unique identifier of the dynamic offer from which the user selected the financing amount. + /// () + /// . + /// . + /// of - If 200 OK response, wraps the when `TryDeserializeOk(...)` is called. + public async Task CreateStaticOfferFromDynamicOfferAsync(string id, CreateGrantOfferRequest createGrantOfferRequest, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilder = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessage = new HttpRequestMessage()) + { + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Port = HttpClient.BaseAddress.Port; + uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilder.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "/dynamicOffers/{id}/grantOffer" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "/dynamicOffers/{id}/grantOffer"); + uriBuilder.Path = uriBuilder.Path.Replace("%7Bid%7D", Uri.EscapeDataString(id.ToString())); + + // Adds headers to the HttpRequestMessage header, these can be set in the RequestOptions (Idempotency-Key etc.) + requestOptions?.AddHeadersToHttpRequestMessage(httpRequestMessage); + httpRequestMessage.Content = (createGrantOfferRequest as object) is System.IO.Stream stream + ? httpRequestMessage.Content = new StreamContent(stream) + : httpRequestMessage.Content = new StringContent(JsonSerializer.Serialize(createGrantOfferRequest, _jsonSerializerOptions)); + httpRequestMessage.RequestUri = uriBuilder.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + httpRequestMessage.AddUserAgentToHeaders(); + httpRequestMessage.AddLibraryNameToHeader(); + httpRequestMessage.AddLibraryVersionToHeader(); + + string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null && httpRequestMessage.Content != null) + httpRequestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + httpRequestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); +#if NET462 || NETSTANDARD2_0 + httpRequestMessage.Method = new HttpMethod("POST"); +#else + httpRequestMessage.Method = HttpMethod.Post; +#endif + + DateTime requestedAt = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessage = await HttpClient.SendAsync(httpRequestMessage, cancellationToken).ConfigureAwait(false)) + { + ILogger apiResponseLogger = LoggerFactory.CreateLogger(); + CreateStaticOfferFromDynamicOfferApiResponse apiResponse; + + switch ((int)httpResponseMessage.StatusCode) { + default: { +#if NET462 || NETSTANDARD2_0 + // `HttpContent.ReadAsStringAsync(cancellationToken)` doesn't exist in .NET Standard 2.0. Instead, we cancel one-level above in `HttpClient.SendAsync(httpRequestMessage, cancellationToken)`. + string responseContent = await httpResponseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); +#else + string responseContent = await httpResponseMessage.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); +#endif + apiResponse = new(apiResponseLogger, httpRequestMessage, httpResponseMessage, responseContent, "/dynamicOffers/{id}/grantOffer", requestedAt, _jsonSerializerOptions); + + break; + } + } + + Events?.ExecuteOnCreateStaticOfferFromDynamicOffer(apiResponse); + return apiResponse; + } + } + } + catch(Exception exception) + { + Events?.ExecuteOnErrorCreateStaticOfferFromDynamicOffer(exception); + throw; + } + } + + /// + /// The . + /// + public partial class CreateStaticOfferFromDynamicOfferApiResponse : Adyen.Core.Client.ApiResponse, ICreateStaticOfferFromDynamicOfferApiResponse + { + /// + /// The logger for . + /// + public ILogger Logger { get; } + + /// + /// The . + /// + /// . + /// . + /// . + /// The raw data. + /// The path used when making the request. + /// The DateTime.UtcNow when the request was retrieved. + /// + public CreateStaticOfferFromDynamicOfferApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The . + /// + /// . + /// . + /// . + /// The raw binary stream (only set for binary responses). + /// The path used when making the request. + /// The DateTime.UtcNow when the request was retrieved. + /// + public CreateStaticOfferFromDynamicOfferApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok. + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok. + /// + /// + public Adyen.Capital.Models.GrantOffer? Ok() + { + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null. + /// + /// + /// + public bool TryDeserializeOkResponse([NotNullWhen(true)]out Adyen.Capital.Models.GrantOffer? result) + { + result = null; + + try + { + result = Ok(); + } + catch (Exception exception) + { + OnDeserializationError(exception, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent. + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent. + /// + /// + public Adyen.Capital.Models.DefaultErrorResponseEntity? UnprocessableContent() + { + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null. + /// + /// + /// + public bool TryDeserializeUnprocessableContentResponse([NotNullWhen(true)]out Adyen.Capital.Models.DefaultErrorResponseEntity? result) + { + result = null; + + try + { + result = UnprocessableContent(); + } + catch (Exception exception) + { + OnDeserializationError(exception, (HttpStatusCode)422); + } + + return result != null; + } + + private void OnDeserializationError(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Get all available dynamic offers Returns a list of all [dynamic offers](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/) available for `accountHolderId` specified as a query parameter. + /// + /// Thrown when fails to make API call. + /// The unique identifier of the account holder that the dynamic offer is for. + /// The type of financing that the offer is for. If the value is not specified, returns all available types. Possible values: **businessFinancing** () + /// . + /// . + /// of - If 200 OK response, wraps the when `TryDeserializeOk(...)` is called. + public async Task GetAllDynamicOffersAsync(string accountHolderId, Option financingType = default, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilder = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessage = new HttpRequestMessage()) + { + uriBuilder.Host = HttpClient.BaseAddress!.Host; + uriBuilder.Port = HttpClient.BaseAddress.Port; + uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilder.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "/dynamicOffers" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "/dynamicOffers"); + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["accountHolderId"] = ClientUtils.ParameterToString(accountHolderId); + + if (financingType.IsSet) + parseQueryString["financingType"] = ClientUtils.ParameterToString(financingType.Value); + + uriBuilder.Query = ClientUtils.BuildQueryString(parseQueryString); + + // Adds headers to the HttpRequestMessage header, these can be set in the RequestOptions (Idempotency-Key etc.) + requestOptions?.AddHeadersToHttpRequestMessage(httpRequestMessage); + httpRequestMessage.RequestUri = uriBuilder.Uri; + + string[] accepts = new string[] { + "application/json" + }; + + string? accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + httpRequestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); +#if NET462 || NETSTANDARD2_0 + httpRequestMessage.Method = new HttpMethod("GET"); +#else + httpRequestMessage.Method = HttpMethod.Get; +#endif + + DateTime requestedAt = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessage = await HttpClient.SendAsync(httpRequestMessage, cancellationToken).ConfigureAwait(false)) + { + ILogger apiResponseLogger = LoggerFactory.CreateLogger(); + GetAllDynamicOffersApiResponse apiResponse; + + switch ((int)httpResponseMessage.StatusCode) { + default: { +#if NET462 || NETSTANDARD2_0 + // `HttpContent.ReadAsStringAsync(cancellationToken)` doesn't exist in .NET Standard 2.0. Instead, we cancel one-level above in `HttpClient.SendAsync(httpRequestMessage, cancellationToken)`. + string responseContent = await httpResponseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); +#else + string responseContent = await httpResponseMessage.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); +#endif + apiResponse = new(apiResponseLogger, httpRequestMessage, httpResponseMessage, responseContent, "/dynamicOffers", requestedAt, _jsonSerializerOptions); + + break; + } + } + + Events?.ExecuteOnGetAllDynamicOffers(apiResponse); + return apiResponse; + } + } + } + catch(Exception exception) + { + Events?.ExecuteOnErrorGetAllDynamicOffers(exception); + throw; + } + } + + /// + /// The . + /// + public partial class GetAllDynamicOffersApiResponse : Adyen.Core.Client.ApiResponse, IGetAllDynamicOffersApiResponse + { + /// + /// The logger for . + /// + public ILogger Logger { get; } + + /// + /// The . + /// + /// . + /// . + /// . + /// The raw data. + /// The path used when making the request. + /// The DateTime.UtcNow when the request was retrieved. + /// + public GetAllDynamicOffersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The . + /// + /// . + /// . + /// . + /// The raw binary stream (only set for binary responses). + /// The path used when making the request. + /// The DateTime.UtcNow when the request was retrieved. + /// + public GetAllDynamicOffersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok. + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok. + /// + /// + public Adyen.Capital.Models.GetDynamicOffersResponse? Ok() + { + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null. + /// + /// + /// + public bool TryDeserializeOkResponse([NotNullWhen(true)]out Adyen.Capital.Models.GetDynamicOffersResponse? result) + { + result = null; + + try + { + result = Ok(); + } + catch (Exception exception) + { + OnDeserializationError(exception, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent. + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent. + /// + /// + public Adyen.Capital.Models.DefaultErrorResponseEntity? UnprocessableContent() + { + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null. + /// + /// + /// + public bool TryDeserializeUnprocessableContentResponse([NotNullWhen(true)]out Adyen.Capital.Models.DefaultErrorResponseEntity? result) + { + result = null; + + try + { + result = UnprocessableContent(); + } + catch (Exception exception) + { + OnDeserializationError(exception, (HttpStatusCode)422); + } + + return result != null; + } + + private void OnDeserializationError(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + } +} diff --git a/Adyen/Capital/Services/GrantAccountsService.cs b/Adyen/Capital/Services/GrantAccountsService.cs index 67746741c..ce88886fa 100644 --- a/Adyen/Capital/Services/GrantAccountsService.cs +++ b/Adyen/Capital/Services/GrantAccountsService.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable diff --git a/Adyen/Capital/Services/GrantOffersService.cs b/Adyen/Capital/Services/GrantOffersService.cs index 619bc1eef..5b157948d 100644 --- a/Adyen/Capital/Services/GrantOffersService.cs +++ b/Adyen/Capital/Services/GrantOffersService.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -41,26 +44,26 @@ public interface IGrantOffersService : IAdyenApiService GrantOffersServiceEvents? Events { get; } /// - /// Get all available grant offers + /// Get all available static offers /// /// - /// Returns a list of all [grant offers](https://docs.adyen.com/platforms/capital#grant-offers) available for `accountHolderId` specified as a query parameter. + /// Returns a list of all [static offers](https://docs.adyen.com/capital/get-grant-offers/static-offers) available for `accountHolderId` specified as a query parameter. This also includes static offers created for financing amounts that the user selected from [dynamic offers](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/). /// /// Thrown when fails to make API call. - /// The unique identifier of the account holder for which you want to get the available grant offers. + /// The unique identifier of the account holder for which you want to get the available static offers. /// . /// . /// of . - Task GetAllGrantOffersAsync(Option accountHolderId = default, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default); + Task GetAllGrantOffersAsync(string accountHolderId, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default); /// - /// Get the details of a grant offer + /// Get the details of a static offer /// /// - /// Returns the details of the specified grant offer. + /// Returns the details of the specified static offer. /// /// Thrown when fails to make API call. - /// The unique identifier of the grant offer. + /// The unique identifier of the static offer. /// . /// . /// of . @@ -218,14 +221,14 @@ public GrantOffersService(AdyenOptionsProvider adyenOptionsProvider, ILogger - /// Get all available grant offers Returns a list of all [grant offers](https://docs.adyen.com/platforms/capital#grant-offers) available for `accountHolderId` specified as a query parameter. + /// Get all available static offers Returns a list of all [static offers](https://docs.adyen.com/capital/get-grant-offers/static-offers) available for `accountHolderId` specified as a query parameter. This also includes static offers created for financing amounts that the user selected from [dynamic offers](https://docs.adyen.com/capital/get-grant-offers/dynamic-offers/). /// /// Thrown when fails to make API call. - /// The unique identifier of the account holder for which you want to get the available grant offers. () + /// The unique identifier of the account holder for which you want to get the available static offers. /// . /// . /// of - If 200 OK response, wraps the when `TryDeserializeOk(...)` is called. - public async Task GetAllGrantOffersAsync(Option accountHolderId = default, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default) + public async Task GetAllGrantOffersAsync(string accountHolderId, RequestOptions? requestOptions = default, System.Threading.CancellationToken cancellationToken = default) { UriBuilder uriBuilder = new UriBuilder(); @@ -242,10 +245,9 @@ public async Task GetAllGrantOffersAsync(Option - /// Get the details of a grant offer Returns the details of the specified grant offer. + /// Get the details of a static offer Returns the details of the specified static offer. /// /// Thrown when fails to make API call. - /// The unique identifier of the grant offer. + /// The unique identifier of the static offer. /// . /// . /// of - If 200 OK response, wraps the when `TryDeserializeOk(...)` is called. diff --git a/Adyen/Capital/Services/GrantsService.cs b/Adyen/Capital/Services/GrantsService.cs index 95ddffcd9..c572b3797 100644 --- a/Adyen/Capital/Services/GrantsService.cs +++ b/Adyen/Capital/Services/GrantsService.cs @@ -2,11 +2,14 @@ /* * Capital API * - * The Capital API provides endpoints for embedding Adyen Capital into your [marketplace](https://docs.adyen.com/platforms/capital) or [platform](https://docs.adyen.com/platforms/capital). With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available grant offers**: You can get the grant offers that are available for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a grant offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. + * The Capital API provides endpoints for embedding [Adyen Capital](https://docs.adyen.com/capital) into your marketplace or platform. With Capital, you can offer business financing to your users as grants. When a user receives a grant, they must repay the grant amount in a specified term, in addition to paying a fee for using this service. With these endpoints, you can: - **Get available financing offers**: You can get a list of offers with fixed amounts or a range of available financing for your users. Adyen configures the financing amount, the fee, and the repayment conditions for each offer. These configurations are based on proactive risk analyses that Adyen performs on your users. - **Make requests for grants**: When a user selects a financing offer, you can make a request for the grant on their behalf. - **Get information about your grant account**: Your grant account tracks the information of all grants in your marketplace or platform. ## Authentication Each request made to the Capital API must be signed with an API key. Generate an API key in your Customer Area. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Roles and permissions To use the Capital API, your API credential must have the following roles: - **Balance_Platform_Capital_Configuration_Role** - **Balance_Platform_Capital_Grant_Initiation_Role** Reach out to your Adyen contact to set up these roles. ## Going live When going live, generate an API key in your [live Customer Area](https://ca-live.adyen.com/ca). You can then use the API key to send requests to `https://balanceplatform-api-live.adyen.com/capital/v{version}`. * * The version of the OpenAPI document: 1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ #nullable enable @@ -713,7 +716,7 @@ public async Task GetAllGrantsAsync(string counterpart parseQueryString["counterpartyAccountHolderId"] = ClientUtils.ParameterToString(counterpartyAccountHolderId); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilder.Query = ClientUtils.BuildQueryString(parseQueryString); // Adds headers to the HttpRequestMessage header, these can be set in the RequestOptions (Idempotency-Key etc.) requestOptions?.AddHeadersToHttpRequestMessage(httpRequestMessage); diff --git a/sdk-generation-log/capital.json b/sdk-generation-log/capital.json new file mode 100644 index 000000000..be2cdec82 --- /dev/null +++ b/sdk-generation-log/capital.json @@ -0,0 +1,8 @@ +{ + "service": "capital", + "project": "dotnet", + "generatedAt": "2026-05-21T12:55:24Z", + "openapiCommitSha": "e5eedc5cba69416331333d4b0e90cb4871715517", + "automationCommitSha": "6f06b47d0661f0891defe6b85461d2c367fbd284", + "libraryCommitSha": "73a83cb23fb8e432b81d23291bd9be4e7fcc0d2f" +}