From bef68239bd367a0cb5f40ede906b9b27b7bbe1dc Mon Sep 17 00:00:00 2001 From: "konfig-bot[bot]" <121480725+konfig-bot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:01:45 +0000 Subject: [PATCH 1/3] Update OpenAPI Specification (swagger.json) --- swagger.json | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/swagger.json b/swagger.json index 9c49353..b630cd4 100644 --- a/swagger.json +++ b/swagger.json @@ -888,6 +888,88 @@ } } } + }, + "/api/installmentplans/{ipn}/legal": { + "get": { + "tags": [ + "InstallmentPlan" + ], + "operationId": "InstallmentPlan_GetEligibilityTermsAndCondition", + "parameters": [ + { + "type": "string", + "name": "ipn", + "in": "path", + "required": true, + "x-nullable": false + }, + { + "name": "X-Splitit-IdempotencyKey", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Authorization", + "in": "header", + "required": true, + "description": "Bearer token", + "schema": { + "type": "string" + }, + "default": "Bearer " + }, + { + "name": "X-Splitit-TouchPoint", + "in": "header", + "required": true, + "description": "TouchPoint", + "schema": { + "type": "string" + }, + "default": "" + } + ], + "responses": { + "200": { + "x-nullable": false, + "description": "", + "schema": { + "$ref": "#/definitions/EligibilityTermsAndConditionResponse" + } + }, + "401": { + "x-nullable": false, + "description": "", + "schema": { + "$ref": "#/definitions/FailedResponse" + } + }, + "403": { + "x-nullable": false, + "description": "", + "schema": { + "$ref": "#/definitions/FailedResponse" + } + }, + "404": { + "x-nullable": false, + "description": "", + "schema": { + "$ref": "#/definitions/FailedResponse" + } + }, + "500": { + "x-nullable": false, + "description": "", + "schema": { + "$ref": "#/definitions/FailedResponse" + } + } + } + } } }, "definitions": { @@ -2240,6 +2322,17 @@ "type": "string" } } + }, + "EligibilityTermsAndConditionResponse": { + "type": "object", + "properties": { + "TermsAndConditions": { + "type": "string" + }, + "PrivacyPolicy": { + "type": "string" + } + } } } } \ No newline at end of file From c62178614949bc9d9ce05fe5ef7df27a4733cf2c Mon Sep 17 00:00:00 2001 From: konfig-publisher Date: Thu, 19 Sep 2024 15:04:02 +0000 Subject: [PATCH 2/3] Regenerate SDKs --- .konfig/changesets/tall-pillows-ask.md | 11 + STATISTICS.md | 16 +- csharp/.konfig/generate-id.txt | 2 +- csharp/README.md | 2 + csharp/Splitit.Web.Net.sln | 10 +- .../EligibilityTermsAndConditionResponse.md | 11 + csharp/docs/InstallmentPlanApi.md | 94 +++ .../Api/InstallmentPlanApiTests.cs | 29 + ...igibilityTermsAndConditionResponseTests.cs | 78 +++ .../Api/InstallmentPlanApiGenerated.cs | 269 ++++++++ .../EligibilityTermsAndConditionResponse.cs | 146 +++++ go/.konfig/generate-id.txt | 2 +- go/README.md | 2 + go/api/openapi.yaml | 140 +++++ go/api_installment_plan.go | 158 +++++ .../EligibilityTermsAndConditionResponse.md | 82 +++ go/docs/InstallmentPlanApi.md | 44 ++ ...ligibility_terms_and_condition_response.go | 151 +++++ go/test/api_installment_plan_test.go | 16 + java/.konfig/generate-id.txt | 2 +- java/README.md | 37 ++ java/api/openapi.yaml | 146 +++++ .../EligibilityTermsAndConditionResponse.md | 14 + java/docs/InstallmentPlanApi.md | 100 +++ .../com/konfigthis/splitit/client/JSON.java | 1 + .../client/api/InstallmentPlanApi.java | 6 + .../api/InstallmentPlanApiGenerated.java | 189 ++++++ .../EligibilityTermsAndConditionResponse.java | 329 ++++++++++ .../client/api/InstallmentPlanApiTest.java | 14 + ...gibilityTermsAndConditionResponseTest.java | 57 ++ php | 2 +- phpGuzzle6 | 2 +- python/.konfig/generate-id.txt | 2 +- python/README.md | 39 ++ python/splitit_client/apis/path_to_api.py | 3 + .../paths/api_installmentplans_ipn_legal.py | 7 + .../tags/installment_plan_api_generated.py | 2 + ...ligibility_terms_and_condition_response.py | 86 +++ ...igibility_terms_and_condition_response.pyi | 86 +++ python/splitit_client/models/__init__.py | 1 + .../splitit_client/operation_parameter_map.py | 13 + python/splitit_client/paths/__init__.py | 1 + .../__init__.py | 7 + .../api_installmentplans_ipn_legal/get.py | 577 ++++++++++++++++++ .../api_installmentplans_ipn_legal/get.pyi | 565 +++++++++++++++++ ...ligibility_terms_and_condition_response.py | 27 + ...ligibility_terms_and_condition_response.py | 25 + .../__init__.py | 0 .../test_get.py | 45 ++ swagger-fixed.json | 162 +++++ typescript/.konfig/generate-id.txt | 2 +- typescript/README.md | 39 ++ .../api/installmentplan-api-generated.ts | 120 ++++ typescript/common.ts | 55 +- ...ligibility-terms-and-condition-response.ts | 33 + typescript/models/index.ts | 1 + typescript/operationParameterMap.ts | 13 + 57 files changed, 4032 insertions(+), 41 deletions(-) create mode 100644 .konfig/changesets/tall-pillows-ask.md create mode 100644 csharp/docs/EligibilityTermsAndConditionResponse.md create mode 100644 csharp/src/Splitit.Web.Net.Test/Model/EligibilityTermsAndConditionResponseTests.cs create mode 100644 csharp/src/Splitit.Web.Net/Model/EligibilityTermsAndConditionResponse.cs create mode 100644 go/docs/EligibilityTermsAndConditionResponse.md create mode 100644 go/model_eligibility_terms_and_condition_response.go create mode 100644 java/docs/EligibilityTermsAndConditionResponse.md create mode 100644 java/src/main/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponse.java create mode 100644 java/src/test/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponseTest.java create mode 100644 python/splitit_client/apis/paths/api_installmentplans_ipn_legal.py create mode 100644 python/splitit_client/model/eligibility_terms_and_condition_response.py create mode 100644 python/splitit_client/model/eligibility_terms_and_condition_response.pyi create mode 100644 python/splitit_client/paths/api_installmentplans_ipn_legal/__init__.py create mode 100644 python/splitit_client/paths/api_installmentplans_ipn_legal/get.py create mode 100644 python/splitit_client/paths/api_installmentplans_ipn_legal/get.pyi create mode 100644 python/splitit_client/type/eligibility_terms_and_condition_response.py create mode 100644 python/test/test_models/test_eligibility_terms_and_condition_response.py create mode 100644 python/test/test_paths/test_api_installmentplans_ipn_legal/__init__.py create mode 100644 python/test/test_paths/test_api_installmentplans_ipn_legal/test_get.py create mode 100644 typescript/models/eligibility-terms-and-condition-response.ts diff --git a/.konfig/changesets/tall-pillows-ask.md b/.konfig/changesets/tall-pillows-ask.md new file mode 100644 index 0000000..eb77693 --- /dev/null +++ b/.konfig/changesets/tall-pillows-ask.md @@ -0,0 +1,11 @@ +--- +java: patch +python: patch +typescript: patch +csharp: patch +php: patch +go: patch +phpGuzzle6: patch +--- + +Regenerate SDKs diff --git a/STATISTICS.md b/STATISTICS.md index 94bbda9..8d122bd 100644 --- a/STATISTICS.md +++ b/STATISTICS.md @@ -2,11 +2,11 @@ | SDK Name | Lines of Code | | -------- | ------------- | -| java | 42046 | -| python | 39710 | -| typescript | 12148 | -| csharp | 25643 | -| php | 42688 | -| go | 30063 | -| phpGuzzle6 | 42688 | -| **Total** | 234986 | +| java | 42939 | +| python | 41193 | +| typescript | 12367 | +| csharp | 26272 | +| php | 43719 | +| go | 30656 | +| phpGuzzle6 | 43719 | +| **Total** | 240865 | diff --git a/csharp/.konfig/generate-id.txt b/csharp/.konfig/generate-id.txt index a9f7cee..194038f 100644 --- a/csharp/.konfig/generate-id.txt +++ b/csharp/.konfig/generate-id.txt @@ -1 +1 @@ -fe1d252b-9c2a-4e7e-9e01-0a110c68633a \ No newline at end of file +e52a4d5f-7b21-4f9a-8380-7a784f10dd2d \ No newline at end of file diff --git a/csharp/README.md b/csharp/README.md index 08bc705..241e52b 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -102,6 +102,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *InstallmentPlanApi* | [**CheckEligibility**](docs/InstallmentPlanApi.md#checkeligibility) | **POST** /api/installmentplans/check-eligibility | *InstallmentPlanApi* | [**Get**](docs/InstallmentPlanApi.md#get) | **GET** /api/installmentplans/{installmentPlanNumber} | +*InstallmentPlanApi* | [**GetEligibilityTermsAndCondition**](docs/InstallmentPlanApi.md#geteligibilitytermsandcondition) | **GET** /api/installmentplans/{ipn}/legal | *InstallmentPlanApi* | [**Post**](docs/InstallmentPlanApi.md#post) | **POST** /api/installmentplans/initiate | *InstallmentPlanApi* | [**Post2**](docs/InstallmentPlanApi.md#post2) | **POST** /api/installmentplans | *InstallmentPlanApi* | [**Refund**](docs/InstallmentPlanApi.md#refund) | **POST** /api/installmentplans/{installmentPlanNumber}/refund | @@ -121,6 +122,7 @@ Class | Method | HTTP request | Description - [CardData](docs/CardData.md) - [CardType](docs/CardType.md) - [CheckInstallmentsEligibilityRequest](docs/CheckInstallmentsEligibilityRequest.md) + - [EligibilityTermsAndConditionResponse](docs/EligibilityTermsAndConditionResponse.md) - [Error](docs/Error.md) - [ErrorExtended](docs/ErrorExtended.md) - [ErrorExtendedAllOf](docs/ErrorExtendedAllOf.md) diff --git a/csharp/Splitit.Web.Net.sln b/csharp/Splitit.Web.Net.sln index bafa2d1..3711db3 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", "{E1C4375C-779B-429F-9058-0A2F3C4BC73E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splitit.Web.Net", "src\Splitit.Web.Net\Splitit.Web.Net.csproj", "{A9C862E9-B2B9-4B6A-B13E-4FB84E3878B4}" 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 - {E1C4375C-779B-429F-9058-0A2F3C4BC73E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E1C4375C-779B-429F-9058-0A2F3C4BC73E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E1C4375C-779B-429F-9058-0A2F3C4BC73E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E1C4375C-779B-429F-9058-0A2F3C4BC73E}.Release|Any CPU.Build.0 = Release|Any CPU + {A9C862E9-B2B9-4B6A-B13E-4FB84E3878B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9C862E9-B2B9-4B6A-B13E-4FB84E3878B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9C862E9-B2B9-4B6A-B13E-4FB84E3878B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9C862E9-B2B9-4B6A-B13E-4FB84E3878B4}.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/EligibilityTermsAndConditionResponse.md b/csharp/docs/EligibilityTermsAndConditionResponse.md new file mode 100644 index 0000000..8e9acc8 --- /dev/null +++ b/csharp/docs/EligibilityTermsAndConditionResponse.md @@ -0,0 +1,11 @@ +# Splitit.Web.Net.Model.EligibilityTermsAndConditionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TermsAndConditions** | **string** | | [optional] +**PrivacyPolicy** | **string** | | [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/InstallmentPlanApi.md b/csharp/docs/InstallmentPlanApi.md index b42c939..d3e2aae 100644 --- a/csharp/docs/InstallmentPlanApi.md +++ b/csharp/docs/InstallmentPlanApi.md @@ -6,6 +6,7 @@ All URIs are relative to *https://web-api-v3.production.splitit.com* |--------|--------------|-------------| | [**CheckEligibility**](InstallmentPlanApi.md#checkeligibility) | **POST** /api/installmentplans/check-eligibility | | | [**Get**](InstallmentPlanApi.md#get) | **GET** /api/installmentplans/{installmentPlanNumber} | | +| [**GetEligibilityTermsAndCondition**](InstallmentPlanApi.md#geteligibilitytermsandcondition) | **GET** /api/installmentplans/{ipn}/legal | | | [**Post**](InstallmentPlanApi.md#post) | **POST** /api/installmentplans/initiate | | | [**Post2**](InstallmentPlanApi.md#post2) | **POST** /api/installmentplans | | | [**Refund**](InstallmentPlanApi.md#refund) | **POST** /api/installmentplans/{installmentPlanNumber}/refund | | @@ -211,6 +212,99 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **GetEligibilityTermsAndCondition** + + + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Splitit.Web.Net.Client; +using Splitit.Web.Net.Model; + +namespace Example +{ + public class GetEligibilityTermsAndConditionExample + { + public static void Main() + { + SplititClient client = new SplititClient(); + // Configure OAuth2 credentials for "application" OAuth flow + client.SetOAuthClientId(System.Environment.GetEnvironmentVariable("CLIENT_ID")); + client.SetOAuthClientSecret(System.Environment.GetEnvironmentVariable("CLIENT_SECRET")); + + var ipn = "ipn_example"; + var xSplititIdempotencyKey = "xSplititIdempotencyKey_example"; + var xSplititTouchPoint = ""; // TouchPoint (default to "") + + try + { + EligibilityTermsAndConditionResponse result = client.InstallmentPlan.GetEligibilityTermsAndCondition(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling InstallmentPlanApi.GetEligibilityTermsAndCondition: " + e.Message); + Console.WriteLine("Status Code: "+ e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + catch (ClientException e) + { + Console.WriteLine(e.Response.StatusCode); + Console.WriteLine(e.Response.RawContent); + Console.WriteLine(e.InnerException); + } + } + } +} +``` + +#### Using the GetEligibilityTermsAndConditionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.GetEligibilityTermsAndConditionWithHttpInfo(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling InstallmentPlanApi.GetEligibilityTermsAndConditionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **ipn** | **string** | | | +| **xSplititIdempotencyKey** | **string** | | | +| **xSplititTouchPoint** | **string** | TouchPoint | [default to ""] | + +### Return type + +[**EligibilityTermsAndConditionResponse**](EligibilityTermsAndConditionResponse.md) + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **401** | | - | +| **403** | | - | +| **404** | | - | +| **500** | | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + # **Post** diff --git a/csharp/src/Splitit.Web.Net.Test/Api/InstallmentPlanApiTests.cs b/csharp/src/Splitit.Web.Net.Test/Api/InstallmentPlanApiTests.cs index a1b113a..4bdb79a 100644 --- a/csharp/src/Splitit.Web.Net.Test/Api/InstallmentPlanApiTests.cs +++ b/csharp/src/Splitit.Web.Net.Test/Api/InstallmentPlanApiTests.cs @@ -112,6 +112,35 @@ public void GetTest() } } + /// + /// Test GetEligibilityTermsAndCondition + /// + [Fact] + public void GetEligibilityTermsAndConditionTest() + { + var ipn = "ipn_example"; + var xSplititIdempotencyKey = "xSplititIdempotencyKey_example"; + var xSplititTouchPoint = ""; // TouchPoint (default to "") + + try + { + EligibilityTermsAndConditionResponse result = client.InstallmentPlan.GetEligibilityTermsAndCondition(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling InstallmentPlanApi.GetEligibilityTermsAndCondition: " + e.Message); + Console.WriteLine("Status Code: "+ e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + catch (ClientException e) + { + Console.WriteLine(e.Response.StatusCode); + Console.WriteLine(e.Response.RawContent); + Console.WriteLine(e.InnerException); + } + } + /// /// Test Post /// diff --git a/csharp/src/Splitit.Web.Net.Test/Model/EligibilityTermsAndConditionResponseTests.cs b/csharp/src/Splitit.Web.Net.Test/Model/EligibilityTermsAndConditionResponseTests.cs new file mode 100644 index 0000000..8c91799 --- /dev/null +++ b/csharp/src/Splitit.Web.Net.Test/Model/EligibilityTermsAndConditionResponseTests.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 EligibilityTermsAndConditionResponse + /// + /// + /// This file is automatically generated by Konfig (https://konfigthis.com). + /// Please update the test case below to test the model. + /// + public class EligibilityTermsAndConditionResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EligibilityTermsAndConditionResponse + //private EligibilityTermsAndConditionResponse instance; + + public EligibilityTermsAndConditionResponseTests() + { + // TODO uncomment below to create an instance of EligibilityTermsAndConditionResponse + //instance = new EligibilityTermsAndConditionResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EligibilityTermsAndConditionResponse + /// + [Fact] + public void EligibilityTermsAndConditionResponseInstanceTest() + { + // TODO uncomment below to test "IsType" EligibilityTermsAndConditionResponse + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TermsAndConditions' + /// + [Fact] + public void TermsAndConditionsTest() + { + // TODO unit test for the property 'TermsAndConditions' + } + /// + /// Test the property 'PrivacyPolicy' + /// + [Fact] + public void PrivacyPolicyTest() + { + // TODO unit test for the property 'PrivacyPolicy' + } + + } + +} diff --git a/csharp/src/Splitit.Web.Net/Api/InstallmentPlanApiGenerated.cs b/csharp/src/Splitit.Web.Net/Api/InstallmentPlanApiGenerated.cs index 830335c..f072cf0 100644 --- a/csharp/src/Splitit.Web.Net/Api/InstallmentPlanApiGenerated.cs +++ b/csharp/src/Splitit.Web.Net/Api/InstallmentPlanApiGenerated.cs @@ -79,6 +79,30 @@ public interface IInstallmentPlanApiSync : IApiAccessor /// /// /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// EligibilityTermsAndConditionResponse + EligibilityTermsAndConditionResponse GetEligibilityTermsAndCondition(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// ApiResponse of EligibilityTermsAndConditionResponse + ApiResponse GetEligibilityTermsAndConditionWithHttpInfo(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call /// /// TouchPoint /// @@ -333,6 +357,35 @@ public interface IInstallmentPlanApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of EligibilityTermsAndConditionResponse + System.Threading.Tasks.Task GetEligibilityTermsAndConditionAsync(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (EligibilityTermsAndConditionResponse) + System.Threading.Tasks.Task> GetEligibilityTermsAndConditionWithHttpInfoAsync(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call /// /// TouchPoint /// @@ -1105,6 +1158,222 @@ public Splitit.Web.Net.Client.ApiResponse GetWithHtt return localVarResponse; } + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// EligibilityTermsAndConditionResponse + public EligibilityTermsAndConditionResponse GetEligibilityTermsAndCondition(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0) + { + Splitit.Web.Net.Client.ApiResponse localVarResponse = GetEligibilityTermsAndConditionWithHttpInfo(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// ApiResponse of EligibilityTermsAndConditionResponse + public Splitit.Web.Net.Client.ApiResponse GetEligibilityTermsAndConditionWithHttpInfo(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0) + { + // verify the required parameter 'ipn' is set + if (ipn == null) + { + throw new Splitit.Web.Net.Client.ApiException(400, "Missing required parameter 'ipn' when calling InstallmentPlanApi->GetEligibilityTermsAndCondition"); + } + + // verify the required parameter 'xSplititIdempotencyKey' is set + if (xSplititIdempotencyKey == null) + { + throw new Splitit.Web.Net.Client.ApiException(400, "Missing required parameter 'xSplititIdempotencyKey' when calling InstallmentPlanApi->GetEligibilityTermsAndCondition"); + } + + // verify the required parameter 'xSplititTouchPoint' is set + if (xSplititTouchPoint == null) + { + throw new Splitit.Web.Net.Client.ApiException(400, "Missing required parameter 'xSplititTouchPoint' when calling InstallmentPlanApi->GetEligibilityTermsAndCondition"); + } + + Splitit.Web.Net.Client.RequestOptions localVarRequestOptions = new Splitit.Web.Net.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json", + "text/json", + "text/plain" + }; + + var localVarContentType = Splitit.Web.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Splitit.Web.Net.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("ipn", Splitit.Web.Net.Client.ClientUtils.ParameterToString(ipn)); // path parameter + localVarRequestOptions.HeaderParameters.Add("X-Splitit-IdempotencyKey", Splitit.Web.Net.Client.ClientUtils.ParameterToString(xSplititIdempotencyKey)); // header parameter + localVarRequestOptions.HeaderParameters.Add("X-Splitit-TouchPoint", Splitit.Web.Net.Client.ClientUtils.ParameterToString(xSplititTouchPoint)); // header parameter + + localVarRequestOptions.Operation = "InstallmentPlanApi.GetEligibilityTermsAndCondition"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (oauth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/installmentplans/{ipn}/legal", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEligibilityTermsAndCondition", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of EligibilityTermsAndConditionResponse + public async System.Threading.Tasks.Task GetEligibilityTermsAndConditionAsync(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Splitit.Web.Net.Client.ApiResponse localVarResponse = await GetEligibilityTermsAndConditionWithHttpInfoAsync(ipn, xSplititIdempotencyKey, xSplititTouchPoint, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// TouchPoint + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (EligibilityTermsAndConditionResponse) + public virtual async System.Threading.Tasks.Task> GetEligibilityTermsAndConditionWithHttpInfoAsync(string ipn, string xSplititIdempotencyKey, string xSplititTouchPoint, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'ipn' is set + if (ipn == null) + { + throw new Splitit.Web.Net.Client.ApiException(400, "Missing required parameter 'ipn' when calling InstallmentPlanApi->GetEligibilityTermsAndCondition"); + } + + // verify the required parameter 'xSplititIdempotencyKey' is set + if (xSplititIdempotencyKey == null) + { + throw new Splitit.Web.Net.Client.ApiException(400, "Missing required parameter 'xSplititIdempotencyKey' when calling InstallmentPlanApi->GetEligibilityTermsAndCondition"); + } + + // verify the required parameter 'xSplititTouchPoint' is set + if (xSplititTouchPoint == null) + { + throw new Splitit.Web.Net.Client.ApiException(400, "Missing required parameter 'xSplititTouchPoint' when calling InstallmentPlanApi->GetEligibilityTermsAndCondition"); + } + + + Splitit.Web.Net.Client.RequestOptions localVarRequestOptions = new Splitit.Web.Net.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json", + "text/json", + "text/plain" + }; + + var localVarContentType = Splitit.Web.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Splitit.Web.Net.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("ipn", Splitit.Web.Net.Client.ClientUtils.ParameterToString(ipn)); // path parameter + localVarRequestOptions.HeaderParameters.Add("X-Splitit-IdempotencyKey", Splitit.Web.Net.Client.ClientUtils.ParameterToString(xSplititIdempotencyKey, dataFormat: "")); // header parameter + localVarRequestOptions.HeaderParameters.Add("X-Splitit-TouchPoint", Splitit.Web.Net.Client.ClientUtils.ParameterToString(xSplititTouchPoint, dataFormat: "")); // header parameter + + localVarRequestOptions.Operation = "InstallmentPlanApi.GetEligibilityTermsAndCondition"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (oauth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/installmentplans/{ipn}/legal", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEligibilityTermsAndCondition", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// /// diff --git a/csharp/src/Splitit.Web.Net/Model/EligibilityTermsAndConditionResponse.cs b/csharp/src/Splitit.Web.Net/Model/EligibilityTermsAndConditionResponse.cs new file mode 100644 index 0000000..dd2de0c --- /dev/null +++ b/csharp/src/Splitit.Web.Net/Model/EligibilityTermsAndConditionResponse.cs @@ -0,0 +1,146 @@ +/* + * 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 +{ + /// + /// EligibilityTermsAndConditionResponse + /// + [DataContract(Name = "EligibilityTermsAndConditionResponse")] + public partial class EligibilityTermsAndConditionResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// termsAndConditions. + /// privacyPolicy. + public EligibilityTermsAndConditionResponse(string termsAndConditions = default(string), string privacyPolicy = default(string)) + { + this.TermsAndConditions = termsAndConditions; + this.PrivacyPolicy = privacyPolicy; + } + + /// + /// Gets or Sets TermsAndConditions + /// + [DataMember(Name = "TermsAndConditions", EmitDefaultValue = false)] + public string TermsAndConditions { get; set; } + + /// + /// Gets or Sets PrivacyPolicy + /// + [DataMember(Name = "PrivacyPolicy", EmitDefaultValue = false)] + public string PrivacyPolicy { 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 EligibilityTermsAndConditionResponse {\n"); + sb.Append(" TermsAndConditions: ").Append(TermsAndConditions).Append("\n"); + sb.Append(" PrivacyPolicy: ").Append(PrivacyPolicy).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 EligibilityTermsAndConditionResponse); + } + + /// + /// Returns true if EligibilityTermsAndConditionResponse instances are equal + /// + /// Instance of EligibilityTermsAndConditionResponse to be compared + /// Boolean + public bool Equals(EligibilityTermsAndConditionResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.TermsAndConditions == input.TermsAndConditions || + (this.TermsAndConditions != null && + this.TermsAndConditions.Equals(input.TermsAndConditions)) + ) && + ( + this.PrivacyPolicy == input.PrivacyPolicy || + (this.PrivacyPolicy != null && + this.PrivacyPolicy.Equals(input.PrivacyPolicy)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TermsAndConditions != null) + { + hashCode = (hashCode * 59) + this.TermsAndConditions.GetHashCode(); + } + if (this.PrivacyPolicy != null) + { + hashCode = (hashCode * 59) + this.PrivacyPolicy.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/go/.konfig/generate-id.txt b/go/.konfig/generate-id.txt index a9f7cee..194038f 100644 --- a/go/.konfig/generate-id.txt +++ b/go/.konfig/generate-id.txt @@ -1 +1 @@ -fe1d252b-9c2a-4e7e-9e01-0a110c68633a \ No newline at end of file +e52a4d5f-7b21-4f9a-8380-7a784f10dd2d \ No newline at end of file diff --git a/go/README.md b/go/README.md index bca82d7..26f7319 100644 --- a/go/README.md +++ b/go/README.md @@ -63,6 +63,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *InstallmentPlanApi* | [**CheckEligibility**](docs/InstallmentPlanApi.md#checkeligibility) | **Post** /api/installmentplans/check-eligibility | *InstallmentPlanApi* | [**Get**](docs/InstallmentPlanApi.md#get) | **Get** /api/installmentplans/{installmentPlanNumber} | +*InstallmentPlanApi* | [**GetEligibilityTermsAndCondition**](docs/InstallmentPlanApi.md#geteligibilitytermsandcondition) | **Get** /api/installmentplans/{ipn}/legal | *InstallmentPlanApi* | [**Post**](docs/InstallmentPlanApi.md#post) | **Post** /api/installmentplans/initiate | *InstallmentPlanApi* | [**Post2**](docs/InstallmentPlanApi.md#post2) | **Post** /api/installmentplans | *InstallmentPlanApi* | [**Refund**](docs/InstallmentPlanApi.md#refund) | **Post** /api/installmentplans/{installmentPlanNumber}/refund | @@ -82,6 +83,7 @@ Class | Method | HTTP request | Description - [CardData](docs/CardData.md) - [CardType](docs/CardType.md) - [CheckInstallmentsEligibilityRequest](docs/CheckInstallmentsEligibilityRequest.md) + - [EligibilityTermsAndConditionResponse](docs/EligibilityTermsAndConditionResponse.md) - [Error](docs/Error.md) - [ErrorExtended](docs/ErrorExtended.md) - [ErrorExtendedAllOf](docs/ErrorExtendedAllOf.md) diff --git a/go/api/openapi.yaml b/go/api/openapi.yaml index a2dd54c..9b57f50 100644 --- a/go/api/openapi.yaml +++ b/go/api/openapi.yaml @@ -1103,6 +1103,110 @@ paths: - InstallmentPlan x-konfig-operation-can-have-single-parameter: true x-konfig-single-parameter-schema: konfig-generated-schema-single-parameter-schema-post--api-installmentplans-check-eligibility + /api/installmentplans/{ipn}/legal: + get: + operationId: InstallmentPlan_GetEligibilityTermsAndCondition + parameters: + - explode: false + in: path + name: ipn + required: true + schema: + type: string + style: simple + x-nullable: false + - explode: false + in: header + name: X-Splitit-IdempotencyKey + required: true + schema: + type: string + style: simple + - description: TouchPoint + explode: false + in: header + name: X-Splitit-TouchPoint + required: true + schema: + default: "" + example: "" + type: string + x-konfig-original-example: "" + x-konfig-generated-schema: konfig-generated-schema-paths--api-installmentplans-ipn-legal-get-parameters-2-schema + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EligibilityTermsAndConditionResponse' + text/json: + schema: + $ref: '#/components/schemas/EligibilityTermsAndConditionResponse' + text/plain: + schema: + $ref: '#/components/schemas/EligibilityTermsAndConditionResponse' + description: "" + x-nullable: false + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + security: + - oauth: + - api.v3 + tags: + - InstallmentPlan + x-konfig-operation-can-have-single-parameter: true + x-konfig-single-parameter-schema: konfig-generated-schema-single-parameter-schema-get--api-installmentplans-ipn-legal components: schemas: FailedResponse: @@ -2849,6 +2953,16 @@ components: TransactionId: type: string type: object + EligibilityTermsAndConditionResponse: + example: + TermsAndConditions: TermsAndConditions + PrivacyPolicy: PrivacyPolicy + properties: + TermsAndConditions: + type: string + PrivacyPolicy: + type: string + type: object konfig-generated-schema-paths--api-installmentplans-installmentPlanNumber-get-parameters-2-schema: example: "" type: string @@ -2885,6 +2999,10 @@ components: example: "" type: string x-do-not-generate: true + konfig-generated-schema-paths--api-installmentplans-ipn-legal-get-parameters-2-schema: + example: "" + type: string + x-do-not-generate: true konfig-generated-schema-single-parameter-schema-get--api-installmentplans-installmentPlanNumber: properties: installmentPlanNumber: @@ -3176,6 +3294,28 @@ components: x-konfig-is-parameter: - X-Splitit-IdempotencyKey - X-Splitit-TouchPoint + konfig-generated-schema-single-parameter-schema-get--api-installmentplans-ipn-legal: + properties: + ipn: + type: string + X-Splitit-IdempotencyKey: + type: string + X-Splitit-TouchPoint: + default: "" + example: "" + type: string + x-konfig-original-example: "" + x-konfig-generated-schema: konfig-generated-schema-paths--api-installmentplans-ipn-legal-get-parameters-2-schema + required: + - X-Splitit-IdempotencyKey + - X-Splitit-TouchPoint + - ipn + type: object + x-do-not-generate: true + x-konfig-is-parameter: + - ipn + - X-Splitit-IdempotencyKey + - X-Splitit-TouchPoint ErrorExtended_allOf: properties: ExtraData: diff --git a/go/api_installment_plan.go b/go/api_installment_plan.go index 29c94c3..2eb3a34 100644 --- a/go/api_installment_plan.go +++ b/go/api_installment_plan.go @@ -342,6 +342,164 @@ func (a *InstallmentPlanApiService) GetExecute(r InstallmentPlanApiGetRequest) ( return localVarReturnValue, localVarHTTPResponse, nil } +type InstallmentPlanApiGetEligibilityTermsAndConditionRequest struct { + ctx context.Context + ApiService *InstallmentPlanApiService + ipn string + xSplititIdempotencyKey string + xSplititTouchPoint string +} + +func (r InstallmentPlanApiGetEligibilityTermsAndConditionRequest) Execute() (*EligibilityTermsAndConditionResponse, *http.Response, error) { + return r.ApiService.GetEligibilityTermsAndConditionExecute(r) +} + +/* +GetEligibilityTermsAndCondition Method for GetEligibilityTermsAndCondition + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ipn + @param xSplititIdempotencyKey + @param xSplititTouchPoint TouchPoint + @return InstallmentPlanApiGetEligibilityTermsAndConditionRequest +*/ +func (a *InstallmentPlanApiService) GetEligibilityTermsAndCondition(ipn string, xSplititIdempotencyKey string, xSplititTouchPoint string) InstallmentPlanApiGetEligibilityTermsAndConditionRequest { + return InstallmentPlanApiGetEligibilityTermsAndConditionRequest{ + ApiService: a, + ctx: a.client.cfg.Context, + ipn: ipn, + xSplititIdempotencyKey: xSplititIdempotencyKey, + xSplititTouchPoint: xSplititTouchPoint, + } +} + +// Execute executes the request +// @return EligibilityTermsAndConditionResponse +func (a *InstallmentPlanApiService) GetEligibilityTermsAndConditionExecute(r InstallmentPlanApiGetEligibilityTermsAndConditionRequest) (*EligibilityTermsAndConditionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EligibilityTermsAndConditionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InstallmentPlanApiService.GetEligibilityTermsAndCondition") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + subpath := "/api/installmentplans/{ipn}/legal" + localVarPath := localBasePath + subpath + if a.client.cfg.Host != "" { + localVarPath = a.client.cfg.Scheme + "://" + a.client.cfg.Host + subpath + } + localVarPath = strings.Replace(localVarPath, "{"+"ipn"+"}", url.PathEscape(parameterToString(r.ipn, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + localVarHeaderParams["X-Splitit-IdempotencyKey"] = parameterToString(r.xSplititIdempotencyKey, "") + localVarHeaderParams["X-Splitit-TouchPoint"] = parameterToString(r.xSplititTouchPoint, "") + + prepareRequestBefore(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v FailedResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v FailedResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v FailedResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v FailedResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type InstallmentPlanApiPostRequest struct { ctx context.Context ApiService *InstallmentPlanApiService diff --git a/go/docs/EligibilityTermsAndConditionResponse.md b/go/docs/EligibilityTermsAndConditionResponse.md new file mode 100644 index 0000000..01af1c5 --- /dev/null +++ b/go/docs/EligibilityTermsAndConditionResponse.md @@ -0,0 +1,82 @@ +# EligibilityTermsAndConditionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TermsAndConditions** | Pointer to **string** | | [optional] +**PrivacyPolicy** | Pointer to **string** | | [optional] + +## Methods + +### NewEligibilityTermsAndConditionResponse + +`func NewEligibilityTermsAndConditionResponse() *EligibilityTermsAndConditionResponse` + +NewEligibilityTermsAndConditionResponse instantiates a new EligibilityTermsAndConditionResponse 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 + +### NewEligibilityTermsAndConditionResponseWithDefaults + +`func NewEligibilityTermsAndConditionResponseWithDefaults() *EligibilityTermsAndConditionResponse` + +NewEligibilityTermsAndConditionResponseWithDefaults instantiates a new EligibilityTermsAndConditionResponse 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 + +### GetTermsAndConditions + +`func (o *EligibilityTermsAndConditionResponse) GetTermsAndConditions() string` + +GetTermsAndConditions returns the TermsAndConditions field if non-nil, zero value otherwise. + +### GetTermsAndConditionsOk + +`func (o *EligibilityTermsAndConditionResponse) GetTermsAndConditionsOk() (*string, bool)` + +GetTermsAndConditionsOk returns a tuple with the TermsAndConditions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTermsAndConditions + +`func (o *EligibilityTermsAndConditionResponse) SetTermsAndConditions(v string)` + +SetTermsAndConditions sets TermsAndConditions field to given value. + +### HasTermsAndConditions + +`func (o *EligibilityTermsAndConditionResponse) HasTermsAndConditions() bool` + +HasTermsAndConditions returns a boolean if a field has been set. + +### GetPrivacyPolicy + +`func (o *EligibilityTermsAndConditionResponse) GetPrivacyPolicy() string` + +GetPrivacyPolicy returns the PrivacyPolicy field if non-nil, zero value otherwise. + +### GetPrivacyPolicyOk + +`func (o *EligibilityTermsAndConditionResponse) GetPrivacyPolicyOk() (*string, bool)` + +GetPrivacyPolicyOk returns a tuple with the PrivacyPolicy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivacyPolicy + +`func (o *EligibilityTermsAndConditionResponse) SetPrivacyPolicy(v string)` + +SetPrivacyPolicy sets PrivacyPolicy field to given value. + +### HasPrivacyPolicy + +`func (o *EligibilityTermsAndConditionResponse) HasPrivacyPolicy() bool` + +HasPrivacyPolicy 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/InstallmentPlanApi.md b/go/docs/InstallmentPlanApi.md index 25dd4f6..2d0fd1b 100644 --- a/go/docs/InstallmentPlanApi.md +++ b/go/docs/InstallmentPlanApi.md @@ -6,6 +6,7 @@ Method | Path | Description ------------- | ------------- | ------------- [**CheckEligibility**](InstallmentPlanApi.md#CheckEligibility) | **Post** /api/installmentplans/check-eligibility | [**Get**](InstallmentPlanApi.md#Get) | **Get** /api/installmentplans/{installmentPlanNumber} | +[**GetEligibilityTermsAndCondition**](InstallmentPlanApi.md#GetEligibilityTermsAndCondition) | **Get** /api/installmentplans/{ipn}/legal | [**Post**](InstallmentPlanApi.md#Post) | **Post** /api/installmentplans/initiate | [**Post2**](InstallmentPlanApi.md#Post2) | **Post** /api/installmentplans | [**Refund**](InstallmentPlanApi.md#Refund) | **Post** /api/installmentplans/{installmentPlanNumber}/refund | @@ -126,6 +127,49 @@ func main() { [[Back to README]](../README.md) +## GetEligibilityTermsAndCondition + + + +### Example + +```go +package main + +import ( + "fmt" + "os" + splitit "github.com/konfig-dev/splitit-web-sdks/go" +) + +func main() { + configuration := splitit.NewConfiguration() + client := splitit.NewAPIClient(configuration) + + request := client.InstallmentPlanApi.GetEligibilityTermsAndCondition( + "ipn_example", + "xSplititIdempotencyKey_example", + """", + ) + + resp, httpRes, err := request.Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InstallmentPlanApi.GetEligibilityTermsAndCondition``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", httpRes) + } + // response from `GetEligibilityTermsAndCondition`: EligibilityTermsAndConditionResponse + fmt.Fprintf(os.Stdout, "Response from `InstallmentPlanApi.GetEligibilityTermsAndCondition`: %v\n", resp) + fmt.Fprintf(os.Stdout, "Response from `EligibilityTermsAndConditionResponse.GetEligibilityTermsAndCondition.TermsAndConditions`: %v\n", *resp.TermsAndConditions) + fmt.Fprintf(os.Stdout, "Response from `EligibilityTermsAndConditionResponse.GetEligibilityTermsAndCondition.PrivacyPolicy`: %v\n", *resp.PrivacyPolicy) +} +``` + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## Post diff --git a/go/model_eligibility_terms_and_condition_response.go b/go/model_eligibility_terms_and_condition_response.go new file mode 100644 index 0000000..33259c1 --- /dev/null +++ b/go/model_eligibility_terms_and_condition_response.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" +) + +// EligibilityTermsAndConditionResponse struct for EligibilityTermsAndConditionResponse +type EligibilityTermsAndConditionResponse struct { + TermsAndConditions *string `json:"TermsAndConditions,omitempty"` + PrivacyPolicy *string `json:"PrivacyPolicy,omitempty"` +} + +// NewEligibilityTermsAndConditionResponse instantiates a new EligibilityTermsAndConditionResponse 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 NewEligibilityTermsAndConditionResponse() *EligibilityTermsAndConditionResponse { + this := EligibilityTermsAndConditionResponse{} + return &this +} + +// NewEligibilityTermsAndConditionResponseWithDefaults instantiates a new EligibilityTermsAndConditionResponse 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 NewEligibilityTermsAndConditionResponseWithDefaults() *EligibilityTermsAndConditionResponse { + this := EligibilityTermsAndConditionResponse{} + return &this +} + +// GetTermsAndConditions returns the TermsAndConditions field value if set, zero value otherwise. +func (o *EligibilityTermsAndConditionResponse) GetTermsAndConditions() string { + if o == nil || isNil(o.TermsAndConditions) { + var ret string + return ret + } + return *o.TermsAndConditions +} + +// GetTermsAndConditionsOk returns a tuple with the TermsAndConditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EligibilityTermsAndConditionResponse) GetTermsAndConditionsOk() (*string, bool) { + if o == nil || isNil(o.TermsAndConditions) { + return nil, false + } + return o.TermsAndConditions, true +} + +// HasTermsAndConditions returns a boolean if a field has been set. +func (o *EligibilityTermsAndConditionResponse) HasTermsAndConditions() bool { + if o != nil && !isNil(o.TermsAndConditions) { + return true + } + + return false +} + +// SetTermsAndConditions gets a reference to the given string and assigns it to the TermsAndConditions field. +func (o *EligibilityTermsAndConditionResponse) SetTermsAndConditions(v string) { + o.TermsAndConditions = &v +} + +// GetPrivacyPolicy returns the PrivacyPolicy field value if set, zero value otherwise. +func (o *EligibilityTermsAndConditionResponse) GetPrivacyPolicy() string { + if o == nil || isNil(o.PrivacyPolicy) { + var ret string + return ret + } + return *o.PrivacyPolicy +} + +// GetPrivacyPolicyOk returns a tuple with the PrivacyPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EligibilityTermsAndConditionResponse) GetPrivacyPolicyOk() (*string, bool) { + if o == nil || isNil(o.PrivacyPolicy) { + return nil, false + } + return o.PrivacyPolicy, true +} + +// HasPrivacyPolicy returns a boolean if a field has been set. +func (o *EligibilityTermsAndConditionResponse) HasPrivacyPolicy() bool { + if o != nil && !isNil(o.PrivacyPolicy) { + return true + } + + return false +} + +// SetPrivacyPolicy gets a reference to the given string and assigns it to the PrivacyPolicy field. +func (o *EligibilityTermsAndConditionResponse) SetPrivacyPolicy(v string) { + o.PrivacyPolicy = &v +} + +func (o EligibilityTermsAndConditionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.TermsAndConditions) { + toSerialize["TermsAndConditions"] = o.TermsAndConditions + } + if !isNil(o.PrivacyPolicy) { + toSerialize["PrivacyPolicy"] = o.PrivacyPolicy + } + return json.Marshal(toSerialize) +} + +type NullableEligibilityTermsAndConditionResponse struct { + value *EligibilityTermsAndConditionResponse + isSet bool +} + +func (v NullableEligibilityTermsAndConditionResponse) Get() *EligibilityTermsAndConditionResponse { + return v.value +} + +func (v *NullableEligibilityTermsAndConditionResponse) Set(val *EligibilityTermsAndConditionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableEligibilityTermsAndConditionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableEligibilityTermsAndConditionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEligibilityTermsAndConditionResponse(val *EligibilityTermsAndConditionResponse) *NullableEligibilityTermsAndConditionResponse { + return &NullableEligibilityTermsAndConditionResponse{value: val, isSet: true} +} + +func (v NullableEligibilityTermsAndConditionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEligibilityTermsAndConditionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/test/api_installment_plan_test.go b/go/test/api_installment_plan_test.go index 435d4fc..4414f75 100644 --- a/go/test/api_installment_plan_test.go +++ b/go/test/api_installment_plan_test.go @@ -66,6 +66,22 @@ func Test_splitit_InstallmentPlanApiService(t *testing.T) { */ }) + t.Run("Test InstallmentPlanApiService GetEligibilityTermsAndCondition", func(t *testing.T) { + /* TODO: ENG-1367 Fix parameter values for Go SDK generated tests + request := client.InstallmentPlanApi.GetEligibilityTermsAndCondition( + "ipn_example", + "xSplititIdempotencyKey_example", + """", + ) + + resp, httpRes, err := request.Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + */ + }) + t.Run("Test InstallmentPlanApiService Post", func(t *testing.T) { /* TODO: ENG-1367 Fix parameter values for Go SDK generated tests shopper := *splitit.NewShopperData() diff --git a/java/.konfig/generate-id.txt b/java/.konfig/generate-id.txt index a9f7cee..194038f 100644 --- a/java/.konfig/generate-id.txt +++ b/java/.konfig/generate-id.txt @@ -1 +1 @@ -fe1d252b-9c2a-4e7e-9e01-0a110c68633a \ No newline at end of file +e52a4d5f-7b21-4f9a-8380-7a784f10dd2d \ No newline at end of file diff --git a/java/README.md b/java/README.md index 5ffc6a7..4453c0c 100644 --- a/java/README.md +++ b/java/README.md @@ -18,6 +18,7 @@ Splitit's Web API - [Reference](#reference) * [`splitit.installmentPlan.checkEligibility`](#splititinstallmentplancheckeligibility) * [`splitit.installmentPlan.get`](#splititinstallmentplanget) + * [`splitit.installmentPlan.getEligibilityTermsAndCondition`](#splititinstallmentplangeteligibilitytermsandcondition) * [`splitit.installmentPlan.post`](#splititinstallmentplanpost) * [`splitit.installmentPlan.post2`](#splititinstallmentplanpost2) * [`splitit.installmentPlan.refund`](#splititinstallmentplanrefund) @@ -284,6 +285,42 @@ TouchPoint --- +### `splitit.installmentPlan.getEligibilityTermsAndCondition` + + + +#### 🛠️ Usage + +```java +EligibilityTermsAndConditionResponse result = client + .installmentPlan + .getEligibilityTermsAndCondition(ipn, xSplititIdempotencyKey, xSplititTouchPoint) + .execute(); +``` + +#### ⚙️ Parameters + +##### ipn: `String` + +##### xSplititIdempotencyKey: `String` + +##### xSplititTouchPoint: `String` + +TouchPoint + +#### 🔄 Return + +[EligibilityTermsAndConditionResponse](./src/main/java/com/konfigthis/client/model/EligibilityTermsAndConditionResponse.java) + +#### 🌐 Endpoint + +`/api/installmentplans/{ipn}/legal` `GET` + +[🔙 **Back to Table of Contents**](#table-of-contents) + +--- + + ### `splitit.installmentPlan.post` diff --git a/java/api/openapi.yaml b/java/api/openapi.yaml index 3c32158..5add7b2 100644 --- a/java/api/openapi.yaml +++ b/java/api/openapi.yaml @@ -1156,6 +1156,115 @@ paths: x-konfig-single-parameter-schema: konfig-generated-schema-single-parameter-schema-post--api-installmentplans-check-eligibility x-content-type: application/json x-accepts: application/json + /api/installmentplans/{ipn}/legal: + get: + operationId: InstallmentPlan_GetEligibilityTermsAndCondition + parameters: + - explode: false + in: path + name: ipn + required: true + schema: + type: string + style: simple + x-nullable: false + - explode: false + in: header + name: X-Splitit-IdempotencyKey + required: true + schema: + type: string + style: simple + - description: TouchPoint + explode: false + in: header + name: X-Splitit-TouchPoint + required: true + schema: + default: "" + example: "" + type: string + x-konfig-original-example: "" + x-konfig-generated-schema: konfig-generated-schema-paths--api-installmentplans-ipn-legal-get-parameters-2-schema + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EligibilityTermsAndConditionResponse' + text/json: + schema: + $ref: '#/components/schemas/EligibilityTermsAndConditionResponse' + text/plain: + schema: + $ref: '#/components/schemas/EligibilityTermsAndConditionResponse' + description: "" + x-nullable: false + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + x-do-not-generate: true + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + x-do-not-generate: true + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + x-do-not-generate: true + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/json: + schema: + $ref: '#/components/schemas/FailedResponse' + text/plain: + schema: + $ref: '#/components/schemas/FailedResponse' + description: "" + x-nullable: false + x-do-not-generate: true + security: + - oauth: + - api.v3 + tags: + - InstallmentPlan + x-konfig-operation-can-have-single-parameter: true + x-konfig-single-parameter-schema: konfig-generated-schema-single-parameter-schema-get--api-installmentplans-ipn-legal + x-accepts: application/json components: schemas: FailedResponse: @@ -2913,6 +3022,17 @@ components: TransactionId: type: string type: object + EligibilityTermsAndConditionResponse: + example: + TermsAndConditions: TermsAndConditions + PrivacyPolicy: PrivacyPolicy + properties: + TermsAndConditions: + type: string + PrivacyPolicy: + type: string + type: object + x-konfig-is-used-in-successful-response: true konfig-generated-schema-paths--api-installmentplans-installmentPlanNumber-get-parameters-2-schema: example: "" type: string @@ -2949,6 +3069,10 @@ components: example: "" type: string x-do-not-generate: true + konfig-generated-schema-paths--api-installmentplans-ipn-legal-get-parameters-2-schema: + example: "" + type: string + x-do-not-generate: true konfig-generated-schema-single-parameter-schema-get--api-installmentplans-installmentPlanNumber: properties: installmentPlanNumber: @@ -3240,6 +3364,28 @@ components: x-konfig-is-parameter: - X-Splitit-IdempotencyKey - X-Splitit-TouchPoint + konfig-generated-schema-single-parameter-schema-get--api-installmentplans-ipn-legal: + properties: + ipn: + type: string + X-Splitit-IdempotencyKey: + type: string + X-Splitit-TouchPoint: + default: "" + example: "" + type: string + x-konfig-original-example: "" + x-konfig-generated-schema: konfig-generated-schema-paths--api-installmentplans-ipn-legal-get-parameters-2-schema + required: + - X-Splitit-IdempotencyKey + - X-Splitit-TouchPoint + - ipn + type: object + x-do-not-generate: true + x-konfig-is-parameter: + - ipn + - X-Splitit-IdempotencyKey + - X-Splitit-TouchPoint ErrorExtended_allOf: properties: ExtraData: diff --git a/java/docs/EligibilityTermsAndConditionResponse.md b/java/docs/EligibilityTermsAndConditionResponse.md new file mode 100644 index 0000000..ab188b3 --- /dev/null +++ b/java/docs/EligibilityTermsAndConditionResponse.md @@ -0,0 +1,14 @@ + + +# EligibilityTermsAndConditionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**termsAndConditions** | **String** | | [optional] | +|**privacyPolicy** | **String** | | [optional] | + + + diff --git a/java/docs/InstallmentPlanApi.md b/java/docs/InstallmentPlanApi.md index 051f746..0001088 100644 --- a/java/docs/InstallmentPlanApi.md +++ b/java/docs/InstallmentPlanApi.md @@ -6,6 +6,7 @@ All URIs are relative to *https://web-api-v3.production.splitit.com* |------------- | ------------- | -------------| | [**checkEligibility**](InstallmentPlanApi.md#checkEligibility) | **POST** /api/installmentplans/check-eligibility | | | [**get**](InstallmentPlanApi.md#get) | **GET** /api/installmentplans/{installmentPlanNumber} | | +| [**getEligibilityTermsAndCondition**](InstallmentPlanApi.md#getEligibilityTermsAndCondition) | **GET** /api/installmentplans/{ipn}/legal | | | [**post**](InstallmentPlanApi.md#post) | **POST** /api/installmentplans/initiate | | | [**post2**](InstallmentPlanApi.md#post2) | **POST** /api/installmentplans | | | [**refund**](InstallmentPlanApi.md#refund) | **POST** /api/installmentplans/{installmentPlanNumber}/refund | | @@ -238,6 +239,105 @@ public class Example { |-------------|-------------|------------------| | **200** | | - | + +# **getEligibilityTermsAndCondition** +> EligibilityTermsAndConditionResponse getEligibilityTermsAndCondition(ipn, xSplititIdempotencyKey, xSplititTouchPoint).execute(); + + + +### Example +```java +import com.konfigthis.splitit.client.ApiClient; +import com.konfigthis.splitit.client.ApiException; +import com.konfigthis.splitit.client.ApiResponse; +import com.konfigthis.splitit.client.Splitit; +import com.konfigthis.splitit.client.Configuration; +import com.konfigthis.splitit.client.auth.*; +import com.konfigthis.splitit.client.model.*; +import com.konfigthis.splitit.client.api.InstallmentPlanApi; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.host = "https://web-api-v3.production.splitit.com"; + // Configure OAuth2 client credentials for "application" OAuth flow + String clientId = System.getenv("CLIENT_ID"); + String clientSecret = System.getenv("CLIENT_SECRET"); + configuration.clientId = "clientId"; + configuration.clientSecret = "clientSecret"; + + Splitit client = new Splitit(configuration); + String ipn = "ipn_example"; + String xSplititIdempotencyKey = "xSplititIdempotencyKey_example"; + String xSplititTouchPoint = ""; // TouchPoint + try { + EligibilityTermsAndConditionResponse result = client + .installmentPlan + .getEligibilityTermsAndCondition(ipn, xSplititIdempotencyKey, xSplititTouchPoint) + .execute(); + System.out.println(result); + System.out.println(result.getTermsAndConditions()); + System.out.println(result.getPrivacyPolicy()); + } catch (ApiException e) { + System.err.println("Exception when calling InstallmentPlanApi#getEligibilityTermsAndCondition"); + System.err.println("Status code: " + e.getStatusCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + + // Use .executeWithHttpInfo() to retrieve HTTP Status Code, Headers and Request + try { + ApiResponse response = client + .installmentPlan + .getEligibilityTermsAndCondition(ipn, xSplititIdempotencyKey, xSplititTouchPoint) + .executeWithHttpInfo(); + System.out.println(response.getResponseBody()); + System.out.println(response.getResponseHeaders()); + System.out.println(response.getStatusCode()); + System.out.println(response.getRoundTripTime()); + System.out.println(response.getRequest()); + } catch (ApiException e) { + System.err.println("Exception when calling InstallmentPlanApi#getEligibilityTermsAndCondition"); + System.err.println("Status code: " + e.getStatusCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **ipn** | **String**| | | +| **xSplititIdempotencyKey** | **String**| | | +| **xSplititTouchPoint** | **String**| TouchPoint | [default to ] | + +### Return type + +[**EligibilityTermsAndConditionResponse**](EligibilityTermsAndConditionResponse.md) + +### Authorization + +[oauth](../README.md#oauth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, text/json, text/plain + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + # **post** > InitiatePlanResponse post(xSplititIdempotencyKey, xSplititTouchPoint, installmentPlanInitiateRequest).xSplititTestMode(xSplititTestMode).splititclientinfo(splititclientinfo).execute(); 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 d3eb613..6f42bb4 100644 --- a/java/src/main/java/com/konfigthis/splitit/client/JSON.java +++ b/java/src/main/java/com/konfigthis/splitit/client/JSON.java @@ -116,6 +116,7 @@ public JsonElement serialize(Double src, Type typeOfSrc, JsonSerializationContex gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.BluesnapVaultedShopperToken.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.CardData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.CheckInstallmentsEligibilityRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.EligibilityTermsAndConditionResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.Error.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.ErrorExtended.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.konfigthis.splitit.client.model.ErrorExtendedAllOf.CustomTypeAdapterFactory()); diff --git a/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApi.java b/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApi.java index 6599be7..9110667 100644 --- a/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApi.java +++ b/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApi.java @@ -5,6 +5,7 @@ import com.konfigthis.splitit.client.model.AddressDataModel; import com.konfigthis.splitit.client.model.CardData; import com.konfigthis.splitit.client.model.CheckInstallmentsEligibilityRequest; +import com.konfigthis.splitit.client.model.EligibilityTermsAndConditionResponse; import com.konfigthis.splitit.client.model.EventsEndpointsModel; import com.konfigthis.splitit.client.model.IdentifierContract; import com.konfigthis.splitit.client.model.InitiatePlanResponse; @@ -50,6 +51,11 @@ public GetRequestBuilder(String installmentPlanNumber, String xSplititIdempotenc super(installmentPlanNumber, xSplititIdempotencyKey, xSplititTouchPoint); } } + public class GetEligibilityTermsAndConditionRequestBuilder extends GetEligibilityTermsAndConditionRequestBuilderGenerated { + public GetEligibilityTermsAndConditionRequestBuilder(String ipn, String xSplititIdempotencyKey, String xSplititTouchPoint) { + super(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + } + } public class PostRequestBuilder extends PostRequestBuilderGenerated { public PostRequestBuilder(String xSplititIdempotencyKey, String xSplititTouchPoint) { super(xSplititIdempotencyKey, xSplititTouchPoint); diff --git a/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApiGenerated.java b/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApiGenerated.java index 6072d31..87d467a 100644 --- a/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApiGenerated.java +++ b/java/src/main/java/com/konfigthis/splitit/client/api/InstallmentPlanApiGenerated.java @@ -30,6 +30,7 @@ import com.konfigthis.splitit.client.model.AddressDataModel; import com.konfigthis.splitit.client.model.CardData; import com.konfigthis.splitit.client.model.CheckInstallmentsEligibilityRequest; +import com.konfigthis.splitit.client.model.EligibilityTermsAndConditionResponse; import com.konfigthis.splitit.client.model.EventsEndpointsModel; import com.konfigthis.splitit.client.model.IdentifierContract; import com.konfigthis.splitit.client.model.InitiatePlanResponse; @@ -530,6 +531,194 @@ public InstallmentPlanApi.GetRequestBuilder get(String installmentPlanNumber, St return ((InstallmentPlanApi) this).new GetRequestBuilder(installmentPlanNumber, xSplititIdempotencyKey, xSplititTouchPoint); } + private okhttp3.Call getEligibilityTermsAndConditionCall(String ipn, String xSplititIdempotencyKey, String xSplititTouchPoint, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/installmentplans/{ipn}/legal" + .replace("{" + "ipn" + "}", localVarApiClient.escapeString(ipn.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xSplititIdempotencyKey != null) { + localVarHeaderParams.put("X-Splitit-IdempotencyKey", localVarApiClient.parameterToString(xSplititIdempotencyKey)); + } + + if (xSplititTouchPoint != null) { + localVarHeaderParams.put("X-Splitit-TouchPoint", localVarApiClient.parameterToString(xSplititTouchPoint)); + } + + final String[] localVarAccepts = { + "application/json", + "text/json", + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "oauth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEligibilityTermsAndConditionValidateBeforeCall(String ipn, String xSplititIdempotencyKey, String xSplititTouchPoint, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'ipn' is set + if (ipn == null) { + throw new ApiException("Missing the required parameter 'ipn' when calling getEligibilityTermsAndCondition(Async)"); + } + + // verify the required parameter 'xSplititIdempotencyKey' is set + if (xSplititIdempotencyKey == null) { + throw new ApiException("Missing the required parameter 'xSplititIdempotencyKey' when calling getEligibilityTermsAndCondition(Async)"); + } + + // verify the required parameter 'xSplititTouchPoint' is set + if (xSplititTouchPoint == null) { + throw new ApiException("Missing the required parameter 'xSplititTouchPoint' when calling getEligibilityTermsAndCondition(Async)"); + } + + return getEligibilityTermsAndConditionCall(ipn, xSplititIdempotencyKey, xSplititTouchPoint, _callback); + + } + + + private ApiResponse getEligibilityTermsAndConditionWithHttpInfo(String ipn, String xSplititIdempotencyKey, String xSplititTouchPoint) throws ApiException { + okhttp3.Call localVarCall = getEligibilityTermsAndConditionValidateBeforeCall(ipn, xSplititIdempotencyKey, xSplititTouchPoint, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call getEligibilityTermsAndConditionAsync(String ipn, String xSplititIdempotencyKey, String xSplititTouchPoint, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getEligibilityTermsAndConditionValidateBeforeCall(ipn, xSplititIdempotencyKey, xSplititTouchPoint, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public abstract class GetEligibilityTermsAndConditionRequestBuilderGenerated { + final String ipn; + final String xSplititIdempotencyKey; + final String xSplititTouchPoint; + + public GetEligibilityTermsAndConditionRequestBuilderGenerated(String ipn, String xSplititIdempotencyKey, String xSplititTouchPoint) { + this.ipn = ipn; + this.xSplititIdempotencyKey = xSplititIdempotencyKey; + this.xSplititTouchPoint = xSplititTouchPoint; + } + + /** + * Build call for getEligibilityTermsAndCondition + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getEligibilityTermsAndConditionCall(ipn, xSplititIdempotencyKey, xSplititTouchPoint, _callback); + } + + + /** + * Execute getEligibilityTermsAndCondition request + * @return EligibilityTermsAndConditionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public EligibilityTermsAndConditionResponse execute() throws ApiException { + ApiResponse localVarResp = getEligibilityTermsAndConditionWithHttpInfo(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + return localVarResp.getResponseBody(); + } + + /** + * Execute getEligibilityTermsAndCondition request with HTTP info returned + * @return ApiResponse<EligibilityTermsAndConditionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getEligibilityTermsAndConditionWithHttpInfo(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + } + + /** + * Execute getEligibilityTermsAndCondition request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getEligibilityTermsAndConditionAsync(ipn, xSplititIdempotencyKey, xSplititTouchPoint, _callback); + } + } + + /** + * + * + * @param ipn (required) + * @param xSplititIdempotencyKey (required) + * @param xSplititTouchPoint TouchPoint (required) + * @return GetEligibilityTermsAndConditionRequestBuilder + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public InstallmentPlanApi.GetEligibilityTermsAndConditionRequestBuilder getEligibilityTermsAndCondition(String ipn, String xSplititIdempotencyKey, String xSplititTouchPoint) throws IllegalArgumentException { + if (ipn == null) throw new IllegalArgumentException("\"ipn\" is required but got null"); + + + if (xSplititIdempotencyKey == null) throw new IllegalArgumentException("\"xSplititIdempotencyKey\" is required but got null"); + + + if (xSplititTouchPoint == null) throw new IllegalArgumentException("\"xSplititTouchPoint\" is required but got null"); + + + return ((InstallmentPlanApi) this).new GetEligibilityTermsAndConditionRequestBuilder(ipn, xSplititIdempotencyKey, xSplititTouchPoint); + } private okhttp3.Call postCall(String xSplititIdempotencyKey, String xSplititTouchPoint, InstallmentPlanInitiateRequest installmentPlanInitiateRequest, String xSplititTestMode, String splititclientinfo, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers diff --git a/java/src/main/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponse.java b/java/src/main/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponse.java new file mode 100644 index 0000000..ff1d997 --- /dev/null +++ b/java/src/main/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponse.java @@ -0,0 +1,329 @@ +/* + * 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 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; + +/** + * EligibilityTermsAndConditionResponse + */@javax.annotation.Generated(value = "Generated by https://konfigthis.com") +public class EligibilityTermsAndConditionResponse { + public static final String SERIALIZED_NAME_TERMS_AND_CONDITIONS = "TermsAndConditions"; + @SerializedName(SERIALIZED_NAME_TERMS_AND_CONDITIONS) + private String termsAndConditions; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + private String privacyPolicy; + + public EligibilityTermsAndConditionResponse() { + } + + public EligibilityTermsAndConditionResponse termsAndConditions(String termsAndConditions) { + + + + + this.termsAndConditions = termsAndConditions; + return this; + } + + /** + * Get termsAndConditions + * @return termsAndConditions + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getTermsAndConditions() { + return termsAndConditions; + } + + + public void setTermsAndConditions(String termsAndConditions) { + + + + this.termsAndConditions = termsAndConditions; + } + + + public EligibilityTermsAndConditionResponse privacyPolicy(String privacyPolicy) { + + + + + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getPrivacyPolicy() { + return privacyPolicy; + } + + + public void setPrivacyPolicy(String privacyPolicy) { + + + + this.privacyPolicy = privacyPolicy; + } + + /** + * 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 EligibilityTermsAndConditionResponse instance itself + */ + public EligibilityTermsAndConditionResponse 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; + } + EligibilityTermsAndConditionResponse eligibilityTermsAndConditionResponse = (EligibilityTermsAndConditionResponse) o; + return Objects.equals(this.termsAndConditions, eligibilityTermsAndConditionResponse.termsAndConditions) && + Objects.equals(this.privacyPolicy, eligibilityTermsAndConditionResponse.privacyPolicy)&& + Objects.equals(this.additionalProperties, eligibilityTermsAndConditionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(termsAndConditions, privacyPolicy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EligibilityTermsAndConditionResponse {\n"); + sb.append(" termsAndConditions: ").append(toIndentedString(termsAndConditions)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).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("TermsAndConditions"); + openapiFields.add("PrivacyPolicy"); + + // 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 EligibilityTermsAndConditionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EligibilityTermsAndConditionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EligibilityTermsAndConditionResponse is not found in the empty JSON string", EligibilityTermsAndConditionResponse.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("TermsAndConditions") != null && !jsonObj.get("TermsAndConditions").isJsonNull()) && !jsonObj.get("TermsAndConditions").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TermsAndConditions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TermsAndConditions").toString())); + } + if ((jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) && !jsonObj.get("PrivacyPolicy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivacyPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivacyPolicy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EligibilityTermsAndConditionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EligibilityTermsAndConditionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EligibilityTermsAndConditionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EligibilityTermsAndConditionResponse 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 EligibilityTermsAndConditionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + EligibilityTermsAndConditionResponse 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 EligibilityTermsAndConditionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of EligibilityTermsAndConditionResponse + * @throws IOException if the JSON string is invalid with respect to EligibilityTermsAndConditionResponse + */ + public static EligibilityTermsAndConditionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EligibilityTermsAndConditionResponse.class); + } + + /** + * Convert an instance of EligibilityTermsAndConditionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/java/src/test/java/com/konfigthis/splitit/client/api/InstallmentPlanApiTest.java b/java/src/test/java/com/konfigthis/splitit/client/api/InstallmentPlanApiTest.java index ff54e6c..2693d40 100644 --- a/java/src/test/java/com/konfigthis/splitit/client/api/InstallmentPlanApiTest.java +++ b/java/src/test/java/com/konfigthis/splitit/client/api/InstallmentPlanApiTest.java @@ -20,6 +20,7 @@ import com.konfigthis.splitit.client.model.AddressDataModel; import com.konfigthis.splitit.client.model.CardData; import com.konfigthis.splitit.client.model.CheckInstallmentsEligibilityRequest; +import com.konfigthis.splitit.client.model.EligibilityTermsAndConditionResponse; import com.konfigthis.splitit.client.model.EventsEndpointsModel; import com.konfigthis.splitit.client.model.IdentifierContract; import com.konfigthis.splitit.client.model.InitiatePlanResponse; @@ -102,6 +103,19 @@ public void getTest() throws ApiException { // TODO: test validations } + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getEligibilityTermsAndConditionTest() throws ApiException { + String ipn = null; + String xSplititIdempotencyKey = null; + String xSplititTouchPoint = null; + EligibilityTermsAndConditionResponse response = api.getEligibilityTermsAndCondition(ipn, xSplititIdempotencyKey, xSplititTouchPoint) + .execute(); + // TODO: test validations + } + /** * @throws ApiException if the Api call fails */ diff --git a/java/src/test/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponseTest.java b/java/src/test/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponseTest.java new file mode 100644 index 0000000..859cbe5 --- /dev/null +++ b/java/src/test/java/com/konfigthis/splitit/client/model/EligibilityTermsAndConditionResponseTest.java @@ -0,0 +1,57 @@ +/* + * 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 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 EligibilityTermsAndConditionResponse + */ +public class EligibilityTermsAndConditionResponseTest { + private final EligibilityTermsAndConditionResponse model = new EligibilityTermsAndConditionResponse(); + + /** + * Model tests for EligibilityTermsAndConditionResponse + */ + @Test + public void testEligibilityTermsAndConditionResponse() { + // TODO: test EligibilityTermsAndConditionResponse + } + + /** + * Test the property 'termsAndConditions' + */ + @Test + public void termsAndConditionsTest() { + // TODO: test termsAndConditions + } + + /** + * Test the property 'privacyPolicy' + */ + @Test + public void privacyPolicyTest() { + // TODO: test privacyPolicy + } + +} diff --git a/php b/php index b6279b4..5c3cb78 160000 --- a/php +++ b/php @@ -1 +1 @@ -Subproject commit b6279b497a2b4a044308091db3a15018c3e7ce23 +Subproject commit 5c3cb78f5a359f8856d216d37121c546b6637b28 diff --git a/phpGuzzle6 b/phpGuzzle6 index 093974c..3098b8b 160000 --- a/phpGuzzle6 +++ b/phpGuzzle6 @@ -1 +1 @@ -Subproject commit 093974c55ae41a79f4876db6fe4160d5cb0a7ea6 +Subproject commit 3098b8bc178204a1e20a0ce53b20d4931650546f diff --git a/python/.konfig/generate-id.txt b/python/.konfig/generate-id.txt index a9f7cee..194038f 100644 --- a/python/.konfig/generate-id.txt +++ b/python/.konfig/generate-id.txt @@ -1 +1 @@ -fe1d252b-9c2a-4e7e-9e01-0a110c68633a \ No newline at end of file +e52a4d5f-7b21-4f9a-8380-7a784f10dd2d \ No newline at end of file diff --git a/python/README.md b/python/README.md index ecbb618..533dcdb 100644 --- a/python/README.md +++ b/python/README.md @@ -17,6 +17,7 @@ Splitit's Web API - [Reference](#reference) * [`splitit.installment_plan.check_eligibility`](#splititinstallment_plancheck_eligibility) * [`splitit.installment_plan.get`](#splititinstallment_planget) + * [`splitit.installment_plan.get_eligibility_terms_and_condition`](#splititinstallment_planget_eligibility_terms_and_condition) * [`splitit.installment_plan.post`](#splititinstallment_planpost) * [`splitit.installment_plan.post2`](#splititinstallment_planpost2) * [`splitit.installment_plan.refund`](#splititinstallment_planrefund) @@ -249,6 +250,44 @@ TouchPoint --- +### `splitit.installment_plan.get_eligibility_terms_and_condition` + + + +#### 🛠️ Usage + +```python +get_eligibility_terms_and_condition_response = ( + splitit.installment_plan.get_eligibility_terms_and_condition( + ipn="ipn_example", + x_splitit_idempotency_key="X-Splitit-IdempotencyKey_example", + x_splitit_touch_point="", + ) +) +``` + +#### ⚙️ Parameters + +##### ipn: `str` + +##### x_splitit_idempotency_key: `str` + +##### x_splitit_touch_point: `str` + +TouchPoint + +#### 🔄 Return + +[`EligibilityTermsAndConditionResponse`](./splitit_client/type/eligibility_terms_and_condition_response.py) + +#### 🌐 Endpoint + +`/api/installmentplans/{ipn}/legal` `get` + +[🔙 **Back to Table of Contents**](#table-of-contents) + +--- + ### `splitit.installment_plan.post` diff --git a/python/splitit_client/apis/path_to_api.py b/python/splitit_client/apis/path_to_api.py index 14a8e05..4d60bc4 100644 --- a/python/splitit_client/apis/path_to_api.py +++ b/python/splitit_client/apis/path_to_api.py @@ -10,6 +10,7 @@ from splitit_client.apis.paths.api_installmentplans_updateorder import ApiInstallmentplansUpdateorder from splitit_client.apis.paths.api_installmentplans_installment_plan_number_refund import ApiInstallmentplansInstallmentPlanNumberRefund from splitit_client.apis.paths.api_installmentplans_check_eligibility import ApiInstallmentplansCheckEligibility +from splitit_client.apis.paths.api_installmentplans_ipn_legal import ApiInstallmentplansIpnLegal PathToApi = typing_extensions.TypedDict( 'PathToApi', @@ -23,6 +24,7 @@ PathValues.API_INSTALLMENTPLANS_UPDATEORDER: ApiInstallmentplansUpdateorder, PathValues.API_INSTALLMENTPLANS_INSTALLMENT_PLAN_NUMBER_REFUND: ApiInstallmentplansInstallmentPlanNumberRefund, PathValues.API_INSTALLMENTPLANS_CHECKELIGIBILITY: ApiInstallmentplansCheckEligibility, + PathValues.API_INSTALLMENTPLANS_IPN_LEGAL: ApiInstallmentplansIpnLegal, } ) @@ -37,5 +39,6 @@ PathValues.API_INSTALLMENTPLANS_UPDATEORDER: ApiInstallmentplansUpdateorder, PathValues.API_INSTALLMENTPLANS_INSTALLMENT_PLAN_NUMBER_REFUND: ApiInstallmentplansInstallmentPlanNumberRefund, PathValues.API_INSTALLMENTPLANS_CHECKELIGIBILITY: ApiInstallmentplansCheckEligibility, + PathValues.API_INSTALLMENTPLANS_IPN_LEGAL: ApiInstallmentplansIpnLegal, } ) diff --git a/python/splitit_client/apis/paths/api_installmentplans_ipn_legal.py b/python/splitit_client/apis/paths/api_installmentplans_ipn_legal.py new file mode 100644 index 0000000..7736645 --- /dev/null +++ b/python/splitit_client/apis/paths/api_installmentplans_ipn_legal.py @@ -0,0 +1,7 @@ +from splitit_client.paths.api_installmentplans_ipn_legal.get import ApiForget + + +class ApiInstallmentplansIpnLegal( + ApiForget, +): + pass diff --git a/python/splitit_client/apis/tags/installment_plan_api_generated.py b/python/splitit_client/apis/tags/installment_plan_api_generated.py index 9970b53..3e723f0 100644 --- a/python/splitit_client/apis/tags/installment_plan_api_generated.py +++ b/python/splitit_client/apis/tags/installment_plan_api_generated.py @@ -10,6 +10,7 @@ from splitit_client.paths.api_installmentplans_check_eligibility.post import CheckEligibility from splitit_client.paths.api_installmentplans_installment_plan_number.get import Get +from splitit_client.paths.api_installmentplans_ipn_legal.get import GetEligibilityTermsAndCondition from splitit_client.paths.api_installmentplans_initiate.post import Post from splitit_client.paths.api_installmentplans.post import Post2 from splitit_client.paths.api_installmentplans_installment_plan_number_refund.post import Refund @@ -22,6 +23,7 @@ class InstallmentPlanApiGenerated( CheckEligibility, Get, + GetEligibilityTermsAndCondition, Post, Post2, Refund, diff --git a/python/splitit_client/model/eligibility_terms_and_condition_response.py b/python/splitit_client/model/eligibility_terms_and_condition_response.py new file mode 100644 index 0000000..c1f0766 --- /dev/null +++ b/python/splitit_client/model/eligibility_terms_and_condition_response.py @@ -0,0 +1,86 @@ +# 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 EligibilityTermsAndConditionResponse( + schemas.DictSchema +): + """ + This class is auto generated by Konfig (https://konfigthis.com) + """ + + + class MetaOapg: + + class properties: + TermsAndConditions = schemas.StrSchema + PrivacyPolicy = schemas.StrSchema + __annotations__ = { + "TermsAndConditions": TermsAndConditions, + "PrivacyPolicy": PrivacyPolicy, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["TermsAndConditions"]) -> MetaOapg.properties.TermsAndConditions: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["PrivacyPolicy"]) -> MetaOapg.properties.PrivacyPolicy: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["TermsAndConditions", "PrivacyPolicy", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["TermsAndConditions"]) -> typing.Union[MetaOapg.properties.TermsAndConditions, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["PrivacyPolicy"]) -> typing.Union[MetaOapg.properties.PrivacyPolicy, 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["TermsAndConditions", "PrivacyPolicy", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + TermsAndConditions: typing.Union[MetaOapg.properties.TermsAndConditions, str, schemas.Unset] = schemas.unset, + PrivacyPolicy: typing.Union[MetaOapg.properties.PrivacyPolicy, str, 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], + ) -> 'EligibilityTermsAndConditionResponse': + return super().__new__( + cls, + *args, + TermsAndConditions=TermsAndConditions, + PrivacyPolicy=PrivacyPolicy, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/splitit_client/model/eligibility_terms_and_condition_response.pyi b/python/splitit_client/model/eligibility_terms_and_condition_response.pyi new file mode 100644 index 0000000..c1f0766 --- /dev/null +++ b/python/splitit_client/model/eligibility_terms_and_condition_response.pyi @@ -0,0 +1,86 @@ +# 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 EligibilityTermsAndConditionResponse( + schemas.DictSchema +): + """ + This class is auto generated by Konfig (https://konfigthis.com) + """ + + + class MetaOapg: + + class properties: + TermsAndConditions = schemas.StrSchema + PrivacyPolicy = schemas.StrSchema + __annotations__ = { + "TermsAndConditions": TermsAndConditions, + "PrivacyPolicy": PrivacyPolicy, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["TermsAndConditions"]) -> MetaOapg.properties.TermsAndConditions: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["PrivacyPolicy"]) -> MetaOapg.properties.PrivacyPolicy: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["TermsAndConditions", "PrivacyPolicy", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["TermsAndConditions"]) -> typing.Union[MetaOapg.properties.TermsAndConditions, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["PrivacyPolicy"]) -> typing.Union[MetaOapg.properties.PrivacyPolicy, 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["TermsAndConditions", "PrivacyPolicy", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + TermsAndConditions: typing.Union[MetaOapg.properties.TermsAndConditions, str, schemas.Unset] = schemas.unset, + PrivacyPolicy: typing.Union[MetaOapg.properties.PrivacyPolicy, str, 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], + ) -> 'EligibilityTermsAndConditionResponse': + return super().__new__( + cls, + *args, + TermsAndConditions=TermsAndConditions, + PrivacyPolicy=PrivacyPolicy, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/splitit_client/models/__init__.py b/python/splitit_client/models/__init__.py index 49b7372..93687ec 100644 --- a/python/splitit_client/models/__init__.py +++ b/python/splitit_client/models/__init__.py @@ -19,6 +19,7 @@ from splitit_client.model.card_data import CardData from splitit_client.model.card_type import CardType from splitit_client.model.check_installments_eligibility_request import CheckInstallmentsEligibilityRequest +from splitit_client.model.eligibility_terms_and_condition_response import EligibilityTermsAndConditionResponse from splitit_client.model.error import Error from splitit_client.model.error_extended import ErrorExtended from splitit_client.model.events_endpoints_model import EventsEndpointsModel diff --git a/python/splitit_client/operation_parameter_map.py b/python/splitit_client/operation_parameter_map.py index b4011af..d9c20c8 100644 --- a/python/splitit_client/operation_parameter_map.py +++ b/python/splitit_client/operation_parameter_map.py @@ -34,6 +34,19 @@ }, ] }, + '/api/installmentplans/{ipn}/legal-GET': { + 'parameters': [ + { + 'name': 'ipn' + }, + { + 'name': 'X-Splitit-IdempotencyKey' + }, + { + 'name': 'X-Splitit-TouchPoint' + }, + ] + }, '/api/installmentplans/initiate-POST': { 'parameters': [ { diff --git a/python/splitit_client/paths/__init__.py b/python/splitit_client/paths/__init__.py index a1430b4..ac63ed1 100644 --- a/python/splitit_client/paths/__init__.py +++ b/python/splitit_client/paths/__init__.py @@ -15,3 +15,4 @@ class PathValues(str, enum.Enum): API_INSTALLMENTPLANS_UPDATEORDER = "/api/installmentplans/updateorder" API_INSTALLMENTPLANS_INSTALLMENT_PLAN_NUMBER_REFUND = "/api/installmentplans/{installmentPlanNumber}/refund" API_INSTALLMENTPLANS_CHECKELIGIBILITY = "/api/installmentplans/check-eligibility" + API_INSTALLMENTPLANS_IPN_LEGAL = "/api/installmentplans/{ipn}/legal" diff --git a/python/splitit_client/paths/api_installmentplans_ipn_legal/__init__.py b/python/splitit_client/paths/api_installmentplans_ipn_legal/__init__.py new file mode 100644 index 0000000..98a47fe --- /dev/null +++ b/python/splitit_client/paths/api_installmentplans_ipn_legal/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from splitit_client.paths.api_installmentplans_ipn_legal import Api + +from splitit_client.paths import PathValues + +path = PathValues.API_INSTALLMENTPLANS_IPN_LEGAL \ No newline at end of file diff --git a/python/splitit_client/paths/api_installmentplans_ipn_legal/get.py b/python/splitit_client/paths/api_installmentplans_ipn_legal/get.py new file mode 100644 index 0000000..29a5b71 --- /dev/null +++ b/python/splitit_client/paths/api_installmentplans_ipn_legal/get.py @@ -0,0 +1,577 @@ +# 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 dataclasses import dataclass +import typing_extensions +import urllib3 +from splitit_client.request_before_hook import request_before_hook +import json +from urllib3._collections import HTTPHeaderDict + +from splitit_client.api_response import AsyncGeneratorResponse +from splitit_client import api_client, exceptions +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 + +from splitit_client.model.failed_response import FailedResponse as FailedResponseSchema +from splitit_client.model.eligibility_terms_and_condition_response import EligibilityTermsAndConditionResponse as EligibilityTermsAndConditionResponseSchema + +from splitit_client.type.failed_response import FailedResponse +from splitit_client.type.eligibility_terms_and_condition_response import EligibilityTermsAndConditionResponse + +from . import path + +# Header params +XSplititIdempotencyKeySchema = schemas.StrSchema +XSplititTouchPointSchema = schemas.StrSchema +RequestRequiredHeaderParams = typing_extensions.TypedDict( + 'RequestRequiredHeaderParams', + { + 'X-Splitit-IdempotencyKey': typing.Union[XSplititIdempotencyKeySchema, str, ], + 'X-Splitit-TouchPoint': typing.Union[XSplititTouchPointSchema, str, ], + } +) +RequestOptionalHeaderParams = typing_extensions.TypedDict( + 'RequestOptionalHeaderParams', + { + }, + total=False +) + + +class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): + pass + + +request_header_x_splitit_idempotency_key = api_client.HeaderParameter( + name="X-Splitit-IdempotencyKey", + style=api_client.ParameterStyle.SIMPLE, + schema=XSplititIdempotencyKeySchema, + required=True, +) +request_header_x_splitit_touch_point = api_client.HeaderParameter( + name="X-Splitit-TouchPoint", + style=api_client.ParameterStyle.SIMPLE, + schema=XSplititTouchPointSchema, + required=True, +) +# Path params +IpnSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'ipn': typing.Union[IpnSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_ipn = api_client.PathParameter( + name="ipn", + style=api_client.ParameterStyle.SIMPLE, + schema=IpnSchema, + required=True, +) +_auth = [ + 'oauth', +] +SchemaFor200ResponseBodyApplicationJson = EligibilityTermsAndConditionResponseSchema +SchemaFor200ResponseBodyTextJson = EligibilityTermsAndConditionResponseSchema +SchemaFor200ResponseBodyTextPlain = EligibilityTermsAndConditionResponseSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + body: EligibilityTermsAndConditionResponse + + +@dataclass +class ApiResponseFor200Async(api_client.AsyncApiResponse): + body: EligibilityTermsAndConditionResponse + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + response_cls_async=ApiResponseFor200Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor200ResponseBodyTextPlain), + }, +) +SchemaFor401ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor401ResponseBodyTextJson = FailedResponseSchema +SchemaFor401ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor401(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor401Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_401 = api_client.OpenApiResponse( + response_cls=ApiResponseFor401, + response_cls_async=ApiResponseFor401Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor401ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor401ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor401ResponseBodyTextPlain), + }, +) +SchemaFor403ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor403ResponseBodyTextJson = FailedResponseSchema +SchemaFor403ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor403(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor403Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_403 = api_client.OpenApiResponse( + response_cls=ApiResponseFor403, + response_cls_async=ApiResponseFor403Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor403ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor403ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor403ResponseBodyTextPlain), + }, +) +SchemaFor404ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor404ResponseBodyTextJson = FailedResponseSchema +SchemaFor404ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor404Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, + response_cls_async=ApiResponseFor404Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor404ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor404ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor404ResponseBodyTextPlain), + }, +) +SchemaFor500ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor500ResponseBodyTextJson = FailedResponseSchema +SchemaFor500ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor500(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor500Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_500 = api_client.OpenApiResponse( + response_cls=ApiResponseFor500, + response_cls_async=ApiResponseFor500Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor500ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor500ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor500ResponseBodyTextPlain), + }, +) +_status_code_to_response = { + '200': _response_for_200, + '401': _response_for_401, + '403': _response_for_403, + '404': _response_for_404, + '500': _response_for_500, +} +_all_accept_content_types = ( + 'application/json', + 'text/json', + 'text/plain', +) + + +class BaseApi(api_client.Api): + + def _get_eligibility_terms_and_condition_mapped_args( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + ) -> api_client.MappedArgs: + args: api_client.MappedArgs = api_client.MappedArgs() + _header_params = {} + _path_params = {} + if x_splitit_idempotency_key is not None: + _header_params["X-Splitit-IdempotencyKey"] = x_splitit_idempotency_key + if x_splitit_touch_point is not None: + _header_params["X-Splitit-TouchPoint"] = x_splitit_touch_point + if ipn is not None: + _path_params["ipn"] = ipn + args.header = _header_params + args.path = _path_params + return args + + async def _aget_eligibility_terms_and_condition_oapg( + self, + header_params: typing.Optional[dict] = {}, + path_params: typing.Optional[dict] = {}, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + **kwargs, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_ipn, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header_x_splitit_idempotency_key, + request_header_x_splitit_touch_point, + ): + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + path_template='/api/installmentplans/{ipn}/legal', + auth_settings=_auth, + headers=_headers, + ) + + response = await self.api_client.async_call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + **kwargs + ) + + if stream: + if not 200 <= response.http_response.status <= 299: + body = (await response.http_response.content.read()).decode("utf-8") + raise exceptions.ApiStreamingException( + status=response.http_response.status, + reason=response.http_response.reason, + body=body, + ) + + async def stream_iterator(): + """ + iterates over response.http_response.content and closes connection once iteration has finished + """ + async for line in response.http_response.content: + if line == b'\r\n': + continue + yield line + response.http_response.close() + await response.session.close() + return AsyncGeneratorResponse( + content=stream_iterator(), + headers=response.http_response.headers, + status=response.http_response.status, + response=response.http_response + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = await response_for_status.deserialize_async( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserializationAsync( + body=await response.http_response.json() if is_json else await response.http_response.text(), + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + # cleanup session / response + response.http_response.close() + await response.session.close() + + return api_response + + + def _get_eligibility_terms_and_condition_oapg( + self, + header_params: typing.Optional[dict] = {}, + path_params: typing.Optional[dict] = {}, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_ipn, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header_x_splitit_idempotency_key, + request_header_x_splitit_touch_point, + ): + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + path_template='/api/installmentplans/{ipn}/legal', + auth_settings=_auth, + headers=_headers, + ) + + response = self.api_client.call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = response_for_status.deserialize( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserialization( + body=json.loads(response.http_response.data) if is_json else response.http_response.data, + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class GetEligibilityTermsAndCondition(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + async def aget_eligibility_terms_and_condition( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + **kwargs, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return await self._aget_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + **kwargs, + ) + + def get_eligibility_terms_and_condition( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ """ + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return self._get_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + ) + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + async def aget( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + **kwargs, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return await self._aget_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + **kwargs, + ) + + def get( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ """ + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return self._get_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + ) + diff --git a/python/splitit_client/paths/api_installmentplans_ipn_legal/get.pyi b/python/splitit_client/paths/api_installmentplans_ipn_legal/get.pyi new file mode 100644 index 0000000..9bb11ef --- /dev/null +++ b/python/splitit_client/paths/api_installmentplans_ipn_legal/get.pyi @@ -0,0 +1,565 @@ +# 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 dataclasses import dataclass +import typing_extensions +import urllib3 +from splitit_client.request_before_hook import request_before_hook +import json +from urllib3._collections import HTTPHeaderDict + +from splitit_client.api_response import AsyncGeneratorResponse +from splitit_client import api_client, exceptions +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 + +from splitit_client.model.failed_response import FailedResponse as FailedResponseSchema +from splitit_client.model.eligibility_terms_and_condition_response import EligibilityTermsAndConditionResponse as EligibilityTermsAndConditionResponseSchema + +from splitit_client.type.failed_response import FailedResponse +from splitit_client.type.eligibility_terms_and_condition_response import EligibilityTermsAndConditionResponse + +# Header params +XSplititIdempotencyKeySchema = schemas.StrSchema +XSplititTouchPointSchema = schemas.StrSchema +RequestRequiredHeaderParams = typing_extensions.TypedDict( + 'RequestRequiredHeaderParams', + { + 'X-Splitit-IdempotencyKey': typing.Union[XSplititIdempotencyKeySchema, str, ], + 'X-Splitit-TouchPoint': typing.Union[XSplititTouchPointSchema, str, ], + } +) +RequestOptionalHeaderParams = typing_extensions.TypedDict( + 'RequestOptionalHeaderParams', + { + }, + total=False +) + + +class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): + pass + + +request_header_x_splitit_idempotency_key = api_client.HeaderParameter( + name="X-Splitit-IdempotencyKey", + style=api_client.ParameterStyle.SIMPLE, + schema=XSplititIdempotencyKeySchema, + required=True, +) +request_header_x_splitit_touch_point = api_client.HeaderParameter( + name="X-Splitit-TouchPoint", + style=api_client.ParameterStyle.SIMPLE, + schema=XSplititTouchPointSchema, + required=True, +) +# Path params +IpnSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'ipn': typing.Union[IpnSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_ipn = api_client.PathParameter( + name="ipn", + style=api_client.ParameterStyle.SIMPLE, + schema=IpnSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = EligibilityTermsAndConditionResponseSchema +SchemaFor200ResponseBodyTextJson = EligibilityTermsAndConditionResponseSchema +SchemaFor200ResponseBodyTextPlain = EligibilityTermsAndConditionResponseSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + body: EligibilityTermsAndConditionResponse + + +@dataclass +class ApiResponseFor200Async(api_client.AsyncApiResponse): + body: EligibilityTermsAndConditionResponse + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + response_cls_async=ApiResponseFor200Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor200ResponseBodyTextPlain), + }, +) +SchemaFor401ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor401ResponseBodyTextJson = FailedResponseSchema +SchemaFor401ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor401(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor401Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_401 = api_client.OpenApiResponse( + response_cls=ApiResponseFor401, + response_cls_async=ApiResponseFor401Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor401ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor401ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor401ResponseBodyTextPlain), + }, +) +SchemaFor403ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor403ResponseBodyTextJson = FailedResponseSchema +SchemaFor403ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor403(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor403Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_403 = api_client.OpenApiResponse( + response_cls=ApiResponseFor403, + response_cls_async=ApiResponseFor403Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor403ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor403ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor403ResponseBodyTextPlain), + }, +) +SchemaFor404ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor404ResponseBodyTextJson = FailedResponseSchema +SchemaFor404ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor404Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, + response_cls_async=ApiResponseFor404Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor404ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor404ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor404ResponseBodyTextPlain), + }, +) +SchemaFor500ResponseBodyApplicationJson = FailedResponseSchema +SchemaFor500ResponseBodyTextJson = FailedResponseSchema +SchemaFor500ResponseBodyTextPlain = FailedResponseSchema + + +@dataclass +class ApiResponseFor500(api_client.ApiResponse): + body: FailedResponse + + +@dataclass +class ApiResponseFor500Async(api_client.AsyncApiResponse): + body: FailedResponse + + +_response_for_500 = api_client.OpenApiResponse( + response_cls=ApiResponseFor500, + response_cls_async=ApiResponseFor500Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor500ResponseBodyApplicationJson), + 'text/json': api_client.MediaType( + schema=SchemaFor500ResponseBodyTextJson), + 'text/plain': api_client.MediaType( + schema=SchemaFor500ResponseBodyTextPlain), + }, +) +_all_accept_content_types = ( + 'application/json', + 'text/json', + 'text/plain', +) + + +class BaseApi(api_client.Api): + + def _get_eligibility_terms_and_condition_mapped_args( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + ) -> api_client.MappedArgs: + args: api_client.MappedArgs = api_client.MappedArgs() + _header_params = {} + _path_params = {} + if x_splitit_idempotency_key is not None: + _header_params["X-Splitit-IdempotencyKey"] = x_splitit_idempotency_key + if x_splitit_touch_point is not None: + _header_params["X-Splitit-TouchPoint"] = x_splitit_touch_point + if ipn is not None: + _path_params["ipn"] = ipn + args.header = _header_params + args.path = _path_params + return args + + async def _aget_eligibility_terms_and_condition_oapg( + self, + header_params: typing.Optional[dict] = {}, + path_params: typing.Optional[dict] = {}, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + **kwargs, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_ipn, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header_x_splitit_idempotency_key, + request_header_x_splitit_touch_point, + ): + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + path_template='/api/installmentplans/{ipn}/legal', + auth_settings=_auth, + headers=_headers, + ) + + response = await self.api_client.async_call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + **kwargs + ) + + if stream: + if not 200 <= response.http_response.status <= 299: + body = (await response.http_response.content.read()).decode("utf-8") + raise exceptions.ApiStreamingException( + status=response.http_response.status, + reason=response.http_response.reason, + body=body, + ) + + async def stream_iterator(): + """ + iterates over response.http_response.content and closes connection once iteration has finished + """ + async for line in response.http_response.content: + if line == b'\r\n': + continue + yield line + response.http_response.close() + await response.session.close() + return AsyncGeneratorResponse( + content=stream_iterator(), + headers=response.http_response.headers, + status=response.http_response.status, + response=response.http_response + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = await response_for_status.deserialize_async( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserializationAsync( + body=await response.http_response.json() if is_json else await response.http_response.text(), + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + # cleanup session / response + response.http_response.close() + await response.session.close() + + return api_response + + + def _get_eligibility_terms_and_condition_oapg( + self, + header_params: typing.Optional[dict] = {}, + path_params: typing.Optional[dict] = {}, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[float, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestHeaderParams, header_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_ipn, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header_x_splitit_idempotency_key, + request_header_x_splitit_touch_point, + ): + parameter_data = header_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + path_template='/api/installmentplans/{ipn}/legal', + auth_settings=_auth, + headers=_headers, + ) + + response = self.api_client.call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = response_for_status.deserialize( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserialization( + body=json.loads(response.http_response.data) if is_json else response.http_response.data, + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class GetEligibilityTermsAndCondition(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + async def aget_eligibility_terms_and_condition( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + **kwargs, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return await self._aget_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + **kwargs, + ) + + def get_eligibility_terms_and_condition( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ """ + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return self._get_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + ) + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + async def aget( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + **kwargs, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return await self._aget_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + **kwargs, + ) + + def get( + self, + ipn: str, + x_splitit_idempotency_key: str, + x_splitit_touch_point: str, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ """ + args = self._get_eligibility_terms_and_condition_mapped_args( + ipn=ipn, + x_splitit_idempotency_key=x_splitit_idempotency_key, + x_splitit_touch_point=x_splitit_touch_point, + ) + return self._get_eligibility_terms_and_condition_oapg( + header_params=args.header, + path_params=args.path, + ) + diff --git a/python/splitit_client/type/eligibility_terms_and_condition_response.py b/python/splitit_client/type/eligibility_terms_and_condition_response.py new file mode 100644 index 0000000..3445074 --- /dev/null +++ b/python/splitit_client/type/eligibility_terms_and_condition_response.py @@ -0,0 +1,27 @@ +# 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 + + +class RequiredEligibilityTermsAndConditionResponse(TypedDict): + pass + +class OptionalEligibilityTermsAndConditionResponse(TypedDict, total=False): + TermsAndConditions: str + + PrivacyPolicy: str + +class EligibilityTermsAndConditionResponse(RequiredEligibilityTermsAndConditionResponse, OptionalEligibilityTermsAndConditionResponse): + pass diff --git a/python/test/test_models/test_eligibility_terms_and_condition_response.py b/python/test/test_models/test_eligibility_terms_and_condition_response.py new file mode 100644 index 0000000..562072a --- /dev/null +++ b/python/test/test_models/test_eligibility_terms_and_condition_response.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.eligibility_terms_and_condition_response import EligibilityTermsAndConditionResponse +from splitit_client import configuration + + +class TestEligibilityTermsAndConditionResponse(unittest.TestCase): + """EligibilityTermsAndConditionResponse unit test stubs""" + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_api_installmentplans_ipn_legal/__init__.py b/python/test/test_paths/test_api_installmentplans_ipn_legal/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/test/test_paths/test_api_installmentplans_ipn_legal/test_get.py b/python/test/test_paths/test_api_installmentplans_ipn_legal/test_get.py new file mode 100644 index 0000000..be15e97 --- /dev/null +++ b/python/test/test_paths/test_api_installmentplans_ipn_legal/test_get.py @@ -0,0 +1,45 @@ +# 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 +from unittest.mock import patch + +import urllib3 + +import splitit_client +from splitit_client.paths.api_installmentplans_ipn_legal import get +from splitit_client import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestApiInstallmentplansIpnLegal(ApiTestMixin, unittest.TestCase): + """ + ApiInstallmentplansIpnLegal unit test stubs + """ + + def setUp(self): + pass + + def tearDown(self): + pass + + response_status = 200 + + + + + + + + +if __name__ == '__main__': + unittest.main() diff --git a/swagger-fixed.json b/swagger-fixed.json index 4e2763a..f6b8c28 100644 --- a/swagger-fixed.json +++ b/swagger-fixed.json @@ -1608,6 +1608,157 @@ } } } + }, + "/api/installmentplans/{ipn}/legal": { + "get": { + "tags": [ + "InstallmentPlan" + ], + "operationId": "InstallmentPlan_GetEligibilityTermsAndCondition", + "security": [ + { + "oauth": [ + "api.v3" + ] + } + ], + "parameters": [ + { + "name": "ipn", + "in": "path", + "required": true, + "x-nullable": false, + "schema": { + "type": "string" + } + }, + { + "name": "X-Splitit-IdempotencyKey", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "TouchPoint", + "name": "X-Splitit-TouchPoint", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "" + } + } + ], + "responses": { + "200": { + "description": "", + "x-nullable": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EligibilityTermsAndConditionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/EligibilityTermsAndConditionResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/EligibilityTermsAndConditionResponse" + } + } + } + }, + "401": { + "description": "", + "x-nullable": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + } + } + }, + "403": { + "description": "", + "x-nullable": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + } + } + }, + "404": { + "description": "", + "x-nullable": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + } + } + }, + "500": { + "description": "", + "x-nullable": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/FailedResponse" + } + } + } + } + } + } } }, "components": { @@ -2961,6 +3112,17 @@ "type": "string" } } + }, + "EligibilityTermsAndConditionResponse": { + "type": "object", + "properties": { + "TermsAndConditions": { + "type": "string" + }, + "PrivacyPolicy": { + "type": "string" + } + } } }, "securitySchemes": { diff --git a/typescript/.konfig/generate-id.txt b/typescript/.konfig/generate-id.txt index a9f7cee..194038f 100644 --- a/typescript/.konfig/generate-id.txt +++ b/typescript/.konfig/generate-id.txt @@ -1 +1 @@ -fe1d252b-9c2a-4e7e-9e01-0a110c68633a \ No newline at end of file +e52a4d5f-7b21-4f9a-8380-7a784f10dd2d \ No newline at end of file diff --git a/typescript/README.md b/typescript/README.md index 7aea5e6..d1544e9 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -13,6 +13,7 @@ Splitit's Web API - [Reference](#reference) * [`splitit.installmentplan.checkEligibility`](#splititinstallmentplancheckeligibility) * [`splitit.installmentplan.get`](#splititinstallmentplanget) + * [`splitit.installmentplan.getEligibilityTermsAndCondition`](#splititinstallmentplangeteligibilitytermsandcondition) * [`splitit.installmentplan.post`](#splititinstallmentplanpost) * [`splitit.installmentplan.post2`](#splititinstallmentplanpost2) * [`splitit.installmentplan.refund`](#splititinstallmentplanrefund) @@ -162,6 +163,44 @@ TouchPoint --- +### `splitit.installmentplan.getEligibilityTermsAndCondition` + + + +#### 🛠️ Usage + +```typescript +const getEligibilityTermsAndConditionResponse = + await splitit.installmentplan.getEligibilityTermsAndCondition({ + ipn: "ipn_example", + xSplititIdempotencyKey: "xSplititIdempotencyKey_example", + xSplititTouchPoint: "", + }); +``` + +#### ⚙️ Parameters + +##### ipn: `string` + +##### xSplititIdempotencyKey: `string` + +##### xSplititTouchPoint: `string` + +TouchPoint + +#### 🔄 Return + +[EligibilityTermsAndConditionResponse](./models/eligibility-terms-and-condition-response.ts) + +#### 🌐 Endpoint + +`/api/installmentplans/{ipn}/legal` `GET` + +[🔙 **Back to Table of Contents**](#table-of-contents) + +--- + + ### `splitit.installmentplan.post` diff --git a/typescript/api/installmentplan-api-generated.ts b/typescript/api/installmentplan-api-generated.ts index 8bdac47..b4ccfc4 100644 --- a/typescript/api/installmentplan-api-generated.ts +++ b/typescript/api/installmentplan-api-generated.ts @@ -28,6 +28,8 @@ import { CardData } from '../models'; // @ts-ignore import { CheckInstallmentsEligibilityRequest } from '../models'; // @ts-ignore +import { EligibilityTermsAndConditionResponse } from '../models'; +// @ts-ignore import { EventsEndpointsModel } from '../models'; // @ts-ignore import { FailedResponse } from '../models'; @@ -210,6 +212,64 @@ export const InstallmentplanApiAxiosParamCreator = function (configuration?: Con options: localVarRequestOptions, }; }, + /** + * + * @param {string} ipn + * @param {string} xSplititIdempotencyKey + * @param {string} xSplititTouchPoint TouchPoint + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEligibilityTermsAndCondition: async (ipn: string, xSplititIdempotencyKey: string, xSplititTouchPoint: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'ipn' is not null or undefined + assertParamExists('getEligibilityTermsAndCondition', 'ipn', ipn) + // verify required parameter 'xSplititIdempotencyKey' is not null or undefined + assertParamExists('getEligibilityTermsAndCondition', 'xSplititIdempotencyKey', xSplititIdempotencyKey) + // verify required parameter 'xSplititTouchPoint' is not null or undefined + assertParamExists('getEligibilityTermsAndCondition', 'xSplititTouchPoint', xSplititTouchPoint) + const localVarPath = `/api/installmentplans/{ipn}/legal` + .replace(`{${"ipn"}}`, encodeURIComponent(String(ipn !== undefined ? ipn : `-ipn-`))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions: AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any; + const localVarQueryParameter = {} as any; + + // authentication oauth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth", ["api.v3"], configuration) + if (xSplititIdempotencyKey != null) { + localVarHeaderParameter['X-Splitit-IdempotencyKey'] = String(xSplititIdempotencyKey); + } + + if (xSplititTouchPoint != null) { + localVarHeaderParameter['X-Splitit-TouchPoint'] = String(xSplititTouchPoint); + } + + + + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + requestBeforeHook({ + queryParameters: localVarQueryParameter, + requestConfig: localVarRequestOptions, + path: localVarPath, + configuration, + pathTemplate: '/api/installmentplans/{ipn}/legal', + httpMethod: 'GET' + }); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {string} xSplititIdempotencyKey @@ -711,6 +771,16 @@ export const InstallmentplanApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.get(requestParameters.installmentPlanNumber, requestParameters.xSplititIdempotencyKey, requestParameters.xSplititTouchPoint, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {InstallmentplanApiGetEligibilityTermsAndConditionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getEligibilityTermsAndCondition(requestParameters: InstallmentplanApiGetEligibilityTermsAndConditionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getEligibilityTermsAndCondition(requestParameters.ipn, requestParameters.xSplititIdempotencyKey, requestParameters.xSplititTouchPoint, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {InstallmentplanApiPostRequest} requestParameters Request parameters. @@ -846,6 +916,15 @@ export const InstallmentplanApiFactory = function (configuration?: Configuration get(requestParameters: InstallmentplanApiGetRequest, options?: AxiosRequestConfig): AxiosPromise { return localVarFp.get(requestParameters, options).then((request) => request(axios, basePath)); }, + /** + * + * @param {InstallmentplanApiGetEligibilityTermsAndConditionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEligibilityTermsAndCondition(requestParameters: InstallmentplanApiGetEligibilityTermsAndConditionRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getEligibilityTermsAndCondition(requestParameters, options).then((request) => request(axios, basePath)); + }, /** * * @param {InstallmentplanApiPostRequest} requestParameters Request parameters. @@ -965,6 +1044,36 @@ export type InstallmentplanApiGetRequest = { } +/** + * Request parameters for getEligibilityTermsAndCondition operation in InstallmentplanApi. + * @export + * @interface InstallmentplanApiGetEligibilityTermsAndConditionRequest + */ +export type InstallmentplanApiGetEligibilityTermsAndConditionRequest = { + + /** + * + * @type {string} + * @memberof InstallmentplanApiGetEligibilityTermsAndCondition + */ + readonly ipn: string + + /** + * + * @type {string} + * @memberof InstallmentplanApiGetEligibilityTermsAndCondition + */ + readonly xSplititIdempotencyKey: string + + /** + * TouchPoint + * @type {string} + * @memberof InstallmentplanApiGetEligibilityTermsAndCondition + */ + readonly xSplititTouchPoint: string + +} + /** * Request parameters for post operation in InstallmentplanApi. * @export @@ -1225,6 +1334,17 @@ export class InstallmentplanApiGenerated extends BaseAPI { return InstallmentplanApiFp(this.configuration).get(requestParameters, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {InstallmentplanApiGetEligibilityTermsAndConditionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstallmentplanApiGenerated + */ + public getEligibilityTermsAndCondition(requestParameters: InstallmentplanApiGetEligibilityTermsAndConditionRequest, options?: AxiosRequestConfig) { + return InstallmentplanApiFp(this.configuration).getEligibilityTermsAndCondition(requestParameters, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {InstallmentplanApiPostRequest} requestParameters Request parameters. diff --git a/typescript/common.ts b/typescript/common.ts index c54ca02..2ac8c1e 100644 --- a/typescript/common.ts +++ b/typescript/common.ts @@ -237,32 +237,45 @@ export const removeTrailingSlash = function (url: string) { * Wrap an axios request in a try/catch block to catch network errors and parse the response body */ async function wrapAxiosRequest(makeRequest: () => Promise): Promise { - try { - return await makeRequest(); - } catch (e) { - if (e instanceof AxiosError && e.isAxiosError) { - try { - const responseBody = - e.response?.data instanceof ReadableStream - ? await readableStreamToString(e.response.data) - : e.response?.data - throw new SplititError(e, parseIfJson(responseBody), e.response?.headers) - } catch (innerError) { - if (innerError instanceof ReferenceError) { - // Got: "ReferenceError: ReadableStream is not defined" - // This means we are in a Node environment so just throw the original error - throw new SplititError(e, e.response?.data, e.response?.headers) + const maxAttempts = 3; + let attempt = 0; + let delay = 5000; + while (attempt < maxAttempts) { + try { + return await makeRequest(); + } catch (e) { + if (e instanceof AxiosError && e.isAxiosError) { + if (e.response?.status == 429) { + attempt++; + console.log(`429 error encountered, retrying in ${delay / 1000} seconds...`); + await new Promise(resolve => setTimeout(resolve, delay)); + delay *= 2; + continue; } - if (innerError instanceof SplititError) { - // Got "SplititError" from the above try block - throw innerError; + try { + const responseBody = + e.response?.data instanceof ReadableStream + ? await readableStreamToString(e.response.data) + : e.response?.data + throw new SplititError(e, parseIfJson(responseBody), e.response?.headers) + } catch (innerError) { + if (innerError instanceof ReferenceError) { + // Got: "ReferenceError: ReadableStream is not defined" + // This means we are in a Node environment so just throw the original error + throw new SplititError(e, e.response?.data, e.response?.headers) + } + if (innerError instanceof SplititError) { + // Got "SplititError" from the above try block + throw innerError; + } + // Something unexpected happened: propagate the error + throw e } - // Something unexpected happened: propagate the error - throw e } + throw e } - throw e } + throw new Error(`Request failed after ${maxAttempts} retries due to 429 (rate limit) errors.`); } /** diff --git a/typescript/models/eligibility-terms-and-condition-response.ts b/typescript/models/eligibility-terms-and-condition-response.ts new file mode 100644 index 0000000..20f8606 --- /dev/null +++ b/typescript/models/eligibility-terms-and-condition-response.ts @@ -0,0 +1,33 @@ +/* +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" + + +/** + * + * @export + * @interface EligibilityTermsAndConditionResponse + */ +export interface EligibilityTermsAndConditionResponse { + /** + * + * @type {string} + * @memberof EligibilityTermsAndConditionResponse + */ + 'TermsAndConditions'?: string; + /** + * + * @type {string} + * @memberof EligibilityTermsAndConditionResponse + */ + 'PrivacyPolicy'?: string; +} + diff --git a/typescript/models/index.ts b/typescript/models/index.ts index 3eb8732..3bb55fb 100644 --- a/typescript/models/index.ts +++ b/typescript/models/index.ts @@ -6,6 +6,7 @@ export * from './card-brand'; export * from './card-data'; export * from './card-type'; export * from './check-installments-eligibility-request'; +export * from './eligibility-terms-and-condition-response'; export * from './error-extended'; export * from './error-extended-all-of'; export * from './events-endpoints-model'; diff --git a/typescript/operationParameterMap.ts b/typescript/operationParameterMap.ts index 3072a00..0b9098c 100644 --- a/typescript/operationParameterMap.ts +++ b/typescript/operationParameterMap.ts @@ -40,6 +40,19 @@ export const operationParameterMap: Record = { }, ] }, + '/api/installmentplans/{ipn}/legal-GET': { + parameters: [ + { + name: 'ipn' + }, + { + name: 'X-Splitit-IdempotencyKey' + }, + { + name: 'X-Splitit-TouchPoint' + }, + ] + }, '/api/installmentplans/initiate-POST': { parameters: [ { From 8ac8166e7cdf6553bef0969f4f89f1eb3e3a232e Mon Sep 17 00:00:00 2001 From: konfig-publisher Date: Thu, 19 Sep 2024 15:07:47 +0000 Subject: [PATCH 3/3] Update submodule references --- php | 2 +- phpGuzzle6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php b/php index 5c3cb78..b638168 160000 --- a/php +++ b/php @@ -1 +1 @@ -Subproject commit 5c3cb78f5a359f8856d216d37121c546b6637b28 +Subproject commit b638168249448d91483ba0f629e9cdeca9324bea diff --git a/phpGuzzle6 b/phpGuzzle6 index 3098b8b..853e179 160000 --- a/phpGuzzle6 +++ b/phpGuzzle6 @@ -1 +1 @@ -Subproject commit 3098b8bc178204a1e20a0ce53b20d4931650546f +Subproject commit 853e179c7592eafb1a31adccacd380e9ed05852d