diff --git a/.konfig/changesets/smart-lights-laugh.md b/.konfig/changesets/smart-lights-laugh.md new file mode 100644 index 0000000..eb77693 --- /dev/null +++ b/.konfig/changesets/smart-lights-laugh.md @@ -0,0 +1,11 @@ +--- +java: patch +python: patch +typescript: patch +csharp: patch +php: patch +go: patch +phpGuzzle6: patch +--- + +Regenerate SDKs diff --git a/README.md b/README.md index 662ebad..67f8e22 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,5 @@ # splitit-web-sdks -# ⚠️ Warning: Deprecated SDKs - -**⚠️ All SDKs in this repository are fully deprecated as of December 2024.** - -- These SDKs are no longer maintained or supported. -- While they may still function, they will become increasingly out-of-date as Splitit continues to make API updates. -- We strongly recommend migrating to newer solutions to ensure compatibility with the latest API features. - -For more information, please contact [danny@buildwithfern.com](mailto:danny@buildwithfern.com). - |Language|Version|Package Manager|README|Source| |-|-|-|-|-| |Java|3.0.8|[Maven Central](https://central.sonatype.com/artifact/com.konfigthis/splitit-web-java-sdk/3.0.8)|[README](https://github.com/konfig-dev/splitit-web-sdks/tree/HEAD/java#readme)|[Source](https://github.com/konfig-dev/splitit-web-sdks/tree/HEAD/java)| @@ -18,4 +8,4 @@ For more information, please contact [danny@buildwithfern.com](mailto:danny@buil |C#|3.0.8|[NuGet](https://nuget.org/packages/Splitit.Web.Net/3.0.8)|[README](https://github.com/konfig-dev/splitit-web-sdks/tree/HEAD/csharp#readme)|[Source](https://github.com/konfig-dev/splitit-web-sdks/tree/HEAD/csharp)| |PHP (7.0+)|3.0.8|[Packagist](https://packagist.org/packages/konfig/splitit-web-php-sdk#3.0.8)|[README](https://github.com/konfig-dev/splitit-web-php-sdk/tree/HEAD#readme)|[Source](https://github.com/konfig-dev/splitit-web-php-sdk/tree/HEAD)| |Go|1.8.8|[pkg.go.dev](https://pkg.go.dev/github.com/konfig-dev/splitit-web-sdks/go)|[README](https://github.com/konfig-dev/splitit-web-sdks/tree/HEAD/go#readme)|[Source](https://github.com/konfig-dev/splitit-web-sdks/tree/HEAD/go)| -|PHP (7.0+)|3.0.9|[Packagist](https://packagist.org/packages/konfig/splitit-web-php-guzzle6-sdk#3.0.9)|[README](https://github.com/konfig-dev/splitit-web-php-guzzle6-sdk/tree/HEAD#readme)|[Source](https://github.com/konfig-dev/splitit-web-php-guzzle6-sdk/tree/HEAD)| +|PHP (7.0+)|3.0.9|[Packagist](https://packagist.org/packages/konfig/splitit-web-php-guzzle6-sdk#3.0.9)|[README](https://github.com/konfig-dev/splitit-web-php-guzzle6-sdk/tree/HEAD#readme)|[Source](https://github.com/konfig-dev/splitit-web-php-guzzle6-sdk/tree/HEAD)| \ No newline at end of file diff --git a/STATISTICS.md b/STATISTICS.md index 3ab4eb9..137aa97 100644 --- a/STATISTICS.md +++ b/STATISTICS.md @@ -2,11 +2,11 @@ | SDK Name | Lines of Code | | -------- | ------------- | -| java | 43422 | -| python | 41840 | -| typescript | 12443 | -| csharp | 26569 | -| php | 44055 | -| go | 31157 | -| phpGuzzle6 | 44055 | -| **Total** | 243541 | +| java | 43933 | +| python | 42105 | +| typescript | 12486 | +| csharp | 26855 | +| php | 44675 | +| go | 31524 | +| phpGuzzle6 | 44675 | +| **Total** | 246253 | diff --git a/csharp/.konfig/generate-id.txt b/csharp/.konfig/generate-id.txt index cb69078..6eb0983 100644 --- a/csharp/.konfig/generate-id.txt +++ b/csharp/.konfig/generate-id.txt @@ -1 +1 @@ -0b810a23-4746-49e7-9e36-f34ff9929554 \ No newline at end of file +3e0235b9-32f0-4b4a-881c-87e0fdc46df1 \ No newline at end of file diff --git a/csharp/README.md b/csharp/README.md index 3bef934..e4c334a 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -150,6 +150,7 @@ Class | Method | HTTP request | Description - [LinksData](docs/LinksData.md) - [LinksModel](docs/LinksModel.md) - [MockerShopperToken](docs/MockerShopperToken.md) + - [PaymentInfo](docs/PaymentInfo.md) - [PaymentMethodModel](docs/PaymentMethodModel.md) - [PaymentMethodType](docs/PaymentMethodType.md) - [PaymentPlanOptionModel](docs/PaymentPlanOptionModel.md) diff --git a/csharp/Splitit.Web.Net.sln b/csharp/Splitit.Web.Net.sln index 9173d2d..e4ae98c 100644 --- a/csharp/Splitit.Web.Net.sln +++ b/csharp/Splitit.Web.Net.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splitit.Web.Net", "src\Splitit.Web.Net\Splitit.Web.Net.csproj", "{C1A0438E-B777-49AB-BD5B-3E6E78B9F055}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splitit.Web.Net", "src\Splitit.Web.Net\Splitit.Web.Net.csproj", "{8D2C5781-F906-41C7-A7F9-4247B8628871}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splitit.Web.Net.Test", "src\Splitit.Web.Net.Test\Splitit.Web.Net.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C1A0438E-B777-49AB-BD5B-3E6E78B9F055}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1A0438E-B777-49AB-BD5B-3E6E78B9F055}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1A0438E-B777-49AB-BD5B-3E6E78B9F055}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1A0438E-B777-49AB-BD5B-3E6E78B9F055}.Release|Any CPU.Build.0 = Release|Any CPU + {8D2C5781-F906-41C7-A7F9-4247B8628871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D2C5781-F906-41C7-A7F9-4247B8628871}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D2C5781-F906-41C7-A7F9-4247B8628871}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D2C5781-F906-41C7-A7F9-4247B8628871}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/csharp/docs/PaymentInfo.md b/csharp/docs/PaymentInfo.md new file mode 100644 index 0000000..fbd3a4f --- /dev/null +++ b/csharp/docs/PaymentInfo.md @@ -0,0 +1,11 @@ +# Splitit.Web.Net.Model.PaymentInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CardBin** | **string** | | [optional] +**CardType** | **CardType** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/csharp/docs/PlanErrorResponse.md b/csharp/docs/PlanErrorResponse.md index baa49e4..39a65ca 100644 --- a/csharp/docs/PlanErrorResponse.md +++ b/csharp/docs/PlanErrorResponse.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **TraceId** | **string** | | [optional] **Error** | [**ErrorExtended**](ErrorExtended.md) | | [optional] **InstallmentPlanNumber** | **string** | | [optional] +**PaymentInfo** | [**PaymentInfo**](PaymentInfo.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/csharp/docs/PlanErrorResponseAllOf.md b/csharp/docs/PlanErrorResponseAllOf.md index edda8e8..6ec7aaa 100644 --- a/csharp/docs/PlanErrorResponseAllOf.md +++ b/csharp/docs/PlanErrorResponseAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **InstallmentPlanNumber** | **string** | | [optional] +**PaymentInfo** | [**PaymentInfo**](PaymentInfo.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/csharp/src/Splitit.Web.Net.Test/Model/PaymentInfoTests.cs b/csharp/src/Splitit.Web.Net.Test/Model/PaymentInfoTests.cs new file mode 100644 index 0000000..c735108 --- /dev/null +++ b/csharp/src/Splitit.Web.Net.Test/Model/PaymentInfoTests.cs @@ -0,0 +1,78 @@ +/* + * splitit-web-api-v3 + * + * Splitit's Web API + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://konfigthis.com + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Splitit.Web.Net.Api; +using Splitit.Web.Net.Model; +using Splitit.Web.Net.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Splitit.Web.Net.Test.Model +{ + /// + /// Class for testing PaymentInfo + /// + /// + /// This file is automatically generated by Konfig (https://konfigthis.com). + /// Please update the test case below to test the model. + /// + public class PaymentInfoTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PaymentInfo + //private PaymentInfo instance; + + public PaymentInfoTests() + { + // TODO uncomment below to create an instance of PaymentInfo + //instance = new PaymentInfo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PaymentInfo + /// + [Fact] + public void PaymentInfoInstanceTest() + { + // TODO uncomment below to test "IsType" PaymentInfo + //Assert.IsType(instance); + } + + + /// + /// Test the property 'CardBin' + /// + [Fact] + public void CardBinTest() + { + // TODO unit test for the property 'CardBin' + } + /// + /// Test the property 'CardType' + /// + [Fact] + public void CardTypeTest() + { + // TODO unit test for the property 'CardType' + } + + } + +} diff --git a/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseAllOfTests.cs b/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseAllOfTests.cs index 5c949dc..1d4ceb9 100644 --- a/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseAllOfTests.cs +++ b/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseAllOfTests.cs @@ -64,6 +64,14 @@ public void InstallmentPlanNumberTest() { // TODO unit test for the property 'InstallmentPlanNumber' } + /// + /// Test the property 'PaymentInfo' + /// + [Fact] + public void PaymentInfoTest() + { + // TODO unit test for the property 'PaymentInfo' + } } diff --git a/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseTests.cs b/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseTests.cs index a8d7961..ba767f7 100644 --- a/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseTests.cs +++ b/csharp/src/Splitit.Web.Net.Test/Model/PlanErrorResponseTests.cs @@ -80,6 +80,14 @@ public void InstallmentPlanNumberTest() { // TODO unit test for the property 'InstallmentPlanNumber' } + /// + /// Test the property 'PaymentInfo' + /// + [Fact] + public void PaymentInfoTest() + { + // TODO unit test for the property 'PaymentInfo' + } } diff --git a/csharp/src/Splitit.Web.Net/Model/PaymentInfo.cs b/csharp/src/Splitit.Web.Net/Model/PaymentInfo.cs new file mode 100644 index 0000000..442e3cd --- /dev/null +++ b/csharp/src/Splitit.Web.Net/Model/PaymentInfo.cs @@ -0,0 +1,142 @@ +/* + * splitit-web-api-v3 + * + * Splitit's Web API + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://konfigthis.com + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Splitit.Web.Net.Client.OpenAPIDateConverter; + +namespace Splitit.Web.Net.Model +{ + /// + /// PaymentInfo + /// + [DataContract(Name = "PaymentInfo")] + public partial class PaymentInfo : IEquatable, IValidatableObject + { + + /// + /// Gets or Sets CardType + /// + [DataMember(Name = "CardType", EmitDefaultValue = false)] + public CardType? CardType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// cardBin. + /// cardType. + public PaymentInfo(string cardBin = default(string), CardType? cardType = default(CardType?)) + { + this.CardBin = cardBin; + this.CardType = cardType; + } + + /// + /// Gets or Sets CardBin + /// + [DataMember(Name = "CardBin", EmitDefaultValue = false)] + public string CardBin { 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 PaymentInfo {\n"); + sb.Append(" CardBin: ").Append(CardBin).Append("\n"); + sb.Append(" CardType: ").Append(CardType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentInfo); + } + + /// + /// Returns true if PaymentInfo instances are equal + /// + /// Instance of PaymentInfo to be compared + /// Boolean + public bool Equals(PaymentInfo input) + { + if (input == null) + { + return false; + } + return + ( + this.CardBin == input.CardBin || + (this.CardBin != null && + this.CardBin.Equals(input.CardBin)) + ) && + ( + this.CardType == input.CardType || + this.CardType.Equals(input.CardType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CardBin != null) + { + hashCode = (hashCode * 59) + this.CardBin.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CardType.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/csharp/src/Splitit.Web.Net/Model/PlanErrorResponse.cs b/csharp/src/Splitit.Web.Net/Model/PlanErrorResponse.cs index bb2d8a2..179d38a 100644 --- a/csharp/src/Splitit.Web.Net/Model/PlanErrorResponse.cs +++ b/csharp/src/Splitit.Web.Net/Model/PlanErrorResponse.cs @@ -37,11 +37,13 @@ public partial class PlanErrorResponse : IEquatable, IValidat /// traceId. /// error. /// installmentPlanNumber. - public PlanErrorResponse(string traceId = default(string), ErrorExtended error = default(ErrorExtended), string installmentPlanNumber = default(string)) + /// paymentInfo. + public PlanErrorResponse(string traceId = default(string), ErrorExtended error = default(ErrorExtended), string installmentPlanNumber = default(string), PaymentInfo paymentInfo = default(PaymentInfo)) { this.TraceId = traceId; this.Error = error; this.InstallmentPlanNumber = installmentPlanNumber; + this.PaymentInfo = paymentInfo; } /// @@ -62,6 +64,12 @@ public partial class PlanErrorResponse : IEquatable, IValidat [DataMember(Name = "InstallmentPlanNumber", EmitDefaultValue = false)] public string InstallmentPlanNumber { get; set; } + /// + /// Gets or Sets PaymentInfo + /// + [DataMember(Name = "PaymentInfo", EmitDefaultValue = false)] + public PaymentInfo PaymentInfo { get; set; } + /// /// Returns the string presentation of the object /// @@ -73,6 +81,7 @@ public override string ToString() sb.Append(" TraceId: ").Append(TraceId).Append("\n"); sb.Append(" Error: ").Append(Error).Append("\n"); sb.Append(" InstallmentPlanNumber: ").Append(InstallmentPlanNumber).Append("\n"); + sb.Append(" PaymentInfo: ").Append(PaymentInfo).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -122,6 +131,11 @@ public bool Equals(PlanErrorResponse input) this.InstallmentPlanNumber == input.InstallmentPlanNumber || (this.InstallmentPlanNumber != null && this.InstallmentPlanNumber.Equals(input.InstallmentPlanNumber)) + ) && + ( + this.PaymentInfo == input.PaymentInfo || + (this.PaymentInfo != null && + this.PaymentInfo.Equals(input.PaymentInfo)) ); } @@ -146,6 +160,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.InstallmentPlanNumber.GetHashCode(); } + if (this.PaymentInfo != null) + { + hashCode = (hashCode * 59) + this.PaymentInfo.GetHashCode(); + } return hashCode; } } diff --git a/csharp/src/Splitit.Web.Net/Model/PlanErrorResponseAllOf.cs b/csharp/src/Splitit.Web.Net/Model/PlanErrorResponseAllOf.cs index f171f9f..bf041b0 100644 --- a/csharp/src/Splitit.Web.Net/Model/PlanErrorResponseAllOf.cs +++ b/csharp/src/Splitit.Web.Net/Model/PlanErrorResponseAllOf.cs @@ -35,9 +35,11 @@ public partial class PlanErrorResponseAllOf : IEquatable /// Initializes a new instance of the class. /// /// installmentPlanNumber. - public PlanErrorResponseAllOf(string installmentPlanNumber = default(string)) + /// paymentInfo. + public PlanErrorResponseAllOf(string installmentPlanNumber = default(string), PaymentInfo paymentInfo = default(PaymentInfo)) { this.InstallmentPlanNumber = installmentPlanNumber; + this.PaymentInfo = paymentInfo; } /// @@ -46,6 +48,12 @@ public partial class PlanErrorResponseAllOf : IEquatable [DataMember(Name = "InstallmentPlanNumber", EmitDefaultValue = false)] public string InstallmentPlanNumber { get; set; } + /// + /// Gets or Sets PaymentInfo + /// + [DataMember(Name = "PaymentInfo", EmitDefaultValue = false)] + public PaymentInfo PaymentInfo { get; set; } + /// /// Returns the string presentation of the object /// @@ -55,6 +63,7 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PlanErrorResponseAllOf {\n"); sb.Append(" InstallmentPlanNumber: ").Append(InstallmentPlanNumber).Append("\n"); + sb.Append(" PaymentInfo: ").Append(PaymentInfo).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -94,6 +103,11 @@ public bool Equals(PlanErrorResponseAllOf input) this.InstallmentPlanNumber == input.InstallmentPlanNumber || (this.InstallmentPlanNumber != null && this.InstallmentPlanNumber.Equals(input.InstallmentPlanNumber)) + ) && + ( + this.PaymentInfo == input.PaymentInfo || + (this.PaymentInfo != null && + this.PaymentInfo.Equals(input.PaymentInfo)) ); } @@ -110,6 +124,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.InstallmentPlanNumber.GetHashCode(); } + if (this.PaymentInfo != null) + { + hashCode = (hashCode * 59) + this.PaymentInfo.GetHashCode(); + } return hashCode; } } diff --git a/go/.konfig/generate-id.txt b/go/.konfig/generate-id.txt index cb69078..6eb0983 100644 --- a/go/.konfig/generate-id.txt +++ b/go/.konfig/generate-id.txt @@ -1 +1 @@ -0b810a23-4746-49e7-9e36-f34ff9929554 \ No newline at end of file +3e0235b9-32f0-4b4a-881c-87e0fdc46df1 \ No newline at end of file diff --git a/go/README.md b/go/README.md index 1cedaf3..5a5a4f7 100644 --- a/go/README.md +++ b/go/README.md @@ -111,6 +111,7 @@ Class | Method | HTTP request | Description - [LinksData](docs/LinksData.md) - [LinksModel](docs/LinksModel.md) - [MockerShopperToken](docs/MockerShopperToken.md) + - [PaymentInfo](docs/PaymentInfo.md) - [PaymentMethodModel](docs/PaymentMethodModel.md) - [PaymentMethodType](docs/PaymentMethodType.md) - [PaymentPlanOptionModel](docs/PaymentPlanOptionModel.md) diff --git a/go/api/openapi.yaml b/go/api/openapi.yaml index 7a42236..8a6d6dd 100644 --- a/go/api/openapi.yaml +++ b/go/api/openapi.yaml @@ -2155,6 +2155,13 @@ components: allOf: - $ref: '#/components/schemas/FailedResponse' - $ref: '#/components/schemas/PlanErrorResponse_allOf' + PaymentInfo: + properties: + CardBin: + type: string + CardType: + $ref: '#/components/schemas/CardType' + type: object InstallmentPlanInitiateRequest: example: PlanData: @@ -3452,6 +3459,8 @@ components: properties: InstallmentPlanNumber: type: string + PaymentInfo: + $ref: '#/components/schemas/PaymentInfo' type: object example: null InstallmentPlanUpdateRequestByIdentifier_allOf: diff --git a/go/docs/PaymentInfo.md b/go/docs/PaymentInfo.md new file mode 100644 index 0000000..bf7b8b9 --- /dev/null +++ b/go/docs/PaymentInfo.md @@ -0,0 +1,82 @@ +# PaymentInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CardBin** | Pointer to **string** | | [optional] +**CardType** | Pointer to [**CardType**](CardType.md) | | [optional] + +## Methods + +### NewPaymentInfo + +`func NewPaymentInfo() *PaymentInfo` + +NewPaymentInfo instantiates a new PaymentInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentInfoWithDefaults + +`func NewPaymentInfoWithDefaults() *PaymentInfo` + +NewPaymentInfoWithDefaults instantiates a new PaymentInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCardBin + +`func (o *PaymentInfo) GetCardBin() string` + +GetCardBin returns the CardBin field if non-nil, zero value otherwise. + +### GetCardBinOk + +`func (o *PaymentInfo) GetCardBinOk() (*string, bool)` + +GetCardBinOk returns a tuple with the CardBin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardBin + +`func (o *PaymentInfo) SetCardBin(v string)` + +SetCardBin sets CardBin field to given value. + +### HasCardBin + +`func (o *PaymentInfo) HasCardBin() bool` + +HasCardBin returns a boolean if a field has been set. + +### GetCardType + +`func (o *PaymentInfo) GetCardType() CardType` + +GetCardType returns the CardType field if non-nil, zero value otherwise. + +### GetCardTypeOk + +`func (o *PaymentInfo) GetCardTypeOk() (*CardType, bool)` + +GetCardTypeOk returns a tuple with the CardType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardType + +`func (o *PaymentInfo) SetCardType(v CardType)` + +SetCardType sets CardType field to given value. + +### HasCardType + +`func (o *PaymentInfo) HasCardType() bool` + +HasCardType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/go/docs/PlanErrorResponse.md b/go/docs/PlanErrorResponse.md index 64fc004..ce007b9 100644 --- a/go/docs/PlanErrorResponse.md +++ b/go/docs/PlanErrorResponse.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **TraceId** | Pointer to **string** | | [optional] **Error** | Pointer to [**ErrorExtended**](ErrorExtended.md) | | [optional] **InstallmentPlanNumber** | Pointer to **string** | | [optional] +**PaymentInfo** | Pointer to [**PaymentInfo**](PaymentInfo.md) | | [optional] ## Methods @@ -102,6 +103,31 @@ SetInstallmentPlanNumber sets InstallmentPlanNumber field to given value. HasInstallmentPlanNumber returns a boolean if a field has been set. +### GetPaymentInfo + +`func (o *PlanErrorResponse) GetPaymentInfo() PaymentInfo` + +GetPaymentInfo returns the PaymentInfo field if non-nil, zero value otherwise. + +### GetPaymentInfoOk + +`func (o *PlanErrorResponse) GetPaymentInfoOk() (*PaymentInfo, bool)` + +GetPaymentInfoOk returns a tuple with the PaymentInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentInfo + +`func (o *PlanErrorResponse) SetPaymentInfo(v PaymentInfo)` + +SetPaymentInfo sets PaymentInfo field to given value. + +### HasPaymentInfo + +`func (o *PlanErrorResponse) HasPaymentInfo() bool` + +HasPaymentInfo returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/go/docs/PlanErrorResponseAllOf.md b/go/docs/PlanErrorResponseAllOf.md index e235390..e7ed358 100644 --- a/go/docs/PlanErrorResponseAllOf.md +++ b/go/docs/PlanErrorResponseAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **InstallmentPlanNumber** | Pointer to **string** | | [optional] +**PaymentInfo** | Pointer to [**PaymentInfo**](PaymentInfo.md) | | [optional] ## Methods @@ -50,6 +51,31 @@ SetInstallmentPlanNumber sets InstallmentPlanNumber field to given value. HasInstallmentPlanNumber returns a boolean if a field has been set. +### GetPaymentInfo + +`func (o *PlanErrorResponseAllOf) GetPaymentInfo() PaymentInfo` + +GetPaymentInfo returns the PaymentInfo field if non-nil, zero value otherwise. + +### GetPaymentInfoOk + +`func (o *PlanErrorResponseAllOf) GetPaymentInfoOk() (*PaymentInfo, bool)` + +GetPaymentInfoOk returns a tuple with the PaymentInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentInfo + +`func (o *PlanErrorResponseAllOf) SetPaymentInfo(v PaymentInfo)` + +SetPaymentInfo sets PaymentInfo field to given value. + +### HasPaymentInfo + +`func (o *PlanErrorResponseAllOf) HasPaymentInfo() bool` + +HasPaymentInfo returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/go/model_payment_info.go b/go/model_payment_info.go new file mode 100644 index 0000000..c0733f0 --- /dev/null +++ b/go/model_payment_info.go @@ -0,0 +1,151 @@ +/* +splitit-web-api-v3 + +Splitit's Web API + +API version: 1.0.0 +*/ + +// Code generated by Konfig (https://konfigthis.com); DO NOT EDIT. + +package splitit + +import ( + "encoding/json" +) + +// PaymentInfo struct for PaymentInfo +type PaymentInfo struct { + CardBin *string `json:"CardBin,omitempty"` + CardType *CardType `json:"CardType,omitempty"` +} + +// NewPaymentInfo instantiates a new PaymentInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentInfo() *PaymentInfo { + this := PaymentInfo{} + return &this +} + +// NewPaymentInfoWithDefaults instantiates a new PaymentInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentInfoWithDefaults() *PaymentInfo { + this := PaymentInfo{} + return &this +} + +// GetCardBin returns the CardBin field value if set, zero value otherwise. +func (o *PaymentInfo) GetCardBin() string { + if o == nil || isNil(o.CardBin) { + var ret string + return ret + } + return *o.CardBin +} + +// GetCardBinOk returns a tuple with the CardBin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInfo) GetCardBinOk() (*string, bool) { + if o == nil || isNil(o.CardBin) { + return nil, false + } + return o.CardBin, true +} + +// HasCardBin returns a boolean if a field has been set. +func (o *PaymentInfo) HasCardBin() bool { + if o != nil && !isNil(o.CardBin) { + return true + } + + return false +} + +// SetCardBin gets a reference to the given string and assigns it to the CardBin field. +func (o *PaymentInfo) SetCardBin(v string) { + o.CardBin = &v +} + +// GetCardType returns the CardType field value if set, zero value otherwise. +func (o *PaymentInfo) GetCardType() CardType { + if o == nil || isNil(o.CardType) { + var ret CardType + return ret + } + return *o.CardType +} + +// GetCardTypeOk returns a tuple with the CardType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInfo) GetCardTypeOk() (*CardType, bool) { + if o == nil || isNil(o.CardType) { + return nil, false + } + return o.CardType, true +} + +// HasCardType returns a boolean if a field has been set. +func (o *PaymentInfo) HasCardType() bool { + if o != nil && !isNil(o.CardType) { + return true + } + + return false +} + +// SetCardType gets a reference to the given CardType and assigns it to the CardType field. +func (o *PaymentInfo) SetCardType(v CardType) { + o.CardType = &v +} + +func (o PaymentInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.CardBin) { + toSerialize["CardBin"] = o.CardBin + } + if !isNil(o.CardType) { + toSerialize["CardType"] = o.CardType + } + return json.Marshal(toSerialize) +} + +type NullablePaymentInfo struct { + value *PaymentInfo + isSet bool +} + +func (v NullablePaymentInfo) Get() *PaymentInfo { + return v.value +} + +func (v *NullablePaymentInfo) Set(val *PaymentInfo) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInfo) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInfo(val *PaymentInfo) *NullablePaymentInfo { + return &NullablePaymentInfo{value: val, isSet: true} +} + +func (v NullablePaymentInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/model_plan_error_response.go b/go/model_plan_error_response.go index 11a0282..ad99c3f 100644 --- a/go/model_plan_error_response.go +++ b/go/model_plan_error_response.go @@ -19,6 +19,7 @@ type PlanErrorResponse struct { TraceId *string `json:"TraceId,omitempty"` Error *ErrorExtended `json:"Error,omitempty"` InstallmentPlanNumber *string `json:"InstallmentPlanNumber,omitempty"` + PaymentInfo *PaymentInfo `json:"PaymentInfo,omitempty"` } // NewPlanErrorResponse instantiates a new PlanErrorResponse object @@ -134,6 +135,38 @@ func (o *PlanErrorResponse) SetInstallmentPlanNumber(v string) { o.InstallmentPlanNumber = &v } +// GetPaymentInfo returns the PaymentInfo field value if set, zero value otherwise. +func (o *PlanErrorResponse) GetPaymentInfo() PaymentInfo { + if o == nil || isNil(o.PaymentInfo) { + var ret PaymentInfo + return ret + } + return *o.PaymentInfo +} + +// GetPaymentInfoOk returns a tuple with the PaymentInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanErrorResponse) GetPaymentInfoOk() (*PaymentInfo, bool) { + if o == nil || isNil(o.PaymentInfo) { + return nil, false + } + return o.PaymentInfo, true +} + +// HasPaymentInfo returns a boolean if a field has been set. +func (o *PlanErrorResponse) HasPaymentInfo() bool { + if o != nil && !isNil(o.PaymentInfo) { + return true + } + + return false +} + +// SetPaymentInfo gets a reference to the given PaymentInfo and assigns it to the PaymentInfo field. +func (o *PlanErrorResponse) SetPaymentInfo(v PaymentInfo) { + o.PaymentInfo = &v +} + func (o PlanErrorResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if !isNil(o.TraceId) { @@ -145,6 +178,9 @@ func (o PlanErrorResponse) MarshalJSON() ([]byte, error) { if !isNil(o.InstallmentPlanNumber) { toSerialize["InstallmentPlanNumber"] = o.InstallmentPlanNumber } + if !isNil(o.PaymentInfo) { + toSerialize["PaymentInfo"] = o.PaymentInfo + } return json.Marshal(toSerialize) } diff --git a/go/model_plan_error_response_all_of.go b/go/model_plan_error_response_all_of.go index 0e9e31d..1eae418 100644 --- a/go/model_plan_error_response_all_of.go +++ b/go/model_plan_error_response_all_of.go @@ -17,6 +17,7 @@ import ( // PlanErrorResponseAllOf struct for PlanErrorResponseAllOf type PlanErrorResponseAllOf struct { InstallmentPlanNumber *string `json:"InstallmentPlanNumber,omitempty"` + PaymentInfo *PaymentInfo `json:"PaymentInfo,omitempty"` } // NewPlanErrorResponseAllOf instantiates a new PlanErrorResponseAllOf object @@ -68,11 +69,46 @@ func (o *PlanErrorResponseAllOf) SetInstallmentPlanNumber(v string) { o.InstallmentPlanNumber = &v } +// GetPaymentInfo returns the PaymentInfo field value if set, zero value otherwise. +func (o *PlanErrorResponseAllOf) GetPaymentInfo() PaymentInfo { + if o == nil || isNil(o.PaymentInfo) { + var ret PaymentInfo + return ret + } + return *o.PaymentInfo +} + +// GetPaymentInfoOk returns a tuple with the PaymentInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanErrorResponseAllOf) GetPaymentInfoOk() (*PaymentInfo, bool) { + if o == nil || isNil(o.PaymentInfo) { + return nil, false + } + return o.PaymentInfo, true +} + +// HasPaymentInfo returns a boolean if a field has been set. +func (o *PlanErrorResponseAllOf) HasPaymentInfo() bool { + if o != nil && !isNil(o.PaymentInfo) { + return true + } + + return false +} + +// SetPaymentInfo gets a reference to the given PaymentInfo and assigns it to the PaymentInfo field. +func (o *PlanErrorResponseAllOf) SetPaymentInfo(v PaymentInfo) { + o.PaymentInfo = &v +} + func (o PlanErrorResponseAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if !isNil(o.InstallmentPlanNumber) { toSerialize["InstallmentPlanNumber"] = o.InstallmentPlanNumber } + if !isNil(o.PaymentInfo) { + toSerialize["PaymentInfo"] = o.PaymentInfo + } return json.Marshal(toSerialize) } diff --git a/java/.konfig/generate-id.txt b/java/.konfig/generate-id.txt index cb69078..6eb0983 100644 --- a/java/.konfig/generate-id.txt +++ b/java/.konfig/generate-id.txt @@ -1 +1 @@ -0b810a23-4746-49e7-9e36-f34ff9929554 \ No newline at end of file +3e0235b9-32f0-4b4a-881c-87e0fdc46df1 \ No newline at end of file diff --git a/java/api/openapi.yaml b/java/api/openapi.yaml index 863addb..0433d2c 100644 --- a/java/api/openapi.yaml +++ b/java/api/openapi.yaml @@ -2219,6 +2219,13 @@ components: - $ref: '#/components/schemas/FailedResponse' - $ref: '#/components/schemas/PlanErrorResponse_allOf' x-konfig-is-used-in-non-successful-response: true + PaymentInfo: + properties: + CardBin: + type: string + CardType: + $ref: '#/components/schemas/CardType' + type: object InstallmentPlanInitiateRequest: example: PlanData: @@ -3522,6 +3529,8 @@ components: properties: InstallmentPlanNumber: type: string + PaymentInfo: + $ref: '#/components/schemas/PaymentInfo' type: object example: null InstallmentPlanUpdateRequestByIdentifier_allOf: diff --git a/java/docs/PaymentInfo.md b/java/docs/PaymentInfo.md new file mode 100644 index 0000000..12b4c3c --- /dev/null +++ b/java/docs/PaymentInfo.md @@ -0,0 +1,14 @@ + + +# PaymentInfo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cardBin** | **String** | | [optional] | +|**cardType** | **CardType** | | [optional] | + + + diff --git a/java/docs/PlanErrorResponse.md b/java/docs/PlanErrorResponse.md index 947ab6e..fafc623 100644 --- a/java/docs/PlanErrorResponse.md +++ b/java/docs/PlanErrorResponse.md @@ -10,6 +10,7 @@ |**traceId** | **String** | | [optional] | |**error** | [**ErrorExtended**](ErrorExtended.md) | | [optional] | |**installmentPlanNumber** | **String** | | [optional] | +|**paymentInfo** | [**PaymentInfo**](PaymentInfo.md) | | [optional] | diff --git a/java/docs/PlanErrorResponseAllOf.md b/java/docs/PlanErrorResponseAllOf.md index 9690f7d..1b0b089 100644 --- a/java/docs/PlanErrorResponseAllOf.md +++ b/java/docs/PlanErrorResponseAllOf.md @@ -8,6 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**installmentPlanNumber** | **String** | | [optional] | +|**paymentInfo** | [**PaymentInfo**](PaymentInfo.md) | | [optional] | diff --git a/java/src/main/java/com/konfigthis/splitit/client/JSON.java b/java/src/main/java/com/konfigthis/splitit/client/JSON.java index 6f42bb4..6accfb0 100644 --- a/java/src/main/java/com/konfigthis/splitit/client/JSON.java +++ b/java/src/main/java/com/konfigthis/splitit/client/JSON.java @@ -141,6 +141,7 @@ public JsonElement serialize(Double src, Type typeOfSrc, JsonSerializationContex gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.LinksData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.LinksModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.MockerShopperToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.PaymentInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.PaymentMethodModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.PaymentPlanOptionModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.PlanData.CustomTypeAdapterFactory()); diff --git a/java/src/main/java/com/konfigthis/splitit/client/model/PaymentInfo.java b/java/src/main/java/com/konfigthis/splitit/client/model/PaymentInfo.java new file mode 100644 index 0000000..c403e25 --- /dev/null +++ b/java/src/main/java/com/konfigthis/splitit/client/model/PaymentInfo.java @@ -0,0 +1,327 @@ +/* + * splitit-web-api-v3 + * Splitit's Web API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by Konfig (https://konfigthis.com). + * Do not edit the class manually. + */ + + +package com.konfigthis.splitit.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.konfigthis.splitit.client.model.CardType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import org.apache.commons.lang3.StringUtils; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.konfigthis.splitit.client.JSON; + +/** + * PaymentInfo + */@javax.annotation.Generated(value = "Generated by https://konfigthis.com") +public class PaymentInfo { + public static final String SERIALIZED_NAME_CARD_BIN = "CardBin"; + @SerializedName(SERIALIZED_NAME_CARD_BIN) + private String cardBin; + + public static final String SERIALIZED_NAME_CARD_TYPE = "CardType"; + @SerializedName(SERIALIZED_NAME_CARD_TYPE) + private CardType cardType; + + public PaymentInfo() { + } + + public PaymentInfo cardBin(String cardBin) { + + + + + this.cardBin = cardBin; + return this; + } + + /** + * Get cardBin + * @return cardBin + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getCardBin() { + return cardBin; + } + + + public void setCardBin(String cardBin) { + + + + this.cardBin = cardBin; + } + + + public PaymentInfo cardType(CardType cardType) { + + + + + this.cardType = cardType; + return this; + } + + /** + * Get cardType + * @return cardType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public CardType getCardType() { + return cardType; + } + + + public void setCardType(CardType cardType) { + + + + this.cardType = cardType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PaymentInfo instance itself + */ + public PaymentInfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentInfo paymentInfo = (PaymentInfo) o; + return Objects.equals(this.cardBin, paymentInfo.cardBin) && + Objects.equals(this.cardType, paymentInfo.cardType)&& + Objects.equals(this.additionalProperties, paymentInfo.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cardBin, cardType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInfo {\n"); + sb.append(" cardBin: ").append(toIndentedString(cardBin)).append("\n"); + sb.append(" cardType: ").append(toIndentedString(cardType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CardBin"); + openapiFields.add("CardType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PaymentInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentInfo is not found in the empty JSON string", PaymentInfo.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("CardBin") != null && !jsonObj.get("CardBin").isJsonNull()) && !jsonObj.get("CardBin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CardBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CardBin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaymentInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaymentInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else if (entry.getValue() == null) { + obj.addProperty(entry.getKey(), (String) null); + } else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PaymentInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + PaymentInfo instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaymentInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInfo + * @throws IOException if the JSON string is invalid with respect to PaymentInfo + */ + public static PaymentInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentInfo.class); + } + + /** + * Convert an instance of PaymentInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponse.java b/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponse.java index a2c0e7a..54a07e0 100644 --- a/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponse.java +++ b/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponse.java @@ -20,6 +20,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.konfigthis.splitit.client.model.ErrorExtended; +import com.konfigthis.splitit.client.model.PaymentInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -62,6 +63,10 @@ public class PlanErrorResponse { @SerializedName(SERIALIZED_NAME_INSTALLMENT_PLAN_NUMBER) private String installmentPlanNumber; + public static final String SERIALIZED_NAME_PAYMENT_INFO = "PaymentInfo"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INFO) + private PaymentInfo paymentInfo; + public PlanErrorResponse() { } @@ -151,6 +156,35 @@ public void setInstallmentPlanNumber(String installmentPlanNumber) { this.installmentPlanNumber = installmentPlanNumber; } + + public PlanErrorResponse paymentInfo(PaymentInfo paymentInfo) { + + + + + this.paymentInfo = paymentInfo; + return this; + } + + /** + * Get paymentInfo + * @return paymentInfo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PaymentInfo getPaymentInfo() { + return paymentInfo; + } + + + public void setPaymentInfo(PaymentInfo paymentInfo) { + + + + this.paymentInfo = paymentInfo; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -208,13 +242,14 @@ public boolean equals(Object o) { PlanErrorResponse planErrorResponse = (PlanErrorResponse) o; return Objects.equals(this.traceId, planErrorResponse.traceId) && Objects.equals(this.error, planErrorResponse.error) && - Objects.equals(this.installmentPlanNumber, planErrorResponse.installmentPlanNumber)&& + Objects.equals(this.installmentPlanNumber, planErrorResponse.installmentPlanNumber) && + Objects.equals(this.paymentInfo, planErrorResponse.paymentInfo)&& Objects.equals(this.additionalProperties, planErrorResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(traceId, error, installmentPlanNumber, additionalProperties); + return Objects.hash(traceId, error, installmentPlanNumber, paymentInfo, additionalProperties); } @Override @@ -224,6 +259,7 @@ public String toString() { sb.append(" traceId: ").append(toIndentedString(traceId)).append("\n"); sb.append(" error: ").append(toIndentedString(error)).append("\n"); sb.append(" installmentPlanNumber: ").append(toIndentedString(installmentPlanNumber)).append("\n"); + sb.append(" paymentInfo: ").append(toIndentedString(paymentInfo)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -250,6 +286,7 @@ private String toIndentedString(Object o) { openapiFields.add("TraceId"); openapiFields.add("Error"); openapiFields.add("InstallmentPlanNumber"); + openapiFields.add("PaymentInfo"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -277,6 +314,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("InstallmentPlanNumber") != null && !jsonObj.get("InstallmentPlanNumber").isJsonNull()) && !jsonObj.get("InstallmentPlanNumber").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `InstallmentPlanNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InstallmentPlanNumber").toString())); } + // validate the optional field `PaymentInfo` + if (jsonObj.get("PaymentInfo") != null && !jsonObj.get("PaymentInfo").isJsonNull()) { + PaymentInfo.validateJsonObject(jsonObj.getAsJsonObject("PaymentInfo")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOf.java b/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOf.java index d4857d5..3e5baef 100644 --- a/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOf.java +++ b/java/src/main/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOf.java @@ -19,6 +19,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.konfigthis.splitit.client.model.PaymentInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -53,6 +54,10 @@ public class PlanErrorResponseAllOf { @SerializedName(SERIALIZED_NAME_INSTALLMENT_PLAN_NUMBER) private String installmentPlanNumber; + public static final String SERIALIZED_NAME_PAYMENT_INFO = "PaymentInfo"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INFO) + private PaymentInfo paymentInfo; + public PlanErrorResponseAllOf() { } @@ -84,6 +89,35 @@ public void setInstallmentPlanNumber(String installmentPlanNumber) { this.installmentPlanNumber = installmentPlanNumber; } + + public PlanErrorResponseAllOf paymentInfo(PaymentInfo paymentInfo) { + + + + + this.paymentInfo = paymentInfo; + return this; + } + + /** + * Get paymentInfo + * @return paymentInfo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PaymentInfo getPaymentInfo() { + return paymentInfo; + } + + + public void setPaymentInfo(PaymentInfo paymentInfo) { + + + + this.paymentInfo = paymentInfo; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -139,13 +173,14 @@ public boolean equals(Object o) { return false; } PlanErrorResponseAllOf planErrorResponseAllOf = (PlanErrorResponseAllOf) o; - return Objects.equals(this.installmentPlanNumber, planErrorResponseAllOf.installmentPlanNumber)&& + return Objects.equals(this.installmentPlanNumber, planErrorResponseAllOf.installmentPlanNumber) && + Objects.equals(this.paymentInfo, planErrorResponseAllOf.paymentInfo)&& Objects.equals(this.additionalProperties, planErrorResponseAllOf.additionalProperties); } @Override public int hashCode() { - return Objects.hash(installmentPlanNumber, additionalProperties); + return Objects.hash(installmentPlanNumber, paymentInfo, additionalProperties); } @Override @@ -153,6 +188,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PlanErrorResponseAllOf {\n"); sb.append(" installmentPlanNumber: ").append(toIndentedString(installmentPlanNumber)).append("\n"); + sb.append(" paymentInfo: ").append(toIndentedString(paymentInfo)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -177,6 +213,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("InstallmentPlanNumber"); + openapiFields.add("PaymentInfo"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -197,6 +234,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("InstallmentPlanNumber") != null && !jsonObj.get("InstallmentPlanNumber").isJsonNull()) && !jsonObj.get("InstallmentPlanNumber").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `InstallmentPlanNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InstallmentPlanNumber").toString())); } + // validate the optional field `PaymentInfo` + if (jsonObj.get("PaymentInfo") != null && !jsonObj.get("PaymentInfo").isJsonNull()) { + PaymentInfo.validateJsonObject(jsonObj.getAsJsonObject("PaymentInfo")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/java/src/test/java/com/konfigthis/splitit/client/model/PaymentInfoTest.java b/java/src/test/java/com/konfigthis/splitit/client/model/PaymentInfoTest.java new file mode 100644 index 0000000..b5a33bc --- /dev/null +++ b/java/src/test/java/com/konfigthis/splitit/client/model/PaymentInfoTest.java @@ -0,0 +1,58 @@ +/* + * splitit-web-api-v3 + * Splitit's Web API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by Konfig (https://konfigthis.com). + * Do not edit the class manually. + */ + + +package com.konfigthis.splitit.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.konfigthis.splitit.client.model.CardType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PaymentInfo + */ +public class PaymentInfoTest { + private final PaymentInfo model = new PaymentInfo(); + + /** + * Model tests for PaymentInfo + */ + @Test + public void testPaymentInfo() { + // TODO: test PaymentInfo + } + + /** + * Test the property 'cardBin' + */ + @Test + public void cardBinTest() { + // TODO: test cardBin + } + + /** + * Test the property 'cardType' + */ + @Test + public void cardTypeTest() { + // TODO: test cardType + } + +} diff --git a/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOfTest.java b/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOfTest.java index dec91df..ed44b85 100644 --- a/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOfTest.java +++ b/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseAllOfTest.java @@ -17,6 +17,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.konfigthis.splitit.client.model.PaymentInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -46,4 +47,12 @@ public void installmentPlanNumberTest() { // TODO: test installmentPlanNumber } + /** + * Test the property 'paymentInfo' + */ + @Test + public void paymentInfoTest() { + // TODO: test paymentInfo + } + } diff --git a/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseTest.java b/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseTest.java index 5c3babd..fa5adfa 100644 --- a/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseTest.java +++ b/java/src/test/java/com/konfigthis/splitit/client/model/PlanErrorResponseTest.java @@ -18,6 +18,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.konfigthis.splitit.client.model.ErrorExtended; +import com.konfigthis.splitit.client.model.PaymentInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -63,4 +64,12 @@ public void installmentPlanNumberTest() { // TODO: test installmentPlanNumber } + /** + * Test the property 'paymentInfo' + */ + @Test + public void paymentInfoTest() { + // TODO: test paymentInfo + } + } diff --git a/php b/php index 5a60976..54902f1 160000 --- a/php +++ b/php @@ -1 +1 @@ -Subproject commit 5a60976d9b0ad5cc7988ac8b0766822062791057 +Subproject commit 54902f1d9d54c8a070c4465fb2fa920bf92712fa diff --git a/phpGuzzle6 b/phpGuzzle6 index b14403a..23f4eb0 160000 --- a/phpGuzzle6 +++ b/phpGuzzle6 @@ -1 +1 @@ -Subproject commit b14403a5a3d7ce249e097f941a9cd6620085d971 +Subproject commit 23f4eb05937f559cdeae0ea2c5aaa5c197f2ce10 diff --git a/python/.konfig/generate-id.txt b/python/.konfig/generate-id.txt index cb69078..6eb0983 100644 --- a/python/.konfig/generate-id.txt +++ b/python/.konfig/generate-id.txt @@ -1 +1 @@ -0b810a23-4746-49e7-9e36-f34ff9929554 \ No newline at end of file +3e0235b9-32f0-4b4a-881c-87e0fdc46df1 \ No newline at end of file diff --git a/python/splitit_client/exceptions.py b/python/splitit_client/exceptions.py index 5581cb5..adb0c53 100644 --- a/python/splitit_client/exceptions.py +++ b/python/splitit_client/exceptions.py @@ -97,48 +97,6 @@ def __str__(self): return error_message -class AnyOfValidationError(OpenApiException): - def __init__(self, error_list: typing.List[typing.Union[ApiTypeError, ApiValueError]]): - self.error_list = error_list - sub_msgs: typing.List[str] = [] - for type_error in error_list: - sub_msgs.append(str(type_error)) - num_validation_errors = len(self.error_list) - if num_validation_errors == 1: - super().__init__(sub_msgs[0]) - else: - # create a string that says how many validation errors there were and - # prints each sub_msg out using a bulleted list of messages - msg = "{} validation error{} detected: \n".format(num_validation_errors, "s" if num_validation_errors > 1 else "") - for i, sub_msg in enumerate(sub_msgs): - msg += " {}. {}\n".format(i+1, sub_msg) - super().__init__(msg) - - -class InvalidHostConfigurationError(ClientConfigurationError): - def __init__(self, host: str, reason: str): - self.host = host - self.reason = reason - super().__init__('Invalid host: "{}", {}'.format(self.host, self.reason)) - - -class MissingRequiredPropertiesError(ApiTypeError): - def __init__(self, msg: str): - super().__init__(msg) - - -class MissingRequiredParametersError(ApiTypeError): - def __init__(self, error: TypeError): - self.error = error - error_str = str(error) - self.msg = error_str - if "__new__()" in error_str: - # parse error to reformat - missing_parameters = error_str.split(":")[1].strip() - number_of_parameters = error_str.split("missing")[1].split("required")[0].strip() - self.msg = "Missing {} required parameter{}: {}".format(number_of_parameters, "s" if int(number_of_parameters) > 1 else "", missing_parameters) - super().__init__(self.msg) - class SchemaValidationError(OpenApiException): def __init__(self, validation_errors: typing.List[typing.Union[ApiValueError, ApiTypeError]]): """ Aggregates schema validation errors @@ -189,3 +147,45 @@ def __init__(self, validation_errors: typing.List[typing.Union[ApiValueError, Ap num_validation_errors = len(self.validation_errors) self.msg = "{} invalid argument{}. {}".format(num_validation_errors, "s" if num_validation_errors > 1 else "", sub_msg) super().__init__(self.msg) + +class AnyOfValidationError(OpenApiException): + def __init__(self, error_list: typing.List[typing.Union[ApiTypeError, ApiValueError, SchemaValidationError]]): + self.error_list = error_list + sub_msgs: typing.List[str] = [] + for type_error in error_list: + sub_msgs.append(str(type_error)) + num_validation_errors = len(self.error_list) + if num_validation_errors == 1: + super().__init__(sub_msgs[0]) + else: + # create a string that says how many validation errors there were and + # prints each sub_msg out using a bulleted list of messages + msg = "{} validation error{} detected: \n".format(num_validation_errors, "s" if num_validation_errors > 1 else "") + for i, sub_msg in enumerate(sub_msgs): + msg += " {}. {}\n".format(i+1, sub_msg) + super().__init__(msg) + + +class InvalidHostConfigurationError(ClientConfigurationError): + def __init__(self, host: str, reason: str): + self.host = host + self.reason = reason + super().__init__('Invalid host: "{}", {}'.format(self.host, self.reason)) + + +class MissingRequiredPropertiesError(ApiTypeError): + def __init__(self, msg: str): + super().__init__(msg) + + +class MissingRequiredParametersError(ApiTypeError): + def __init__(self, error: TypeError): + self.error = error + error_str = str(error) + self.msg = error_str + if "__new__()" in error_str: + # parse error to reformat + missing_parameters = error_str.split(":")[1].strip() + number_of_parameters = error_str.split("missing")[1].split("required")[0].strip() + self.msg = "Missing {} required parameter{}: {}".format(number_of_parameters, "s" if int(number_of_parameters) > 1 else "", missing_parameters) + super().__init__(self.msg) diff --git a/python/splitit_client/model/payment_info.py b/python/splitit_client/model/payment_info.py new file mode 100644 index 0000000..251462f --- /dev/null +++ b/python/splitit_client/model/payment_info.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + splitit-web-api-v3 + + Splitit's Web API + + The version of the OpenAPI document: 1.0.0 + Generated by: https://konfigthis.com +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from splitit_client import schemas # noqa: F401 + + +class PaymentInfo( + schemas.DictSchema +): + """ + This class is auto generated by Konfig (https://konfigthis.com) + """ + + + class MetaOapg: + + class properties: + CardBin = schemas.StrSchema + + @staticmethod + def CardType() -> typing.Type['CardType']: + return CardType + __annotations__ = { + "CardBin": CardBin, + "CardType": CardType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["CardBin"]) -> MetaOapg.properties.CardBin: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["CardType"]) -> 'CardType': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["CardBin", "CardType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["CardBin"]) -> typing.Union[MetaOapg.properties.CardBin, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["CardType"]) -> typing.Union['CardType', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["CardBin", "CardType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + CardBin: typing.Union[MetaOapg.properties.CardBin, str, schemas.Unset] = schemas.unset, + CardType: typing.Union['CardType', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'PaymentInfo': + return super().__new__( + cls, + *args, + CardBin=CardBin, + CardType=CardType, + _configuration=_configuration, + **kwargs, + ) + +from splitit_client.model.card_type import CardType diff --git a/python/splitit_client/model/payment_info.pyi b/python/splitit_client/model/payment_info.pyi new file mode 100644 index 0000000..251462f --- /dev/null +++ b/python/splitit_client/model/payment_info.pyi @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + splitit-web-api-v3 + + Splitit's Web API + + The version of the OpenAPI document: 1.0.0 + Generated by: https://konfigthis.com +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from splitit_client import schemas # noqa: F401 + + +class PaymentInfo( + schemas.DictSchema +): + """ + This class is auto generated by Konfig (https://konfigthis.com) + """ + + + class MetaOapg: + + class properties: + CardBin = schemas.StrSchema + + @staticmethod + def CardType() -> typing.Type['CardType']: + return CardType + __annotations__ = { + "CardBin": CardBin, + "CardType": CardType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["CardBin"]) -> MetaOapg.properties.CardBin: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["CardType"]) -> 'CardType': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["CardBin", "CardType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["CardBin"]) -> typing.Union[MetaOapg.properties.CardBin, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["CardType"]) -> typing.Union['CardType', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["CardBin", "CardType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + CardBin: typing.Union[MetaOapg.properties.CardBin, str, schemas.Unset] = schemas.unset, + CardType: typing.Union['CardType', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'PaymentInfo': + return super().__new__( + cls, + *args, + CardBin=CardBin, + CardType=CardType, + _configuration=_configuration, + **kwargs, + ) + +from splitit_client.model.card_type import CardType diff --git a/python/splitit_client/model/plan_error_response.py b/python/splitit_client/model/plan_error_response.py index d089426..52675d4 100644 --- a/python/splitit_client/model/plan_error_response.py +++ b/python/splitit_client/model/plan_error_response.py @@ -43,17 +43,25 @@ class MetaOapg: class properties: InstallmentPlanNumber = schemas.StrSchema + + @staticmethod + def PaymentInfo() -> typing.Type['PaymentInfo']: + return PaymentInfo __annotations__ = { "InstallmentPlanNumber": InstallmentPlanNumber, + "PaymentInfo": PaymentInfo, } @typing.overload def __getitem__(self, name: typing_extensions.Literal["InstallmentPlanNumber"]) -> MetaOapg.properties.InstallmentPlanNumber: ... + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["PaymentInfo"]) -> 'PaymentInfo': ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", "PaymentInfo", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @@ -61,10 +69,13 @@ def __getitem__(self, name: typing.Union[typing_extensions.Literal["InstallmentP @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["InstallmentPlanNumber"]) -> typing.Union[MetaOapg.properties.InstallmentPlanNumber, schemas.Unset]: ... + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["PaymentInfo"]) -> typing.Union['PaymentInfo', schemas.Unset]: ... + @typing.overload def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", "PaymentInfo", ], str]): return super().get_item_oapg(name) @@ -72,6 +83,7 @@ def __new__( cls, *args: typing.Union[dict, frozendict.frozendict, ], InstallmentPlanNumber: typing.Union[MetaOapg.properties.InstallmentPlanNumber, str, schemas.Unset] = schemas.unset, + PaymentInfo: typing.Union['PaymentInfo', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], ) -> 'all_of_1': @@ -79,6 +91,7 @@ def __new__( cls, *args, InstallmentPlanNumber=InstallmentPlanNumber, + PaymentInfo=PaymentInfo, _configuration=_configuration, **kwargs, ) @@ -113,3 +126,4 @@ def __new__( ) from splitit_client.model.failed_response import FailedResponse +from splitit_client.model.payment_info import PaymentInfo diff --git a/python/splitit_client/model/plan_error_response.pyi b/python/splitit_client/model/plan_error_response.pyi index d089426..52675d4 100644 --- a/python/splitit_client/model/plan_error_response.pyi +++ b/python/splitit_client/model/plan_error_response.pyi @@ -43,17 +43,25 @@ class PlanErrorResponse( class properties: InstallmentPlanNumber = schemas.StrSchema + + @staticmethod + def PaymentInfo() -> typing.Type['PaymentInfo']: + return PaymentInfo __annotations__ = { "InstallmentPlanNumber": InstallmentPlanNumber, + "PaymentInfo": PaymentInfo, } @typing.overload def __getitem__(self, name: typing_extensions.Literal["InstallmentPlanNumber"]) -> MetaOapg.properties.InstallmentPlanNumber: ... + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["PaymentInfo"]) -> 'PaymentInfo': ... + @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", "PaymentInfo", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @@ -61,10 +69,13 @@ class PlanErrorResponse( @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["InstallmentPlanNumber"]) -> typing.Union[MetaOapg.properties.InstallmentPlanNumber, schemas.Unset]: ... + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["PaymentInfo"]) -> typing.Union['PaymentInfo', schemas.Unset]: ... + @typing.overload def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["InstallmentPlanNumber", "PaymentInfo", ], str]): return super().get_item_oapg(name) @@ -72,6 +83,7 @@ class PlanErrorResponse( cls, *args: typing.Union[dict, frozendict.frozendict, ], InstallmentPlanNumber: typing.Union[MetaOapg.properties.InstallmentPlanNumber, str, schemas.Unset] = schemas.unset, + PaymentInfo: typing.Union['PaymentInfo', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], ) -> 'all_of_1': @@ -79,6 +91,7 @@ class PlanErrorResponse( cls, *args, InstallmentPlanNumber=InstallmentPlanNumber, + PaymentInfo=PaymentInfo, _configuration=_configuration, **kwargs, ) @@ -113,3 +126,4 @@ class PlanErrorResponse( ) from splitit_client.model.failed_response import FailedResponse +from splitit_client.model.payment_info import PaymentInfo diff --git a/python/splitit_client/models/__init__.py b/python/splitit_client/models/__init__.py index e3672ff..2eb0eea 100644 --- a/python/splitit_client/models/__init__.py +++ b/python/splitit_client/models/__init__.py @@ -49,6 +49,7 @@ from splitit_client.model.links_data import LinksData from splitit_client.model.links_model import LinksModel from splitit_client.model.mocker_shopper_token import MockerShopperToken +from splitit_client.model.payment_info import PaymentInfo from splitit_client.model.payment_method_model import PaymentMethodModel from splitit_client.model.payment_method_type import PaymentMethodType from splitit_client.model.payment_plan_option_model import PaymentPlanOptionModel diff --git a/python/splitit_client/schemas.py b/python/splitit_client/schemas.py index 01d2667..d3b7e1f 100644 --- a/python/splitit_client/schemas.py +++ b/python/splitit_client/schemas.py @@ -1874,7 +1874,7 @@ def __get_oneof_class( continue try: path_to_schemas = oneof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: + except (ApiValueError, ApiTypeError, SchemaValidationError) as ex: if discriminated_cls is not None and oneof_cls is discriminated_cls: raise ex continue @@ -1909,7 +1909,7 @@ def __get_anyof_classes( try: other_path_to_schemas = anyof_cls._validate_oapg(arg, validation_metadata=validation_metadata) - except (ApiValueError, ApiTypeError) as ex: + except (ApiValueError, ApiTypeError, SchemaValidationError) as ex: if discriminated_cls is not None and anyof_cls is discriminated_cls: raise ex exceptions.append(ex) diff --git a/python/splitit_client/type/payment_info.py b/python/splitit_client/type/payment_info.py new file mode 100644 index 0000000..0bc3102 --- /dev/null +++ b/python/splitit_client/type/payment_info.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + splitit-web-api-v3 + + Splitit's Web API + + The version of the OpenAPI document: 1.0.0 + Generated by: https://konfigthis.com +""" + +from datetime import datetime, date +import typing +from enum import Enum +from typing_extensions import TypedDict, Literal, TYPE_CHECKING + +from splitit_client.type.card_type import CardType + +class RequiredPaymentInfo(TypedDict): + pass + +class OptionalPaymentInfo(TypedDict, total=False): + CardBin: str + + CardType: CardType + +class PaymentInfo(RequiredPaymentInfo, OptionalPaymentInfo): + pass diff --git a/python/splitit_client/type/plan_error_response.py b/python/splitit_client/type/plan_error_response.py index 9e0084f..4e9f778 100644 --- a/python/splitit_client/type/plan_error_response.py +++ b/python/splitit_client/type/plan_error_response.py @@ -15,5 +15,6 @@ from typing_extensions import TypedDict, Literal, TYPE_CHECKING from splitit_client.type.failed_response import FailedResponse +from splitit_client.type.payment_info import PaymentInfo PlanErrorResponse = typing.Union[FailedResponse,typing.Dict[str, typing.Union[bool, date, datetime, dict, float, int, list, str, None]]] diff --git a/python/test/test_models/test_payment_info.py b/python/test/test_models/test_payment_info.py new file mode 100644 index 0000000..459e6c9 --- /dev/null +++ b/python/test/test_models/test_payment_info.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + splitit-web-api-v3 + + Splitit's Web API + + The version of the OpenAPI document: 1.0.0 + Generated by: https://konfigthis.com +""" + +import unittest + +import splitit_client +from splitit_client.model.payment_info import PaymentInfo +from splitit_client import configuration + + +class TestPaymentInfo(unittest.TestCase): + """PaymentInfo unit test stubs""" + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/swagger-fixed.json b/swagger-fixed.json index 270fab9..5aa88f6 100644 --- a/swagger-fixed.json +++ b/swagger-fixed.json @@ -2493,11 +2493,25 @@ "properties": { "InstallmentPlanNumber": { "type": "string" + }, + "PaymentInfo": { + "$ref": "#/components/schemas/PaymentInfo" } } } ] }, + "PaymentInfo": { + "type": "object", + "properties": { + "CardBin": { + "type": "string" + }, + "CardType": { + "$ref": "#/components/schemas/CardType" + } + } + }, "InstallmentPlanInitiateRequest": { "type": "object", "properties": { diff --git a/swagger.json b/swagger.json index 9a71ba5..6e2aa55 100644 --- a/swagger.json +++ b/swagger.json @@ -1699,11 +1699,25 @@ "properties": { "InstallmentPlanNumber": { "type": "string" + }, + "PaymentInfo": { + "$ref": "#/definitions/PaymentInfo" } } } ] }, + "PaymentInfo": { + "type": "object", + "properties": { + "CardBin": { + "type": "string" + }, + "CardType": { + "$ref": "#/definitions/CardType" + } + } + }, "InstallmentPlanInitiateRequest": { "type": "object", "properties": { diff --git a/typescript/.konfig/generate-id.txt b/typescript/.konfig/generate-id.txt index cb69078..6eb0983 100644 --- a/typescript/.konfig/generate-id.txt +++ b/typescript/.konfig/generate-id.txt @@ -1 +1 @@ -0b810a23-4746-49e7-9e36-f34ff9929554 \ No newline at end of file +3e0235b9-32f0-4b4a-881c-87e0fdc46df1 \ No newline at end of file diff --git a/typescript/models/index.ts b/typescript/models/index.ts index 834db99..122eff4 100644 --- a/typescript/models/index.ts +++ b/typescript/models/index.ts @@ -34,6 +34,7 @@ export * from './links-data'; export * from './links-model'; export * from './mocker-shopper-token'; export * from './model-error'; +export * from './payment-info'; export * from './payment-method-model'; export * from './payment-method-type'; export * from './payment-plan-option-model'; diff --git a/typescript/models/payment-info.ts b/typescript/models/payment-info.ts new file mode 100644 index 0000000..f273339 --- /dev/null +++ b/typescript/models/payment-info.ts @@ -0,0 +1,34 @@ +/* +splitit-web-api-v3 + +Splitit's Web API + +The version of the OpenAPI document: 1.0.0 + + +NOTE: This file is auto generated by Konfig (https://konfigthis.com). +*/ +import type * as buffer from "buffer" + +import { CardType } from './card-type'; + +/** + * + * @export + * @interface PaymentInfo + */ +export interface PaymentInfo { + /** + * + * @type {string} + * @memberof PaymentInfo + */ + 'CardBin'?: string; + /** + * + * @type {CardType} + * @memberof PaymentInfo + */ + 'CardType'?: CardType; +} + diff --git a/typescript/models/plan-error-response-all-of.ts b/typescript/models/plan-error-response-all-of.ts index 2d754c8..530c2f0 100644 --- a/typescript/models/plan-error-response-all-of.ts +++ b/typescript/models/plan-error-response-all-of.ts @@ -10,6 +10,7 @@ NOTE: This file is auto generated by Konfig (https://konfigthis.com). */ import type * as buffer from "buffer" +import { PaymentInfo } from './payment-info'; /** * @@ -23,5 +24,11 @@ export interface PlanErrorResponseAllOf { * @memberof PlanErrorResponseAllOf */ 'InstallmentPlanNumber'?: string; + /** + * + * @type {PaymentInfo} + * @memberof PlanErrorResponseAllOf + */ + 'PaymentInfo'?: PaymentInfo; } diff --git a/typescript/models/plan-error-response.ts b/typescript/models/plan-error-response.ts index 96c627b..54d8b2c 100644 --- a/typescript/models/plan-error-response.ts +++ b/typescript/models/plan-error-response.ts @@ -12,6 +12,7 @@ import type * as buffer from "buffer" import { ErrorExtended } from './error-extended'; import { FailedResponse } from './failed-response'; +import { PaymentInfo } from './payment-info'; import { PlanErrorResponseAllOf } from './plan-error-response-all-of'; /**