From df583294dc941bdb84a128b3b2c7f5ccf90bdb2a Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 15:31:59 +0000 Subject: [PATCH] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-java-sdk: 4.9.1 --- .fern/metadata.json | 8 +- build.gradle | 4 +- reference.md | 325 ++------ .../com/schematic/api/AsyncBaseSchematic.java | 20 + .../schematic/api/AsyncRawBaseSchematic.java | 79 ++ .../com/schematic/api/RawBaseSchematic.java | 62 ++ .../com/schematic/api/core/ClientOptions.java | 4 +- .../resources/credits/AsyncCreditsClient.java | 23 - .../credits/AsyncRawCreditsClient.java | 229 ------ .../api/resources/credits/CreditsClient.java | 22 - .../resources/credits/RawCreditsClient.java | 179 ----- .../requests/CountCreditLedgerRequest.java | 370 --------- .../GetEnrichedCreditLedgerRequest.java | 370 --------- .../types/CountCreditLedgerParams.java | 305 -------- .../types/CountCreditLedgerResponse.java | 153 ---- .../types/GetEnrichedCreditLedgerParams.java | 305 -------- .../GetEnrichedCreditLedgerResponse.java | 177 ----- .../requests/CreatePlanGroupRequestBody.java | 95 ++- .../requests/UpdatePlanGroupRequestBody.java | 95 ++- .../PublishPlanVersionRequestBody.java | 50 +- .../RetryCustomPlanBillingRequestBody.java | 52 +- .../BillingCreditGrantZeroedOutReason.java | 11 + ...ChangeSubscriptionInternalRequestBody.java | 32 + .../types/ChangeSubscriptionRequestBody.java | 32 + .../types/CheckoutSettingsResponseData.java | 111 ++- ...CreditLedgerEnrichedEntryResponseData.java | 716 ------------------ .../api/types/CreditLedgerPeriod.java | 103 --- .../api/types/FeatureEntitlement.java | 98 ++- .../api/types/PlanChangeResponseData.java | 42 +- ...PreviewSubscriptionChangeResponseData.java | 95 ++- .../types/RulesengineFeatureEntitlement.java | 98 ++- 31 files changed, 936 insertions(+), 3329 deletions(-) create mode 100644 src/main/java/com/schematic/api/AsyncRawBaseSchematic.java create mode 100644 src/main/java/com/schematic/api/RawBaseSchematic.java delete mode 100644 src/main/java/com/schematic/api/resources/credits/requests/CountCreditLedgerRequest.java delete mode 100644 src/main/java/com/schematic/api/resources/credits/requests/GetEnrichedCreditLedgerRequest.java delete mode 100644 src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerParams.java delete mode 100644 src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerResponse.java delete mode 100644 src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerParams.java delete mode 100644 src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerResponse.java delete mode 100644 src/main/java/com/schematic/api/types/CreditLedgerEnrichedEntryResponseData.java delete mode 100644 src/main/java/com/schematic/api/types/CreditLedgerPeriod.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 309b806..ffd7149 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { "cliVersion": "5.6.0", "generatorName": "fernapi/fern-java-sdk", - "generatorVersion": "4.9.0", + "generatorVersion": "4.9.1", "generatorConfig": { "client-class-name": "BaseSchematic", "generate-unknown-as-json-node": true, @@ -14,10 +14,10 @@ "implementation redis.clients:jedis:5.2.0" ] }, - "originGitCommit": "a5724e8dfeba2338da634f270044ac597694f772", + "originGitCommit": "786b643cc0bf17aff1114597108246b5cf8af395", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "1.4.2", + "requestedVersion": "1.4.3", "ciProvider": "github", - "sdkVersion": "1.4.2" + "sdkVersion": "1.4.3" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8cca5aa..b581265 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ java { group = 'com.schematichq' -version = '1.4.2' +version = '1.4.3' jar { dependsOn(":generatePomFileForMavenPublication") @@ -83,7 +83,7 @@ publishing { maven(MavenPublication) { groupId = 'com.schematichq' artifactId = 'schematic-java' - version = '1.4.2' + version = '1.4.3' from components.java pom { name = 'Schematic' diff --git a/reference.md b/reference.md index 7b267d5..dc2ff1f 100644 --- a/reference.md +++ b/reference.md @@ -1,4 +1,29 @@ # Reference +
client.getCreditLedger() +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.getCreditLedger(); +``` +
+
+
+
+ + +
+
+
+ ## accounts
client.accounts.listAccountMembers() -> ListAccountMembersResponse
@@ -5193,222 +5218,6 @@ client.credits().releaseCreditLease(
- - -
- -
client.credits.getEnrichedCreditLedger() -> GetEnrichedCreditLedgerResponse -
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.credits().getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest - .builder() - .companyId("company_id") - .period(CreditLedgerPeriod.DAILY) - .billingCreditId("billing_credit_id") - .featureId("feature_id") - .startTime("start_time") - .endTime("end_time") - .limit(1000000L) - .offset(1000000L) - .build() -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**companyId:** `String` - -
-
- -
-
- -**billingCreditId:** `Optional` - -
-
- -
-
- -**featureId:** `Optional` - -
-
- -
-
- -**period:** `CreditLedgerPeriod` - -
-
- -
-
- -**startTime:** `Optional` - -
-
- -
-
- -**endTime:** `Optional` - -
-
- -
-
- -**limit:** `Optional` — Page limit (default 100) - -
-
- -
-
- -**offset:** `Optional` — Page offset (default 0) - -
-
-
-
- - -
-
-
- -
client.credits.countCreditLedger() -> CountCreditLedgerResponse -
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.credits().countCreditLedger( - CountCreditLedgerRequest - .builder() - .companyId("company_id") - .period(CreditLedgerPeriod.DAILY) - .billingCreditId("billing_credit_id") - .featureId("feature_id") - .startTime("start_time") - .endTime("end_time") - .limit(1000000L) - .offset(1000000L) - .build() -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**companyId:** `String` - -
-
- -
-
- -**billingCreditId:** `Optional` - -
-
- -
-
- -**featureId:** `Optional` - -
-
- -
-
- -**period:** `CreditLedgerPeriod` - -
-
- -
-
- -**startTime:** `Optional` - -
-
- -
-
- -**endTime:** `Optional` - -
-
- -
-
- -**limit:** `Optional` — Page limit (default 100) - -
-
- -
-
- -**offset:** `Optional` — Page offset (default 0) - -
-
-
-
- -
@@ -12002,15 +11811,6 @@ client.plans().retryCustomPlanBilling( RetryCustomPlanBillingRequestBody .builder() .customerEmail("customer_email") - .payInAdvance( - Arrays.asList( - UpdatePayInAdvanceRequestBody - .builder() - .priceId("price_id") - .quantity(1000000L) - .build() - ) - ) .build() ); ``` @@ -12053,14 +11853,6 @@ client.plans().retryCustomPlanBilling( **daysUntilDue:** `Optional` - - - -
-
- -**payInAdvance:** `List` -
@@ -13152,15 +12944,6 @@ client.plans().publishPlanVersion( .excludedCompanyIds( Arrays.asList("excluded_company_ids") ) - .payInAdvance( - Arrays.asList( - UpdatePayInAdvanceRequestBody - .builder() - .priceId("price_id") - .quantity(1000000L) - .build() - ) - ) .build() ); ``` @@ -13219,14 +13002,6 @@ client.plans().publishPlanVersion( **migrationStrategy:** `PlanVersionMigrationStrategy` - - - -
-
- -**payInAdvance:** `List` -
@@ -16515,6 +16290,7 @@ client.plangroups().createPlanGroup( .checkoutCollectEmail(true) .checkoutCollectPhone(true) .enableTaxCollection(true) + .optInEnabled(true) .preventDowngradesWhenOverLimit(true) .preventSelfServiceDowngrade(true) .prorationBehavior(ProrationBehavior.CREATE_PRORATIONS) @@ -16664,6 +16440,30 @@ client.plangroups().createPlanGroup(
+**optInEnabled:** `Boolean` + +
+
+ +
+
+ +**optInText:** `Optional` + +
+
+ +
+
+ +**optInTitle:** `Optional` + +
+
+ +
+
+ **orderedAddOns:** `List`
@@ -16857,6 +16657,7 @@ client.plangroups().updatePlanGroup( .checkoutCollectEmail(true) .checkoutCollectPhone(true) .enableTaxCollection(true) + .optInEnabled(true) .preventDowngradesWhenOverLimit(true) .preventSelfServiceDowngrade(true) .prorationBehavior(ProrationBehavior.CREATE_PRORATIONS) @@ -17014,6 +16815,30 @@ client.plangroups().updatePlanGroup(
+**optInEnabled:** `Boolean` + +
+
+ +
+
+ +**optInText:** `Optional` + +
+
+ +
+
+ +**optInTitle:** `Optional` + +
+
+ +
+
+ **orderedAddOns:** `List`
diff --git a/src/main/java/com/schematic/api/AsyncBaseSchematic.java b/src/main/java/com/schematic/api/AsyncBaseSchematic.java index 16df612..0cbf4ac 100644 --- a/src/main/java/com/schematic/api/AsyncBaseSchematic.java +++ b/src/main/java/com/schematic/api/AsyncBaseSchematic.java @@ -4,6 +4,7 @@ package com.schematic.api; import com.schematic.api.core.ClientOptions; +import com.schematic.api.core.RequestOptions; import com.schematic.api.core.Suppliers; import com.schematic.api.resources.accesstokens.AsyncAccesstokensClient; import com.schematic.api.resources.accounts.AsyncAccountsClient; @@ -25,11 +26,14 @@ import com.schematic.api.resources.plans.AsyncPlansClient; import com.schematic.api.resources.scheduledcheckout.AsyncScheduledcheckoutClient; import com.schematic.api.resources.webhooks.AsyncWebhooksClient; +import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; public class AsyncBaseSchematic { protected final ClientOptions clientOptions; + private final AsyncRawBaseSchematic rawClient; + protected final Supplier accountsClient; protected final Supplier billingClient; @@ -72,6 +76,7 @@ public class AsyncBaseSchematic { public AsyncBaseSchematic(ClientOptions clientOptions) { this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBaseSchematic(clientOptions); this.accountsClient = Suppliers.memoize(() -> new AsyncAccountsClient(clientOptions)); this.billingClient = Suppliers.memoize(() -> new AsyncBillingClient(clientOptions)); this.creditsClient = Suppliers.memoize(() -> new AsyncCreditsClient(clientOptions)); @@ -94,6 +99,21 @@ public AsyncBaseSchematic(ClientOptions clientOptions) { this.webhooksClient = Suppliers.memoize(() -> new AsyncWebhooksClient(clientOptions)); } + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBaseSchematic withRawResponse() { + return this.rawClient; + } + + public CompletableFuture getCreditLedger() { + return this.rawClient.getCreditLedger().thenApply(response -> response.body()); + } + + public CompletableFuture getCreditLedger(RequestOptions requestOptions) { + return this.rawClient.getCreditLedger(requestOptions).thenApply(response -> response.body()); + } + public AsyncAccountsClient accounts() { return this.accountsClient.get(); } diff --git a/src/main/java/com/schematic/api/AsyncRawBaseSchematic.java b/src/main/java/com/schematic/api/AsyncRawBaseSchematic.java new file mode 100644 index 0000000..6d926ed --- /dev/null +++ b/src/main/java/com/schematic/api/AsyncRawBaseSchematic.java @@ -0,0 +1,79 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api; + +import com.schematic.api.core.BaseSchematicApiException; +import com.schematic.api.core.BaseSchematicException; +import com.schematic.api.core.BaseSchematicHttpResponse; +import com.schematic.api.core.ClientOptions; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBaseSchematic { + protected final ClientOptions clientOptions; + + public AsyncRawBaseSchematic(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture> getCreditLedger() { + return getCreditLedger(null); + } + + public CompletableFuture> getCreditLedger(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("billing/credits/ledger"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new BaseSchematicHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new BaseSchematicApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/schematic/api/RawBaseSchematic.java b/src/main/java/com/schematic/api/RawBaseSchematic.java new file mode 100644 index 0000000..9f77bf3 --- /dev/null +++ b/src/main/java/com/schematic/api/RawBaseSchematic.java @@ -0,0 +1,62 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api; + +import com.schematic.api.core.BaseSchematicApiException; +import com.schematic.api.core.BaseSchematicException; +import com.schematic.api.core.BaseSchematicHttpResponse; +import com.schematic.api.core.ClientOptions; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBaseSchematic { + protected final ClientOptions clientOptions; + + public RawBaseSchematic(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public BaseSchematicHttpResponse getCreditLedger() { + return getCreditLedger(null); + } + + public BaseSchematicHttpResponse getCreditLedger(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("billing/credits/ledger"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new BaseSchematicHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new BaseSchematicApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java index 0b2f698..f832217 100644 --- a/src/main/java/com/schematic/api/core/ClientOptions.java +++ b/src/main/java/com/schematic/api/core/ClientOptions.java @@ -38,10 +38,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.schematichq:schematic-java/1.4.2"); + put("User-Agent", "com.schematichq:schematic-java/1.4.3"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.4.2"); + put("X-Fern-SDK-Version", "1.4.3"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/schematic/api/resources/credits/AsyncCreditsClient.java b/src/main/java/com/schematic/api/resources/credits/AsyncCreditsClient.java index 93a982f..015e66d 100644 --- a/src/main/java/com/schematic/api/resources/credits/AsyncCreditsClient.java +++ b/src/main/java/com/schematic/api/resources/credits/AsyncCreditsClient.java @@ -13,13 +13,11 @@ import com.schematic.api.resources.credits.requests.CountCompanyGrantsRequest; import com.schematic.api.resources.credits.requests.CountCreditBundlesRequest; import com.schematic.api.resources.credits.requests.CountCreditEventLedgerRequest; -import com.schematic.api.resources.credits.requests.CountCreditLedgerRequest; import com.schematic.api.resources.credits.requests.CreateBillingCreditRequestBody; import com.schematic.api.resources.credits.requests.CreateCompanyCreditGrant; import com.schematic.api.resources.credits.requests.CreateCreditBundleRequestBody; import com.schematic.api.resources.credits.requests.DeleteBillingPlanCreditGrantRequest; import com.schematic.api.resources.credits.requests.ExtendCreditLeaseRequestBody; -import com.schematic.api.resources.credits.requests.GetEnrichedCreditLedgerRequest; import com.schematic.api.resources.credits.requests.ListBillingCreditsRequest; import com.schematic.api.resources.credits.requests.ListBillingPlanCreditGrantsRequest; import com.schematic.api.resources.credits.requests.ListCompanyCreditBalancesRequest; @@ -37,7 +35,6 @@ import com.schematic.api.resources.credits.types.CountCompanyGrantsResponse; import com.schematic.api.resources.credits.types.CountCreditBundlesResponse; import com.schematic.api.resources.credits.types.CountCreditEventLedgerResponse; -import com.schematic.api.resources.credits.types.CountCreditLedgerResponse; import com.schematic.api.resources.credits.types.CreateBillingCreditResponse; import com.schematic.api.resources.credits.types.CreateBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.CreateCreditBundleResponse; @@ -45,7 +42,6 @@ import com.schematic.api.resources.credits.types.DeleteCreditBundleResponse; import com.schematic.api.resources.credits.types.ExtendCreditLeaseResponse; import com.schematic.api.resources.credits.types.GetCreditBundleResponse; -import com.schematic.api.resources.credits.types.GetEnrichedCreditLedgerResponse; import com.schematic.api.resources.credits.types.GetSingleBillingCreditResponse; import com.schematic.api.resources.credits.types.GetSingleBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.GrantBillingCreditsToCompanyResponse; @@ -371,25 +367,6 @@ public CompletableFuture releaseCreditLease( .thenApply(response -> response.body()); } - public CompletableFuture getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest request) { - return this.rawClient.getEnrichedCreditLedger(request).thenApply(response -> response.body()); - } - - public CompletableFuture getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest request, RequestOptions requestOptions) { - return this.rawClient.getEnrichedCreditLedger(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture countCreditLedger(CountCreditLedgerRequest request) { - return this.rawClient.countCreditLedger(request).thenApply(response -> response.body()); - } - - public CompletableFuture countCreditLedger( - CountCreditLedgerRequest request, RequestOptions requestOptions) { - return this.rawClient.countCreditLedger(request, requestOptions).thenApply(response -> response.body()); - } - public CompletableFuture listBillingPlanCreditGrants() { return this.rawClient.listBillingPlanCreditGrants().thenApply(response -> response.body()); } diff --git a/src/main/java/com/schematic/api/resources/credits/AsyncRawCreditsClient.java b/src/main/java/com/schematic/api/resources/credits/AsyncRawCreditsClient.java index 0a5a03f..912ca5a 100644 --- a/src/main/java/com/schematic/api/resources/credits/AsyncRawCreditsClient.java +++ b/src/main/java/com/schematic/api/resources/credits/AsyncRawCreditsClient.java @@ -25,13 +25,11 @@ import com.schematic.api.resources.credits.requests.CountCompanyGrantsRequest; import com.schematic.api.resources.credits.requests.CountCreditBundlesRequest; import com.schematic.api.resources.credits.requests.CountCreditEventLedgerRequest; -import com.schematic.api.resources.credits.requests.CountCreditLedgerRequest; import com.schematic.api.resources.credits.requests.CreateBillingCreditRequestBody; import com.schematic.api.resources.credits.requests.CreateCompanyCreditGrant; import com.schematic.api.resources.credits.requests.CreateCreditBundleRequestBody; import com.schematic.api.resources.credits.requests.DeleteBillingPlanCreditGrantRequest; import com.schematic.api.resources.credits.requests.ExtendCreditLeaseRequestBody; -import com.schematic.api.resources.credits.requests.GetEnrichedCreditLedgerRequest; import com.schematic.api.resources.credits.requests.ListBillingCreditsRequest; import com.schematic.api.resources.credits.requests.ListBillingPlanCreditGrantsRequest; import com.schematic.api.resources.credits.requests.ListCompanyCreditBalancesRequest; @@ -49,7 +47,6 @@ import com.schematic.api.resources.credits.types.CountCompanyGrantsResponse; import com.schematic.api.resources.credits.types.CountCreditBundlesResponse; import com.schematic.api.resources.credits.types.CountCreditEventLedgerResponse; -import com.schematic.api.resources.credits.types.CountCreditLedgerResponse; import com.schematic.api.resources.credits.types.CreateBillingCreditResponse; import com.schematic.api.resources.credits.types.CreateBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.CreateCreditBundleResponse; @@ -57,7 +54,6 @@ import com.schematic.api.resources.credits.types.DeleteCreditBundleResponse; import com.schematic.api.resources.credits.types.ExtendCreditLeaseResponse; import com.schematic.api.resources.credits.types.GetCreditBundleResponse; -import com.schematic.api.resources.credits.types.GetEnrichedCreditLedgerResponse; import com.schematic.api.resources.credits.types.GetSingleBillingCreditResponse; import com.schematic.api.resources.credits.types.GetSingleBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.GrantBillingCreditsToCompanyResponse; @@ -2294,231 +2290,6 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest request) { - return getEnrichedCreditLedger(request, null); - } - - public CompletableFuture> getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("billing/credits/ledger"); - QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false); - if (request.getBillingCreditId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "billing_credit_id", request.getBillingCreditId().get(), false); - } - if (request.getFeatureId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "feature_id", request.getFeatureId().get(), false); - } - QueryStringMapper.addQueryParameter(httpUrl, "period", request.getPeriod(), false); - if (request.getStartTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "start_time", request.getStartTime().get(), false); - } - if (request.getEndTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "end_time", request.getEndTime().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getOffset().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "offset", request.getOffset().get(), false); - } - if (requestOptions != null) { - requestOptions.getQueryParameters().forEach((_key, _value) -> { - httpUrl.addQueryParameter(_key, _value); - }); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - CompletableFuture> future = - new CompletableFuture<>(); - client.newCall(okhttpRequest).enqueue(new Callback() { - @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - if (response.isSuccessful()) { - future.complete(new BaseSchematicHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, GetEnrichedCreditLedgerResponse.class), - response)); - return; - } - try { - switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 404: - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 500: - future.completeExceptionally(new InternalServerError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - future.completeExceptionally(new BaseSchematicApiException( - "Error with status code " + response.code(), response.code(), errorBody, response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> countCreditLedger( - CountCreditLedgerRequest request) { - return countCreditLedger(request, null); - } - - public CompletableFuture> countCreditLedger( - CountCreditLedgerRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("billing/credits/ledger/count"); - QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false); - if (request.getBillingCreditId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "billing_credit_id", request.getBillingCreditId().get(), false); - } - if (request.getFeatureId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "feature_id", request.getFeatureId().get(), false); - } - QueryStringMapper.addQueryParameter(httpUrl, "period", request.getPeriod(), false); - if (request.getStartTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "start_time", request.getStartTime().get(), false); - } - if (request.getEndTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "end_time", request.getEndTime().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getOffset().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "offset", request.getOffset().get(), false); - } - if (requestOptions != null) { - requestOptions.getQueryParameters().forEach((_key, _value) -> { - httpUrl.addQueryParameter(_key, _value); - }); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - CompletableFuture> future = new CompletableFuture<>(); - client.newCall(okhttpRequest).enqueue(new Callback() { - @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - if (response.isSuccessful()) { - future.complete(new BaseSchematicHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBodyString, CountCreditLedgerResponse.class), - response)); - return; - } - try { - switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 404: - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - case 500: - future.completeExceptionally(new InternalServerError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - future.completeExceptionally(new BaseSchematicApiException( - "Error with status code " + response.code(), response.code(), errorBody, response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); - } - }); - return future; - } - public CompletableFuture> listBillingPlanCreditGrants() { return listBillingPlanCreditGrants( diff --git a/src/main/java/com/schematic/api/resources/credits/CreditsClient.java b/src/main/java/com/schematic/api/resources/credits/CreditsClient.java index 05961a5..f9ce4fa 100644 --- a/src/main/java/com/schematic/api/resources/credits/CreditsClient.java +++ b/src/main/java/com/schematic/api/resources/credits/CreditsClient.java @@ -13,13 +13,11 @@ import com.schematic.api.resources.credits.requests.CountCompanyGrantsRequest; import com.schematic.api.resources.credits.requests.CountCreditBundlesRequest; import com.schematic.api.resources.credits.requests.CountCreditEventLedgerRequest; -import com.schematic.api.resources.credits.requests.CountCreditLedgerRequest; import com.schematic.api.resources.credits.requests.CreateBillingCreditRequestBody; import com.schematic.api.resources.credits.requests.CreateCompanyCreditGrant; import com.schematic.api.resources.credits.requests.CreateCreditBundleRequestBody; import com.schematic.api.resources.credits.requests.DeleteBillingPlanCreditGrantRequest; import com.schematic.api.resources.credits.requests.ExtendCreditLeaseRequestBody; -import com.schematic.api.resources.credits.requests.GetEnrichedCreditLedgerRequest; import com.schematic.api.resources.credits.requests.ListBillingCreditsRequest; import com.schematic.api.resources.credits.requests.ListBillingPlanCreditGrantsRequest; import com.schematic.api.resources.credits.requests.ListCompanyCreditBalancesRequest; @@ -37,7 +35,6 @@ import com.schematic.api.resources.credits.types.CountCompanyGrantsResponse; import com.schematic.api.resources.credits.types.CountCreditBundlesResponse; import com.schematic.api.resources.credits.types.CountCreditEventLedgerResponse; -import com.schematic.api.resources.credits.types.CountCreditLedgerResponse; import com.schematic.api.resources.credits.types.CreateBillingCreditResponse; import com.schematic.api.resources.credits.types.CreateBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.CreateCreditBundleResponse; @@ -45,7 +42,6 @@ import com.schematic.api.resources.credits.types.DeleteCreditBundleResponse; import com.schematic.api.resources.credits.types.ExtendCreditLeaseResponse; import com.schematic.api.resources.credits.types.GetCreditBundleResponse; -import com.schematic.api.resources.credits.types.GetEnrichedCreditLedgerResponse; import com.schematic.api.resources.credits.types.GetSingleBillingCreditResponse; import com.schematic.api.resources.credits.types.GetSingleBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.GrantBillingCreditsToCompanyResponse; @@ -360,24 +356,6 @@ public ReleaseCreditLeaseResponse releaseCreditLease( .body(); } - public GetEnrichedCreditLedgerResponse getEnrichedCreditLedger(GetEnrichedCreditLedgerRequest request) { - return this.rawClient.getEnrichedCreditLedger(request).body(); - } - - public GetEnrichedCreditLedgerResponse getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest request, RequestOptions requestOptions) { - return this.rawClient.getEnrichedCreditLedger(request, requestOptions).body(); - } - - public CountCreditLedgerResponse countCreditLedger(CountCreditLedgerRequest request) { - return this.rawClient.countCreditLedger(request).body(); - } - - public CountCreditLedgerResponse countCreditLedger( - CountCreditLedgerRequest request, RequestOptions requestOptions) { - return this.rawClient.countCreditLedger(request, requestOptions).body(); - } - public ListBillingPlanCreditGrantsResponse listBillingPlanCreditGrants() { return this.rawClient.listBillingPlanCreditGrants().body(); } diff --git a/src/main/java/com/schematic/api/resources/credits/RawCreditsClient.java b/src/main/java/com/schematic/api/resources/credits/RawCreditsClient.java index cfddf47..091862d 100644 --- a/src/main/java/com/schematic/api/resources/credits/RawCreditsClient.java +++ b/src/main/java/com/schematic/api/resources/credits/RawCreditsClient.java @@ -25,13 +25,11 @@ import com.schematic.api.resources.credits.requests.CountCompanyGrantsRequest; import com.schematic.api.resources.credits.requests.CountCreditBundlesRequest; import com.schematic.api.resources.credits.requests.CountCreditEventLedgerRequest; -import com.schematic.api.resources.credits.requests.CountCreditLedgerRequest; import com.schematic.api.resources.credits.requests.CreateBillingCreditRequestBody; import com.schematic.api.resources.credits.requests.CreateCompanyCreditGrant; import com.schematic.api.resources.credits.requests.CreateCreditBundleRequestBody; import com.schematic.api.resources.credits.requests.DeleteBillingPlanCreditGrantRequest; import com.schematic.api.resources.credits.requests.ExtendCreditLeaseRequestBody; -import com.schematic.api.resources.credits.requests.GetEnrichedCreditLedgerRequest; import com.schematic.api.resources.credits.requests.ListBillingCreditsRequest; import com.schematic.api.resources.credits.requests.ListBillingPlanCreditGrantsRequest; import com.schematic.api.resources.credits.requests.ListCompanyCreditBalancesRequest; @@ -49,7 +47,6 @@ import com.schematic.api.resources.credits.types.CountCompanyGrantsResponse; import com.schematic.api.resources.credits.types.CountCreditBundlesResponse; import com.schematic.api.resources.credits.types.CountCreditEventLedgerResponse; -import com.schematic.api.resources.credits.types.CountCreditLedgerResponse; import com.schematic.api.resources.credits.types.CreateBillingCreditResponse; import com.schematic.api.resources.credits.types.CreateBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.CreateCreditBundleResponse; @@ -57,7 +54,6 @@ import com.schematic.api.resources.credits.types.DeleteCreditBundleResponse; import com.schematic.api.resources.credits.types.ExtendCreditLeaseResponse; import com.schematic.api.resources.credits.types.GetCreditBundleResponse; -import com.schematic.api.resources.credits.types.GetEnrichedCreditLedgerResponse; import com.schematic.api.resources.credits.types.GetSingleBillingCreditResponse; import com.schematic.api.resources.credits.types.GetSingleBillingPlanCreditGrantResponse; import com.schematic.api.resources.credits.types.GrantBillingCreditsToCompanyResponse; @@ -1750,181 +1746,6 @@ public BaseSchematicHttpResponse releaseCreditLease( } } - public BaseSchematicHttpResponse getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest request) { - return getEnrichedCreditLedger(request, null); - } - - public BaseSchematicHttpResponse getEnrichedCreditLedger( - GetEnrichedCreditLedgerRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("billing/credits/ledger"); - QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false); - if (request.getBillingCreditId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "billing_credit_id", request.getBillingCreditId().get(), false); - } - if (request.getFeatureId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "feature_id", request.getFeatureId().get(), false); - } - QueryStringMapper.addQueryParameter(httpUrl, "period", request.getPeriod(), false); - if (request.getStartTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "start_time", request.getStartTime().get(), false); - } - if (request.getEndTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "end_time", request.getEndTime().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getOffset().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "offset", request.getOffset().get(), false); - } - if (requestOptions != null) { - requestOptions.getQueryParameters().forEach((_key, _value) -> { - httpUrl.addQueryParameter(_key, _value); - }); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - if (response.isSuccessful()) { - return new BaseSchematicHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetEnrichedCreditLedgerResponse.class), - response); - } - try { - switch (response.code()) { - case 400: - throw new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 401: - throw new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 403: - throw new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 404: - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 500: - throw new InternalServerError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - throw new BaseSchematicApiException( - "Error with status code " + response.code(), response.code(), errorBody, response); - } catch (IOException e) { - throw new BaseSchematicException("Network error executing HTTP request", e); - } - } - - public BaseSchematicHttpResponse countCreditLedger(CountCreditLedgerRequest request) { - return countCreditLedger(request, null); - } - - public BaseSchematicHttpResponse countCreditLedger( - CountCreditLedgerRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("billing/credits/ledger/count"); - QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false); - if (request.getBillingCreditId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "billing_credit_id", request.getBillingCreditId().get(), false); - } - if (request.getFeatureId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "feature_id", request.getFeatureId().get(), false); - } - QueryStringMapper.addQueryParameter(httpUrl, "period", request.getPeriod(), false); - if (request.getStartTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "start_time", request.getStartTime().get(), false); - } - if (request.getEndTime().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "end_time", request.getEndTime().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getOffset().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "offset", request.getOffset().get(), false); - } - if (requestOptions != null) { - requestOptions.getQueryParameters().forEach((_key, _value) -> { - httpUrl.addQueryParameter(_key, _value); - }); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - if (response.isSuccessful()) { - return new BaseSchematicHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CountCreditLedgerResponse.class), - response); - } - try { - switch (response.code()) { - case 400: - throw new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 401: - throw new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 403: - throw new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 404: - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - case 500: - throw new InternalServerError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - throw new BaseSchematicApiException( - "Error with status code " + response.code(), response.code(), errorBody, response); - } catch (IOException e) { - throw new BaseSchematicException("Network error executing HTTP request", e); - } - } - public BaseSchematicHttpResponse listBillingPlanCreditGrants() { return listBillingPlanCreditGrants( ListBillingPlanCreditGrantsRequest.builder().build()); diff --git a/src/main/java/com/schematic/api/resources/credits/requests/CountCreditLedgerRequest.java b/src/main/java/com/schematic/api/resources/credits/requests/CountCreditLedgerRequest.java deleted file mode 100644 index 32fb794..0000000 --- a/src/main/java/com/schematic/api/resources/credits/requests/CountCreditLedgerRequest.java +++ /dev/null @@ -1,370 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.resources.credits.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.schematic.api.core.ObjectMappers; -import com.schematic.api.types.CreditLedgerPeriod; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CountCreditLedgerRequest.Builder.class) -public final class CountCreditLedgerRequest { - private final String companyId; - - private final Optional billingCreditId; - - private final Optional featureId; - - private final CreditLedgerPeriod period; - - private final Optional startTime; - - private final Optional endTime; - - private final Optional limit; - - private final Optional offset; - - private final Map additionalProperties; - - private CountCreditLedgerRequest( - String companyId, - Optional billingCreditId, - Optional featureId, - CreditLedgerPeriod period, - Optional startTime, - Optional endTime, - Optional limit, - Optional offset, - Map additionalProperties) { - this.companyId = companyId; - this.billingCreditId = billingCreditId; - this.featureId = featureId; - this.period = period; - this.startTime = startTime; - this.endTime = endTime; - this.limit = limit; - this.offset = offset; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("company_id") - public String getCompanyId() { - return companyId; - } - - @JsonProperty("billing_credit_id") - public Optional getBillingCreditId() { - return billingCreditId; - } - - @JsonProperty("feature_id") - public Optional getFeatureId() { - return featureId; - } - - @JsonProperty("period") - public CreditLedgerPeriod getPeriod() { - return period; - } - - @JsonProperty("start_time") - public Optional getStartTime() { - return startTime; - } - - @JsonProperty("end_time") - public Optional getEndTime() { - return endTime; - } - - /** - * @return Page limit (default 100) - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return Page offset (default 0) - */ - @JsonProperty("offset") - public Optional getOffset() { - return offset; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CountCreditLedgerRequest && equalTo((CountCreditLedgerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CountCreditLedgerRequest other) { - return companyId.equals(other.companyId) - && billingCreditId.equals(other.billingCreditId) - && featureId.equals(other.featureId) - && period.equals(other.period) - && startTime.equals(other.startTime) - && endTime.equals(other.endTime) - && limit.equals(other.limit) - && offset.equals(other.offset); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.companyId, - this.billingCreditId, - this.featureId, - this.period, - this.startTime, - this.endTime, - this.limit, - this.offset); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static CompanyIdStage builder() { - return new Builder(); - } - - public interface CompanyIdStage { - PeriodStage companyId(@NotNull String companyId); - - Builder from(CountCreditLedgerRequest other); - } - - public interface PeriodStage { - _FinalStage period(@NotNull CreditLedgerPeriod period); - } - - public interface _FinalStage { - CountCreditLedgerRequest build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - _FinalStage billingCreditId(Optional billingCreditId); - - _FinalStage billingCreditId(String billingCreditId); - - _FinalStage featureId(Optional featureId); - - _FinalStage featureId(String featureId); - - _FinalStage startTime(Optional startTime); - - _FinalStage startTime(String startTime); - - _FinalStage endTime(Optional endTime); - - _FinalStage endTime(String endTime); - - /** - *

Page limit (default 100)

- */ - _FinalStage limit(Optional limit); - - _FinalStage limit(Long limit); - - /** - *

Page offset (default 0)

- */ - _FinalStage offset(Optional offset); - - _FinalStage offset(Long offset); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements CompanyIdStage, PeriodStage, _FinalStage { - private String companyId; - - private CreditLedgerPeriod period; - - private Optional offset = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional endTime = Optional.empty(); - - private Optional startTime = Optional.empty(); - - private Optional featureId = Optional.empty(); - - private Optional billingCreditId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CountCreditLedgerRequest other) { - companyId(other.getCompanyId()); - billingCreditId(other.getBillingCreditId()); - featureId(other.getFeatureId()); - period(other.getPeriod()); - startTime(other.getStartTime()); - endTime(other.getEndTime()); - limit(other.getLimit()); - offset(other.getOffset()); - return this; - } - - @java.lang.Override - @JsonSetter("company_id") - public PeriodStage companyId(@NotNull String companyId) { - this.companyId = Objects.requireNonNull(companyId, "companyId must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("period") - public _FinalStage period(@NotNull CreditLedgerPeriod period) { - this.period = Objects.requireNonNull(period, "period must not be null"); - return this; - } - - /** - *

Page offset (default 0)

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage offset(Long offset) { - this.offset = Optional.ofNullable(offset); - return this; - } - - /** - *

Page offset (default 0)

- */ - @java.lang.Override - @JsonSetter(value = "offset", nulls = Nulls.SKIP) - public _FinalStage offset(Optional offset) { - this.offset = offset; - return this; - } - - /** - *

Page limit (default 100)

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage limit(Long limit) { - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - *

Page limit (default 100)

- */ - @java.lang.Override - @JsonSetter(value = "limit", nulls = Nulls.SKIP) - public _FinalStage limit(Optional limit) { - this.limit = limit; - return this; - } - - @java.lang.Override - public _FinalStage endTime(String endTime) { - this.endTime = Optional.ofNullable(endTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_time", nulls = Nulls.SKIP) - public _FinalStage endTime(Optional endTime) { - this.endTime = endTime; - return this; - } - - @java.lang.Override - public _FinalStage startTime(String startTime) { - this.startTime = Optional.ofNullable(startTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "start_time", nulls = Nulls.SKIP) - public _FinalStage startTime(Optional startTime) { - this.startTime = startTime; - return this; - } - - @java.lang.Override - public _FinalStage featureId(String featureId) { - this.featureId = Optional.ofNullable(featureId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "feature_id", nulls = Nulls.SKIP) - public _FinalStage featureId(Optional featureId) { - this.featureId = featureId; - return this; - } - - @java.lang.Override - public _FinalStage billingCreditId(String billingCreditId) { - this.billingCreditId = Optional.ofNullable(billingCreditId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "billing_credit_id", nulls = Nulls.SKIP) - public _FinalStage billingCreditId(Optional billingCreditId) { - this.billingCreditId = billingCreditId; - return this; - } - - @java.lang.Override - public CountCreditLedgerRequest build() { - return new CountCreditLedgerRequest( - companyId, - billingCreditId, - featureId, - period, - startTime, - endTime, - limit, - offset, - additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/schematic/api/resources/credits/requests/GetEnrichedCreditLedgerRequest.java b/src/main/java/com/schematic/api/resources/credits/requests/GetEnrichedCreditLedgerRequest.java deleted file mode 100644 index 4b10bb1..0000000 --- a/src/main/java/com/schematic/api/resources/credits/requests/GetEnrichedCreditLedgerRequest.java +++ /dev/null @@ -1,370 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.resources.credits.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.schematic.api.core.ObjectMappers; -import com.schematic.api.types.CreditLedgerPeriod; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetEnrichedCreditLedgerRequest.Builder.class) -public final class GetEnrichedCreditLedgerRequest { - private final String companyId; - - private final Optional billingCreditId; - - private final Optional featureId; - - private final CreditLedgerPeriod period; - - private final Optional startTime; - - private final Optional endTime; - - private final Optional limit; - - private final Optional offset; - - private final Map additionalProperties; - - private GetEnrichedCreditLedgerRequest( - String companyId, - Optional billingCreditId, - Optional featureId, - CreditLedgerPeriod period, - Optional startTime, - Optional endTime, - Optional limit, - Optional offset, - Map additionalProperties) { - this.companyId = companyId; - this.billingCreditId = billingCreditId; - this.featureId = featureId; - this.period = period; - this.startTime = startTime; - this.endTime = endTime; - this.limit = limit; - this.offset = offset; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("company_id") - public String getCompanyId() { - return companyId; - } - - @JsonProperty("billing_credit_id") - public Optional getBillingCreditId() { - return billingCreditId; - } - - @JsonProperty("feature_id") - public Optional getFeatureId() { - return featureId; - } - - @JsonProperty("period") - public CreditLedgerPeriod getPeriod() { - return period; - } - - @JsonProperty("start_time") - public Optional getStartTime() { - return startTime; - } - - @JsonProperty("end_time") - public Optional getEndTime() { - return endTime; - } - - /** - * @return Page limit (default 100) - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return Page offset (default 0) - */ - @JsonProperty("offset") - public Optional getOffset() { - return offset; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetEnrichedCreditLedgerRequest && equalTo((GetEnrichedCreditLedgerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetEnrichedCreditLedgerRequest other) { - return companyId.equals(other.companyId) - && billingCreditId.equals(other.billingCreditId) - && featureId.equals(other.featureId) - && period.equals(other.period) - && startTime.equals(other.startTime) - && endTime.equals(other.endTime) - && limit.equals(other.limit) - && offset.equals(other.offset); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.companyId, - this.billingCreditId, - this.featureId, - this.period, - this.startTime, - this.endTime, - this.limit, - this.offset); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static CompanyIdStage builder() { - return new Builder(); - } - - public interface CompanyIdStage { - PeriodStage companyId(@NotNull String companyId); - - Builder from(GetEnrichedCreditLedgerRequest other); - } - - public interface PeriodStage { - _FinalStage period(@NotNull CreditLedgerPeriod period); - } - - public interface _FinalStage { - GetEnrichedCreditLedgerRequest build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - _FinalStage billingCreditId(Optional billingCreditId); - - _FinalStage billingCreditId(String billingCreditId); - - _FinalStage featureId(Optional featureId); - - _FinalStage featureId(String featureId); - - _FinalStage startTime(Optional startTime); - - _FinalStage startTime(String startTime); - - _FinalStage endTime(Optional endTime); - - _FinalStage endTime(String endTime); - - /** - *

Page limit (default 100)

- */ - _FinalStage limit(Optional limit); - - _FinalStage limit(Long limit); - - /** - *

Page offset (default 0)

- */ - _FinalStage offset(Optional offset); - - _FinalStage offset(Long offset); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements CompanyIdStage, PeriodStage, _FinalStage { - private String companyId; - - private CreditLedgerPeriod period; - - private Optional offset = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional endTime = Optional.empty(); - - private Optional startTime = Optional.empty(); - - private Optional featureId = Optional.empty(); - - private Optional billingCreditId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetEnrichedCreditLedgerRequest other) { - companyId(other.getCompanyId()); - billingCreditId(other.getBillingCreditId()); - featureId(other.getFeatureId()); - period(other.getPeriod()); - startTime(other.getStartTime()); - endTime(other.getEndTime()); - limit(other.getLimit()); - offset(other.getOffset()); - return this; - } - - @java.lang.Override - @JsonSetter("company_id") - public PeriodStage companyId(@NotNull String companyId) { - this.companyId = Objects.requireNonNull(companyId, "companyId must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("period") - public _FinalStage period(@NotNull CreditLedgerPeriod period) { - this.period = Objects.requireNonNull(period, "period must not be null"); - return this; - } - - /** - *

Page offset (default 0)

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage offset(Long offset) { - this.offset = Optional.ofNullable(offset); - return this; - } - - /** - *

Page offset (default 0)

- */ - @java.lang.Override - @JsonSetter(value = "offset", nulls = Nulls.SKIP) - public _FinalStage offset(Optional offset) { - this.offset = offset; - return this; - } - - /** - *

Page limit (default 100)

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage limit(Long limit) { - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - *

Page limit (default 100)

- */ - @java.lang.Override - @JsonSetter(value = "limit", nulls = Nulls.SKIP) - public _FinalStage limit(Optional limit) { - this.limit = limit; - return this; - } - - @java.lang.Override - public _FinalStage endTime(String endTime) { - this.endTime = Optional.ofNullable(endTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_time", nulls = Nulls.SKIP) - public _FinalStage endTime(Optional endTime) { - this.endTime = endTime; - return this; - } - - @java.lang.Override - public _FinalStage startTime(String startTime) { - this.startTime = Optional.ofNullable(startTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "start_time", nulls = Nulls.SKIP) - public _FinalStage startTime(Optional startTime) { - this.startTime = startTime; - return this; - } - - @java.lang.Override - public _FinalStage featureId(String featureId) { - this.featureId = Optional.ofNullable(featureId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "feature_id", nulls = Nulls.SKIP) - public _FinalStage featureId(Optional featureId) { - this.featureId = featureId; - return this; - } - - @java.lang.Override - public _FinalStage billingCreditId(String billingCreditId) { - this.billingCreditId = Optional.ofNullable(billingCreditId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "billing_credit_id", nulls = Nulls.SKIP) - public _FinalStage billingCreditId(Optional billingCreditId) { - this.billingCreditId = billingCreditId; - return this; - } - - @java.lang.Override - public GetEnrichedCreditLedgerRequest build() { - return new GetEnrichedCreditLedgerRequest( - companyId, - billingCreditId, - featureId, - period, - startTime, - endTime, - limit, - offset, - additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerParams.java b/src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerParams.java deleted file mode 100644 index 649986c..0000000 --- a/src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerParams.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.resources.credits.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.schematic.api.core.ObjectMappers; -import com.schematic.api.types.CreditLedgerPeriod; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CountCreditLedgerParams.Builder.class) -public final class CountCreditLedgerParams { - private final Optional billingCreditId; - - private final Optional companyId; - - private final Optional endTime; - - private final Optional featureId; - - private final Optional limit; - - private final Optional offset; - - private final Optional period; - - private final Optional startTime; - - private final Map additionalProperties; - - private CountCreditLedgerParams( - Optional billingCreditId, - Optional companyId, - Optional endTime, - Optional featureId, - Optional limit, - Optional offset, - Optional period, - Optional startTime, - Map additionalProperties) { - this.billingCreditId = billingCreditId; - this.companyId = companyId; - this.endTime = endTime; - this.featureId = featureId; - this.limit = limit; - this.offset = offset; - this.period = period; - this.startTime = startTime; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("billing_credit_id") - public Optional getBillingCreditId() { - return billingCreditId; - } - - @JsonProperty("company_id") - public Optional getCompanyId() { - return companyId; - } - - @JsonProperty("end_time") - public Optional getEndTime() { - return endTime; - } - - @JsonProperty("feature_id") - public Optional getFeatureId() { - return featureId; - } - - /** - * @return Page limit (default 100) - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return Page offset (default 0) - */ - @JsonProperty("offset") - public Optional getOffset() { - return offset; - } - - @JsonProperty("period") - public Optional getPeriod() { - return period; - } - - @JsonProperty("start_time") - public Optional getStartTime() { - return startTime; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CountCreditLedgerParams && equalTo((CountCreditLedgerParams) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CountCreditLedgerParams other) { - return billingCreditId.equals(other.billingCreditId) - && companyId.equals(other.companyId) - && endTime.equals(other.endTime) - && featureId.equals(other.featureId) - && limit.equals(other.limit) - && offset.equals(other.offset) - && period.equals(other.period) - && startTime.equals(other.startTime); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.billingCreditId, - this.companyId, - this.endTime, - this.featureId, - this.limit, - this.offset, - this.period, - this.startTime); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional billingCreditId = Optional.empty(); - - private Optional companyId = Optional.empty(); - - private Optional endTime = Optional.empty(); - - private Optional featureId = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional offset = Optional.empty(); - - private Optional period = Optional.empty(); - - private Optional startTime = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CountCreditLedgerParams other) { - billingCreditId(other.getBillingCreditId()); - companyId(other.getCompanyId()); - endTime(other.getEndTime()); - featureId(other.getFeatureId()); - limit(other.getLimit()); - offset(other.getOffset()); - period(other.getPeriod()); - startTime(other.getStartTime()); - return this; - } - - @JsonSetter(value = "billing_credit_id", nulls = Nulls.SKIP) - public Builder billingCreditId(Optional billingCreditId) { - this.billingCreditId = billingCreditId; - return this; - } - - public Builder billingCreditId(String billingCreditId) { - this.billingCreditId = Optional.ofNullable(billingCreditId); - return this; - } - - @JsonSetter(value = "company_id", nulls = Nulls.SKIP) - public Builder companyId(Optional companyId) { - this.companyId = companyId; - return this; - } - - public Builder companyId(String companyId) { - this.companyId = Optional.ofNullable(companyId); - return this; - } - - @JsonSetter(value = "end_time", nulls = Nulls.SKIP) - public Builder endTime(Optional endTime) { - this.endTime = endTime; - return this; - } - - public Builder endTime(String endTime) { - this.endTime = Optional.ofNullable(endTime); - return this; - } - - @JsonSetter(value = "feature_id", nulls = Nulls.SKIP) - public Builder featureId(Optional featureId) { - this.featureId = featureId; - return this; - } - - public Builder featureId(String featureId) { - this.featureId = Optional.ofNullable(featureId); - return this; - } - - /** - *

Page limit (default 100)

- */ - @JsonSetter(value = "limit", nulls = Nulls.SKIP) - public Builder limit(Optional limit) { - this.limit = limit; - return this; - } - - public Builder limit(Long limit) { - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - *

Page offset (default 0)

- */ - @JsonSetter(value = "offset", nulls = Nulls.SKIP) - public Builder offset(Optional offset) { - this.offset = offset; - return this; - } - - public Builder offset(Long offset) { - this.offset = Optional.ofNullable(offset); - return this; - } - - @JsonSetter(value = "period", nulls = Nulls.SKIP) - public Builder period(Optional period) { - this.period = period; - return this; - } - - public Builder period(CreditLedgerPeriod period) { - this.period = Optional.ofNullable(period); - return this; - } - - @JsonSetter(value = "start_time", nulls = Nulls.SKIP) - public Builder startTime(Optional startTime) { - this.startTime = startTime; - return this; - } - - public Builder startTime(String startTime) { - this.startTime = Optional.ofNullable(startTime); - return this; - } - - public CountCreditLedgerParams build() { - return new CountCreditLedgerParams( - billingCreditId, - companyId, - endTime, - featureId, - limit, - offset, - period, - startTime, - additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerResponse.java b/src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerResponse.java deleted file mode 100644 index 0691a0e..0000000 --- a/src/main/java/com/schematic/api/resources/credits/types/CountCreditLedgerResponse.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.resources.credits.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.schematic.api.core.ObjectMappers; -import com.schematic.api.types.CountResponse; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CountCreditLedgerResponse.Builder.class) -public final class CountCreditLedgerResponse { - private final CountResponse data; - - private final CountCreditLedgerParams params; - - private final Map additionalProperties; - - private CountCreditLedgerResponse( - CountResponse data, CountCreditLedgerParams params, Map additionalProperties) { - this.data = data; - this.params = params; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public CountResponse getData() { - return data; - } - - /** - * @return Input parameters - */ - @JsonProperty("params") - public CountCreditLedgerParams getParams() { - return params; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CountCreditLedgerResponse && equalTo((CountCreditLedgerResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CountCreditLedgerResponse other) { - return data.equals(other.data) && params.equals(other.params); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.params); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static DataStage builder() { - return new Builder(); - } - - public interface DataStage { - ParamsStage data(@NotNull CountResponse data); - - Builder from(CountCreditLedgerResponse other); - } - - public interface ParamsStage { - /** - *

Input parameters

- */ - _FinalStage params(@NotNull CountCreditLedgerParams params); - } - - public interface _FinalStage { - CountCreditLedgerResponse build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DataStage, ParamsStage, _FinalStage { - private CountResponse data; - - private CountCreditLedgerParams params; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CountCreditLedgerResponse other) { - data(other.getData()); - params(other.getParams()); - return this; - } - - @java.lang.Override - @JsonSetter("data") - public ParamsStage data(@NotNull CountResponse data) { - this.data = Objects.requireNonNull(data, "data must not be null"); - return this; - } - - /** - *

Input parameters

- *

Input parameters

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("params") - public _FinalStage params(@NotNull CountCreditLedgerParams params) { - this.params = Objects.requireNonNull(params, "params must not be null"); - return this; - } - - @java.lang.Override - public CountCreditLedgerResponse build() { - return new CountCreditLedgerResponse(data, params, additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerParams.java b/src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerParams.java deleted file mode 100644 index c0841ef..0000000 --- a/src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerParams.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.resources.credits.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.schematic.api.core.ObjectMappers; -import com.schematic.api.types.CreditLedgerPeriod; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetEnrichedCreditLedgerParams.Builder.class) -public final class GetEnrichedCreditLedgerParams { - private final Optional billingCreditId; - - private final Optional companyId; - - private final Optional endTime; - - private final Optional featureId; - - private final Optional limit; - - private final Optional offset; - - private final Optional period; - - private final Optional startTime; - - private final Map additionalProperties; - - private GetEnrichedCreditLedgerParams( - Optional billingCreditId, - Optional companyId, - Optional endTime, - Optional featureId, - Optional limit, - Optional offset, - Optional period, - Optional startTime, - Map additionalProperties) { - this.billingCreditId = billingCreditId; - this.companyId = companyId; - this.endTime = endTime; - this.featureId = featureId; - this.limit = limit; - this.offset = offset; - this.period = period; - this.startTime = startTime; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("billing_credit_id") - public Optional getBillingCreditId() { - return billingCreditId; - } - - @JsonProperty("company_id") - public Optional getCompanyId() { - return companyId; - } - - @JsonProperty("end_time") - public Optional getEndTime() { - return endTime; - } - - @JsonProperty("feature_id") - public Optional getFeatureId() { - return featureId; - } - - /** - * @return Page limit (default 100) - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return Page offset (default 0) - */ - @JsonProperty("offset") - public Optional getOffset() { - return offset; - } - - @JsonProperty("period") - public Optional getPeriod() { - return period; - } - - @JsonProperty("start_time") - public Optional getStartTime() { - return startTime; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetEnrichedCreditLedgerParams && equalTo((GetEnrichedCreditLedgerParams) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetEnrichedCreditLedgerParams other) { - return billingCreditId.equals(other.billingCreditId) - && companyId.equals(other.companyId) - && endTime.equals(other.endTime) - && featureId.equals(other.featureId) - && limit.equals(other.limit) - && offset.equals(other.offset) - && period.equals(other.period) - && startTime.equals(other.startTime); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.billingCreditId, - this.companyId, - this.endTime, - this.featureId, - this.limit, - this.offset, - this.period, - this.startTime); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional billingCreditId = Optional.empty(); - - private Optional companyId = Optional.empty(); - - private Optional endTime = Optional.empty(); - - private Optional featureId = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional offset = Optional.empty(); - - private Optional period = Optional.empty(); - - private Optional startTime = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GetEnrichedCreditLedgerParams other) { - billingCreditId(other.getBillingCreditId()); - companyId(other.getCompanyId()); - endTime(other.getEndTime()); - featureId(other.getFeatureId()); - limit(other.getLimit()); - offset(other.getOffset()); - period(other.getPeriod()); - startTime(other.getStartTime()); - return this; - } - - @JsonSetter(value = "billing_credit_id", nulls = Nulls.SKIP) - public Builder billingCreditId(Optional billingCreditId) { - this.billingCreditId = billingCreditId; - return this; - } - - public Builder billingCreditId(String billingCreditId) { - this.billingCreditId = Optional.ofNullable(billingCreditId); - return this; - } - - @JsonSetter(value = "company_id", nulls = Nulls.SKIP) - public Builder companyId(Optional companyId) { - this.companyId = companyId; - return this; - } - - public Builder companyId(String companyId) { - this.companyId = Optional.ofNullable(companyId); - return this; - } - - @JsonSetter(value = "end_time", nulls = Nulls.SKIP) - public Builder endTime(Optional endTime) { - this.endTime = endTime; - return this; - } - - public Builder endTime(String endTime) { - this.endTime = Optional.ofNullable(endTime); - return this; - } - - @JsonSetter(value = "feature_id", nulls = Nulls.SKIP) - public Builder featureId(Optional featureId) { - this.featureId = featureId; - return this; - } - - public Builder featureId(String featureId) { - this.featureId = Optional.ofNullable(featureId); - return this; - } - - /** - *

Page limit (default 100)

- */ - @JsonSetter(value = "limit", nulls = Nulls.SKIP) - public Builder limit(Optional limit) { - this.limit = limit; - return this; - } - - public Builder limit(Long limit) { - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - *

Page offset (default 0)

- */ - @JsonSetter(value = "offset", nulls = Nulls.SKIP) - public Builder offset(Optional offset) { - this.offset = offset; - return this; - } - - public Builder offset(Long offset) { - this.offset = Optional.ofNullable(offset); - return this; - } - - @JsonSetter(value = "period", nulls = Nulls.SKIP) - public Builder period(Optional period) { - this.period = period; - return this; - } - - public Builder period(CreditLedgerPeriod period) { - this.period = Optional.ofNullable(period); - return this; - } - - @JsonSetter(value = "start_time", nulls = Nulls.SKIP) - public Builder startTime(Optional startTime) { - this.startTime = startTime; - return this; - } - - public Builder startTime(String startTime) { - this.startTime = Optional.ofNullable(startTime); - return this; - } - - public GetEnrichedCreditLedgerParams build() { - return new GetEnrichedCreditLedgerParams( - billingCreditId, - companyId, - endTime, - featureId, - limit, - offset, - period, - startTime, - additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerResponse.java b/src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerResponse.java deleted file mode 100644 index 475c367..0000000 --- a/src/main/java/com/schematic/api/resources/credits/types/GetEnrichedCreditLedgerResponse.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.resources.credits.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.schematic.api.core.ObjectMappers; -import com.schematic.api.types.CreditLedgerEnrichedEntryResponseData; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetEnrichedCreditLedgerResponse.Builder.class) -public final class GetEnrichedCreditLedgerResponse { - private final List data; - - private final GetEnrichedCreditLedgerParams params; - - private final Map additionalProperties; - - private GetEnrichedCreditLedgerResponse( - List data, - GetEnrichedCreditLedgerParams params, - Map additionalProperties) { - this.data = data; - this.params = params; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - /** - * @return Input parameters - */ - @JsonProperty("params") - public GetEnrichedCreditLedgerParams getParams() { - return params; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetEnrichedCreditLedgerResponse && equalTo((GetEnrichedCreditLedgerResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetEnrichedCreditLedgerResponse other) { - return data.equals(other.data) && params.equals(other.params); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.params); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ParamsStage builder() { - return new Builder(); - } - - public interface ParamsStage { - /** - *

Input parameters

- */ - _FinalStage params(@NotNull GetEnrichedCreditLedgerParams params); - - Builder from(GetEnrichedCreditLedgerResponse other); - } - - public interface _FinalStage { - GetEnrichedCreditLedgerResponse build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - _FinalStage data(List data); - - _FinalStage addData(CreditLedgerEnrichedEntryResponseData data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ParamsStage, _FinalStage { - private GetEnrichedCreditLedgerParams params; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetEnrichedCreditLedgerResponse other) { - data(other.getData()); - params(other.getParams()); - return this; - } - - /** - *

Input parameters

- *

Input parameters

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("params") - public _FinalStage params(@NotNull GetEnrichedCreditLedgerParams params) { - this.params = Objects.requireNonNull(params, "params must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage addAllData(List data) { - if (data != null) { - this.data.addAll(data); - } - return this; - } - - @java.lang.Override - public _FinalStage addData(CreditLedgerEnrichedEntryResponseData data) { - this.data.add(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - if (data != null) { - this.data.addAll(data); - } - return this; - } - - @java.lang.Override - public GetEnrichedCreditLedgerResponse build() { - return new GetEnrichedCreditLedgerResponse(data, params, additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/schematic/api/resources/plangroups/requests/CreatePlanGroupRequestBody.java b/src/main/java/com/schematic/api/resources/plangroups/requests/CreatePlanGroupRequestBody.java index 1efe1fc..ffa4df5 100644 --- a/src/main/java/com/schematic/api/resources/plangroups/requests/CreatePlanGroupRequestBody.java +++ b/src/main/java/com/schematic/api/resources/plangroups/requests/CreatePlanGroupRequestBody.java @@ -54,6 +54,12 @@ public final class CreatePlanGroupRequestBody { private final Optional initialPlanPriceId; + private final boolean optInEnabled; + + private final Optional optInText; + + private final Optional optInTitle; + private final List orderedAddOns; private final List orderedBundleList; @@ -111,6 +117,9 @@ private CreatePlanGroupRequestBody( Optional fallbackPlanId, Optional initialPlanId, Optional initialPlanPriceId, + boolean optInEnabled, + Optional optInText, + Optional optInTitle, List orderedAddOns, List orderedBundleList, List orderedPlans, @@ -145,6 +154,9 @@ private CreatePlanGroupRequestBody( this.fallbackPlanId = fallbackPlanId; this.initialPlanId = initialPlanId; this.initialPlanPriceId = initialPlanPriceId; + this.optInEnabled = optInEnabled; + this.optInText = optInText; + this.optInTitle = optInTitle; this.orderedAddOns = orderedAddOns; this.orderedBundleList = orderedBundleList; this.orderedPlans = orderedPlans; @@ -232,6 +244,21 @@ public Optional getInitialPlanPriceId() { return initialPlanPriceId; } + @JsonProperty("opt_in_enabled") + public boolean getOptInEnabled() { + return optInEnabled; + } + + @JsonProperty("opt_in_text") + public Optional getOptInText() { + return optInText; + } + + @JsonProperty("opt_in_title") + public Optional getOptInTitle() { + return optInTitle; + } + @JsonProperty("ordered_add_ons") public List getOrderedAddOns() { return orderedAddOns; @@ -361,6 +388,9 @@ private boolean equalTo(CreatePlanGroupRequestBody other) { && fallbackPlanId.equals(other.fallbackPlanId) && initialPlanId.equals(other.initialPlanId) && initialPlanPriceId.equals(other.initialPlanPriceId) + && optInEnabled == other.optInEnabled + && optInText.equals(other.optInText) + && optInTitle.equals(other.optInTitle) && orderedAddOns.equals(other.orderedAddOns) && orderedBundleList.equals(other.orderedBundleList) && orderedPlans.equals(other.orderedPlans) @@ -399,6 +429,9 @@ public int hashCode() { this.fallbackPlanId, this.initialPlanId, this.initialPlanPriceId, + this.optInEnabled, + this.optInText, + this.optInTitle, this.orderedAddOns, this.orderedBundleList, this.orderedPlans, @@ -446,7 +479,11 @@ public interface CheckoutCollectPhoneStage { } public interface EnableTaxCollectionStage { - PreventDowngradesWhenOverLimitStage enableTaxCollection(boolean enableTaxCollection); + OptInEnabledStage enableTaxCollection(boolean enableTaxCollection); + } + + public interface OptInEnabledStage { + PreventDowngradesWhenOverLimitStage optInEnabled(boolean optInEnabled); } public interface PreventDowngradesWhenOverLimitStage { @@ -533,6 +570,14 @@ public interface _FinalStage { _FinalStage initialPlanPriceId(String initialPlanPriceId); + _FinalStage optInText(Optional optInText); + + _FinalStage optInText(String optInText); + + _FinalStage optInTitle(Optional optInTitle); + + _FinalStage optInTitle(String optInTitle); + _FinalStage orderedAddOns(List orderedAddOns); _FinalStage addOrderedAddOns(OrderedPlansInGroup orderedAddOns); @@ -590,6 +635,7 @@ public static final class Builder CheckoutCollectEmailStage, CheckoutCollectPhoneStage, EnableTaxCollectionStage, + OptInEnabledStage, PreventDowngradesWhenOverLimitStage, PreventSelfServiceDowngradeStage, ProrationBehaviorStage, @@ -609,6 +655,8 @@ public static final class Builder private boolean enableTaxCollection; + private boolean optInEnabled; + private boolean preventDowngradesWhenOverLimit; private boolean preventSelfServiceDowngrade; @@ -651,6 +699,10 @@ public static final class Builder private List orderedAddOns = new ArrayList<>(); + private Optional optInTitle = Optional.empty(); + + private Optional optInText = Optional.empty(); + private Optional initialPlanPriceId = Optional.empty(); private Optional initialPlanId = Optional.empty(); @@ -686,6 +738,9 @@ public Builder from(CreatePlanGroupRequestBody other) { fallbackPlanId(other.getFallbackPlanId()); initialPlanId(other.getInitialPlanId()); initialPlanPriceId(other.getInitialPlanPriceId()); + optInEnabled(other.getOptInEnabled()); + optInText(other.getOptInText()); + optInTitle(other.getOptInTitle()); orderedAddOns(other.getOrderedAddOns()); orderedBundleList(other.getOrderedBundleList()); orderedPlans(other.getOrderedPlans()); @@ -733,11 +788,18 @@ public EnableTaxCollectionStage checkoutCollectPhone(boolean checkoutCollectPhon @java.lang.Override @JsonSetter("enable_tax_collection") - public PreventDowngradesWhenOverLimitStage enableTaxCollection(boolean enableTaxCollection) { + public OptInEnabledStage enableTaxCollection(boolean enableTaxCollection) { this.enableTaxCollection = enableTaxCollection; return this; } + @java.lang.Override + @JsonSetter("opt_in_enabled") + public PreventDowngradesWhenOverLimitStage optInEnabled(boolean optInEnabled) { + this.optInEnabled = optInEnabled; + return this; + } + @java.lang.Override @JsonSetter("prevent_downgrades_when_over_limit") public PreventSelfServiceDowngradeStage preventDowngradesWhenOverLimit(boolean preventDowngradesWhenOverLimit) { @@ -987,6 +1049,32 @@ public _FinalStage orderedAddOns(List orderedAddOns) { return this; } + @java.lang.Override + public _FinalStage optInTitle(String optInTitle) { + this.optInTitle = Optional.ofNullable(optInTitle); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_title", nulls = Nulls.SKIP) + public _FinalStage optInTitle(Optional optInTitle) { + this.optInTitle = optInTitle; + return this; + } + + @java.lang.Override + public _FinalStage optInText(String optInText) { + this.optInText = Optional.ofNullable(optInText); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_text", nulls = Nulls.SKIP) + public _FinalStage optInText(Optional optInText) { + this.optInText = optInText; + return this; + } + @java.lang.Override public _FinalStage initialPlanPriceId(String initialPlanPriceId) { this.initialPlanPriceId = Optional.ofNullable(initialPlanPriceId); @@ -1128,6 +1216,9 @@ public CreatePlanGroupRequestBody build() { fallbackPlanId, initialPlanId, initialPlanPriceId, + optInEnabled, + optInText, + optInTitle, orderedAddOns, orderedBundleList, orderedPlans, diff --git a/src/main/java/com/schematic/api/resources/plangroups/requests/UpdatePlanGroupRequestBody.java b/src/main/java/com/schematic/api/resources/plangroups/requests/UpdatePlanGroupRequestBody.java index a8dc851..67cda9e 100644 --- a/src/main/java/com/schematic/api/resources/plangroups/requests/UpdatePlanGroupRequestBody.java +++ b/src/main/java/com/schematic/api/resources/plangroups/requests/UpdatePlanGroupRequestBody.java @@ -54,6 +54,12 @@ public final class UpdatePlanGroupRequestBody { private final Optional initialPlanPriceId; + private final boolean optInEnabled; + + private final Optional optInText; + + private final Optional optInTitle; + private final List orderedAddOns; private final List orderedBundleList; @@ -111,6 +117,9 @@ private UpdatePlanGroupRequestBody( Optional fallbackPlanId, Optional initialPlanId, Optional initialPlanPriceId, + boolean optInEnabled, + Optional optInText, + Optional optInTitle, List orderedAddOns, List orderedBundleList, List orderedPlans, @@ -145,6 +154,9 @@ private UpdatePlanGroupRequestBody( this.fallbackPlanId = fallbackPlanId; this.initialPlanId = initialPlanId; this.initialPlanPriceId = initialPlanPriceId; + this.optInEnabled = optInEnabled; + this.optInText = optInText; + this.optInTitle = optInTitle; this.orderedAddOns = orderedAddOns; this.orderedBundleList = orderedBundleList; this.orderedPlans = orderedPlans; @@ -232,6 +244,21 @@ public Optional getInitialPlanPriceId() { return initialPlanPriceId; } + @JsonProperty("opt_in_enabled") + public boolean getOptInEnabled() { + return optInEnabled; + } + + @JsonProperty("opt_in_text") + public Optional getOptInText() { + return optInText; + } + + @JsonProperty("opt_in_title") + public Optional getOptInTitle() { + return optInTitle; + } + @JsonProperty("ordered_add_ons") public List getOrderedAddOns() { return orderedAddOns; @@ -361,6 +388,9 @@ private boolean equalTo(UpdatePlanGroupRequestBody other) { && fallbackPlanId.equals(other.fallbackPlanId) && initialPlanId.equals(other.initialPlanId) && initialPlanPriceId.equals(other.initialPlanPriceId) + && optInEnabled == other.optInEnabled + && optInText.equals(other.optInText) + && optInTitle.equals(other.optInTitle) && orderedAddOns.equals(other.orderedAddOns) && orderedBundleList.equals(other.orderedBundleList) && orderedPlans.equals(other.orderedPlans) @@ -399,6 +429,9 @@ public int hashCode() { this.fallbackPlanId, this.initialPlanId, this.initialPlanPriceId, + this.optInEnabled, + this.optInText, + this.optInTitle, this.orderedAddOns, this.orderedBundleList, this.orderedPlans, @@ -446,7 +479,11 @@ public interface CheckoutCollectPhoneStage { } public interface EnableTaxCollectionStage { - PreventDowngradesWhenOverLimitStage enableTaxCollection(boolean enableTaxCollection); + OptInEnabledStage enableTaxCollection(boolean enableTaxCollection); + } + + public interface OptInEnabledStage { + PreventDowngradesWhenOverLimitStage optInEnabled(boolean optInEnabled); } public interface PreventDowngradesWhenOverLimitStage { @@ -533,6 +570,14 @@ public interface _FinalStage { _FinalStage initialPlanPriceId(String initialPlanPriceId); + _FinalStage optInText(Optional optInText); + + _FinalStage optInText(String optInText); + + _FinalStage optInTitle(Optional optInTitle); + + _FinalStage optInTitle(String optInTitle); + _FinalStage orderedAddOns(List orderedAddOns); _FinalStage addOrderedAddOns(OrderedPlansInGroup orderedAddOns); @@ -590,6 +635,7 @@ public static final class Builder CheckoutCollectEmailStage, CheckoutCollectPhoneStage, EnableTaxCollectionStage, + OptInEnabledStage, PreventDowngradesWhenOverLimitStage, PreventSelfServiceDowngradeStage, ProrationBehaviorStage, @@ -609,6 +655,8 @@ public static final class Builder private boolean enableTaxCollection; + private boolean optInEnabled; + private boolean preventDowngradesWhenOverLimit; private boolean preventSelfServiceDowngrade; @@ -651,6 +699,10 @@ public static final class Builder private List orderedAddOns = new ArrayList<>(); + private Optional optInTitle = Optional.empty(); + + private Optional optInText = Optional.empty(); + private Optional initialPlanPriceId = Optional.empty(); private Optional initialPlanId = Optional.empty(); @@ -686,6 +738,9 @@ public Builder from(UpdatePlanGroupRequestBody other) { fallbackPlanId(other.getFallbackPlanId()); initialPlanId(other.getInitialPlanId()); initialPlanPriceId(other.getInitialPlanPriceId()); + optInEnabled(other.getOptInEnabled()); + optInText(other.getOptInText()); + optInTitle(other.getOptInTitle()); orderedAddOns(other.getOrderedAddOns()); orderedBundleList(other.getOrderedBundleList()); orderedPlans(other.getOrderedPlans()); @@ -733,11 +788,18 @@ public EnableTaxCollectionStage checkoutCollectPhone(boolean checkoutCollectPhon @java.lang.Override @JsonSetter("enable_tax_collection") - public PreventDowngradesWhenOverLimitStage enableTaxCollection(boolean enableTaxCollection) { + public OptInEnabledStage enableTaxCollection(boolean enableTaxCollection) { this.enableTaxCollection = enableTaxCollection; return this; } + @java.lang.Override + @JsonSetter("opt_in_enabled") + public PreventDowngradesWhenOverLimitStage optInEnabled(boolean optInEnabled) { + this.optInEnabled = optInEnabled; + return this; + } + @java.lang.Override @JsonSetter("prevent_downgrades_when_over_limit") public PreventSelfServiceDowngradeStage preventDowngradesWhenOverLimit(boolean preventDowngradesWhenOverLimit) { @@ -987,6 +1049,32 @@ public _FinalStage orderedAddOns(List orderedAddOns) { return this; } + @java.lang.Override + public _FinalStage optInTitle(String optInTitle) { + this.optInTitle = Optional.ofNullable(optInTitle); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_title", nulls = Nulls.SKIP) + public _FinalStage optInTitle(Optional optInTitle) { + this.optInTitle = optInTitle; + return this; + } + + @java.lang.Override + public _FinalStage optInText(String optInText) { + this.optInText = Optional.ofNullable(optInText); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_text", nulls = Nulls.SKIP) + public _FinalStage optInText(Optional optInText) { + this.optInText = optInText; + return this; + } + @java.lang.Override public _FinalStage initialPlanPriceId(String initialPlanPriceId) { this.initialPlanPriceId = Optional.ofNullable(initialPlanPriceId); @@ -1128,6 +1216,9 @@ public UpdatePlanGroupRequestBody build() { fallbackPlanId, initialPlanId, initialPlanPriceId, + optInEnabled, + optInText, + optInTitle, orderedAddOns, orderedBundleList, orderedPlans, diff --git a/src/main/java/com/schematic/api/resources/plans/requests/PublishPlanVersionRequestBody.java b/src/main/java/com/schematic/api/resources/plans/requests/PublishPlanVersionRequestBody.java index 6be8b1a..02bbce9 100644 --- a/src/main/java/com/schematic/api/resources/plans/requests/PublishPlanVersionRequestBody.java +++ b/src/main/java/com/schematic/api/resources/plans/requests/PublishPlanVersionRequestBody.java @@ -14,7 +14,6 @@ import com.schematic.api.core.ObjectMappers; import com.schematic.api.types.CustomPlanActivationStrategy; import com.schematic.api.types.PlanVersionMigrationStrategy; -import com.schematic.api.types.UpdatePayInAdvanceRequestBody; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -36,8 +35,6 @@ public final class PublishPlanVersionRequestBody { private final PlanVersionMigrationStrategy migrationStrategy; - private final List payInAdvance; - private final Map additionalProperties; private PublishPlanVersionRequestBody( @@ -46,14 +43,12 @@ private PublishPlanVersionRequestBody( Optional daysUntilDue, List excludedCompanyIds, PlanVersionMigrationStrategy migrationStrategy, - List payInAdvance, Map additionalProperties) { this.activationStrategy = activationStrategy; this.customerEmail = customerEmail; this.daysUntilDue = daysUntilDue; this.excludedCompanyIds = excludedCompanyIds; this.migrationStrategy = migrationStrategy; - this.payInAdvance = payInAdvance; this.additionalProperties = additionalProperties; } @@ -82,11 +77,6 @@ public PlanVersionMigrationStrategy getMigrationStrategy() { return migrationStrategy; } - @JsonProperty("pay_in_advance") - public List getPayInAdvance() { - return payInAdvance; - } - @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -103,8 +93,7 @@ private boolean equalTo(PublishPlanVersionRequestBody other) { && customerEmail.equals(other.customerEmail) && daysUntilDue.equals(other.daysUntilDue) && excludedCompanyIds.equals(other.excludedCompanyIds) - && migrationStrategy.equals(other.migrationStrategy) - && payInAdvance.equals(other.payInAdvance); + && migrationStrategy.equals(other.migrationStrategy); } @java.lang.Override @@ -114,8 +103,7 @@ public int hashCode() { this.customerEmail, this.daysUntilDue, this.excludedCompanyIds, - this.migrationStrategy, - this.payInAdvance); + this.migrationStrategy); } @java.lang.Override @@ -157,20 +145,12 @@ public interface _FinalStage { _FinalStage addExcludedCompanyIds(String excludedCompanyIds); _FinalStage addAllExcludedCompanyIds(List excludedCompanyIds); - - _FinalStage payInAdvance(List payInAdvance); - - _FinalStage addPayInAdvance(UpdatePayInAdvanceRequestBody payInAdvance); - - _FinalStage addAllPayInAdvance(List payInAdvance); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements MigrationStrategyStage, _FinalStage { private PlanVersionMigrationStrategy migrationStrategy; - private List payInAdvance = new ArrayList<>(); - private List excludedCompanyIds = new ArrayList<>(); private Optional daysUntilDue = Optional.empty(); @@ -191,7 +171,6 @@ public Builder from(PublishPlanVersionRequestBody other) { daysUntilDue(other.getDaysUntilDue()); excludedCompanyIds(other.getExcludedCompanyIds()); migrationStrategy(other.getMigrationStrategy()); - payInAdvance(other.getPayInAdvance()); return this; } @@ -202,30 +181,6 @@ public _FinalStage migrationStrategy(@NotNull PlanVersionMigrationStrategy migra return this; } - @java.lang.Override - public _FinalStage addAllPayInAdvance(List payInAdvance) { - if (payInAdvance != null) { - this.payInAdvance.addAll(payInAdvance); - } - return this; - } - - @java.lang.Override - public _FinalStage addPayInAdvance(UpdatePayInAdvanceRequestBody payInAdvance) { - this.payInAdvance.add(payInAdvance); - return this; - } - - @java.lang.Override - @JsonSetter(value = "pay_in_advance", nulls = Nulls.SKIP) - public _FinalStage payInAdvance(List payInAdvance) { - this.payInAdvance.clear(); - if (payInAdvance != null) { - this.payInAdvance.addAll(payInAdvance); - } - return this; - } - @java.lang.Override public _FinalStage addAllExcludedCompanyIds(List excludedCompanyIds) { if (excludedCompanyIds != null) { @@ -297,7 +252,6 @@ public PublishPlanVersionRequestBody build() { daysUntilDue, excludedCompanyIds, migrationStrategy, - payInAdvance, additionalProperties); } diff --git a/src/main/java/com/schematic/api/resources/plans/requests/RetryCustomPlanBillingRequestBody.java b/src/main/java/com/schematic/api/resources/plans/requests/RetryCustomPlanBillingRequestBody.java index 7ab3741..1866572 100644 --- a/src/main/java/com/schematic/api/resources/plans/requests/RetryCustomPlanBillingRequestBody.java +++ b/src/main/java/com/schematic/api/resources/plans/requests/RetryCustomPlanBillingRequestBody.java @@ -13,10 +13,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.schematic.api.core.ObjectMappers; import com.schematic.api.types.CustomPlanActivationStrategy; -import com.schematic.api.types.UpdatePayInAdvanceRequestBody; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -31,20 +28,16 @@ public final class RetryCustomPlanBillingRequestBody { private final Optional daysUntilDue; - private final List payInAdvance; - private final Map additionalProperties; private RetryCustomPlanBillingRequestBody( Optional activationStrategy, String customerEmail, Optional daysUntilDue, - List payInAdvance, Map additionalProperties) { this.activationStrategy = activationStrategy; this.customerEmail = customerEmail; this.daysUntilDue = daysUntilDue; - this.payInAdvance = payInAdvance; this.additionalProperties = additionalProperties; } @@ -63,11 +56,6 @@ public Optional getDaysUntilDue() { return daysUntilDue; } - @JsonProperty("pay_in_advance") - public List getPayInAdvance() { - return payInAdvance; - } - @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -82,13 +70,12 @@ public Map getAdditionalProperties() { private boolean equalTo(RetryCustomPlanBillingRequestBody other) { return activationStrategy.equals(other.activationStrategy) && customerEmail.equals(other.customerEmail) - && daysUntilDue.equals(other.daysUntilDue) - && payInAdvance.equals(other.payInAdvance); + && daysUntilDue.equals(other.daysUntilDue); } @java.lang.Override public int hashCode() { - return Objects.hash(this.activationStrategy, this.customerEmail, this.daysUntilDue, this.payInAdvance); + return Objects.hash(this.activationStrategy, this.customerEmail, this.daysUntilDue); } @java.lang.Override @@ -120,20 +107,12 @@ public interface _FinalStage { _FinalStage daysUntilDue(Optional daysUntilDue); _FinalStage daysUntilDue(Long daysUntilDue); - - _FinalStage payInAdvance(List payInAdvance); - - _FinalStage addPayInAdvance(UpdatePayInAdvanceRequestBody payInAdvance); - - _FinalStage addAllPayInAdvance(List payInAdvance); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements CustomerEmailStage, _FinalStage { private String customerEmail; - private List payInAdvance = new ArrayList<>(); - private Optional daysUntilDue = Optional.empty(); private Optional activationStrategy = Optional.empty(); @@ -148,7 +127,6 @@ public Builder from(RetryCustomPlanBillingRequestBody other) { activationStrategy(other.getActivationStrategy()); customerEmail(other.getCustomerEmail()); daysUntilDue(other.getDaysUntilDue()); - payInAdvance(other.getPayInAdvance()); return this; } @@ -159,30 +137,6 @@ public _FinalStage customerEmail(@NotNull String customerEmail) { return this; } - @java.lang.Override - public _FinalStage addAllPayInAdvance(List payInAdvance) { - if (payInAdvance != null) { - this.payInAdvance.addAll(payInAdvance); - } - return this; - } - - @java.lang.Override - public _FinalStage addPayInAdvance(UpdatePayInAdvanceRequestBody payInAdvance) { - this.payInAdvance.add(payInAdvance); - return this; - } - - @java.lang.Override - @JsonSetter(value = "pay_in_advance", nulls = Nulls.SKIP) - public _FinalStage payInAdvance(List payInAdvance) { - this.payInAdvance.clear(); - if (payInAdvance != null) { - this.payInAdvance.addAll(payInAdvance); - } - return this; - } - @java.lang.Override public _FinalStage daysUntilDue(Long daysUntilDue) { this.daysUntilDue = Optional.ofNullable(daysUntilDue); @@ -212,7 +166,7 @@ public _FinalStage activationStrategy(Optional act @java.lang.Override public RetryCustomPlanBillingRequestBody build() { return new RetryCustomPlanBillingRequestBody( - activationStrategy, customerEmail, daysUntilDue, payInAdvance, additionalProperties); + activationStrategy, customerEmail, daysUntilDue, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/schematic/api/types/BillingCreditGrantZeroedOutReason.java b/src/main/java/com/schematic/api/types/BillingCreditGrantZeroedOutReason.java index 08ec797..dc9aa96 100644 --- a/src/main/java/com/schematic/api/types/BillingCreditGrantZeroedOutReason.java +++ b/src/main/java/com/schematic/api/types/BillingCreditGrantZeroedOutReason.java @@ -16,6 +16,9 @@ public final class BillingCreditGrantZeroedOutReason { public static final BillingCreditGrantZeroedOutReason PLAN_PERIOD_RESET = new BillingCreditGrantZeroedOutReason(Value.PLAN_PERIOD_RESET, "plan_period_reset"); + public static final BillingCreditGrantZeroedOutReason RECONCILED = + new BillingCreditGrantZeroedOutReason(Value.RECONCILED, "reconciled"); + public static final BillingCreditGrantZeroedOutReason MANUAL = new BillingCreditGrantZeroedOutReason(Value.MANUAL, "manual"); @@ -58,6 +61,8 @@ public T visit(Visitor visitor) { return visitor.visitExpired(); case PLAN_PERIOD_RESET: return visitor.visitPlanPeriodReset(); + case RECONCILED: + return visitor.visitReconciled(); case MANUAL: return visitor.visitManual(); case UNKNOWN: @@ -75,6 +80,8 @@ public static BillingCreditGrantZeroedOutReason valueOf(String value) { return EXPIRED; case "plan_period_reset": return PLAN_PERIOD_RESET; + case "reconciled": + return RECONCILED; case "manual": return MANUAL; default: @@ -91,6 +98,8 @@ public enum Value { PLAN_PERIOD_RESET, + RECONCILED, + UNKNOWN } @@ -103,6 +112,8 @@ public interface Visitor { T visitPlanPeriodReset(); + T visitReconciled(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java b/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java index 7039de1..6ef605e 100644 --- a/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java +++ b/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java @@ -39,6 +39,8 @@ public final class ChangeSubscriptionInternalRequestBody { private final String newPriceId; + private final Optional optInAccepted; + private final List payInAdvance; private final Optional paymentMethodId; @@ -58,6 +60,7 @@ private ChangeSubscriptionInternalRequestBody( List customFieldValues, String newPlanId, String newPriceId, + Optional optInAccepted, List payInAdvance, Optional paymentMethodId, Optional promoCode, @@ -71,6 +74,7 @@ private ChangeSubscriptionInternalRequestBody( this.customFieldValues = customFieldValues; this.newPlanId = newPlanId; this.newPriceId = newPriceId; + this.optInAccepted = optInAccepted; this.payInAdvance = payInAdvance; this.paymentMethodId = paymentMethodId; this.promoCode = promoCode; @@ -118,6 +122,11 @@ public String getNewPriceId() { return newPriceId; } + @JsonProperty("opt_in_accepted") + public Optional getOptInAccepted() { + return optInAccepted; + } + @JsonProperty("pay_in_advance") public List getPayInAdvance() { return payInAdvance; @@ -159,6 +168,7 @@ private boolean equalTo(ChangeSubscriptionInternalRequestBody other) { && customFieldValues.equals(other.customFieldValues) && newPlanId.equals(other.newPlanId) && newPriceId.equals(other.newPriceId) + && optInAccepted.equals(other.optInAccepted) && payInAdvance.equals(other.payInAdvance) && paymentMethodId.equals(other.paymentMethodId) && promoCode.equals(other.promoCode) @@ -176,6 +186,7 @@ public int hashCode() { this.customFieldValues, this.newPlanId, this.newPriceId, + this.optInAccepted, this.payInAdvance, this.paymentMethodId, this.promoCode, @@ -244,6 +255,10 @@ public interface _FinalStage { _FinalStage addAllCustomFieldValues(List customFieldValues); + _FinalStage optInAccepted(Optional optInAccepted); + + _FinalStage optInAccepted(Boolean optInAccepted); + _FinalStage payInAdvance(List payInAdvance); _FinalStage addPayInAdvance(UpdatePayInAdvanceRequestBody payInAdvance); @@ -276,6 +291,8 @@ public static final class Builder private List payInAdvance = new ArrayList<>(); + private Optional optInAccepted = Optional.empty(); + private List customFieldValues = new ArrayList<>(); private List creditBundles = new ArrayList<>(); @@ -301,6 +318,7 @@ public Builder from(ChangeSubscriptionInternalRequestBody other) { customFieldValues(other.getCustomFieldValues()); newPlanId(other.getNewPlanId()); newPriceId(other.getNewPriceId()); + optInAccepted(other.getOptInAccepted()); payInAdvance(other.getPayInAdvance()); paymentMethodId(other.getPaymentMethodId()); promoCode(other.getPromoCode()); @@ -386,6 +404,19 @@ public _FinalStage payInAdvance(List payInAdvance return this; } + @java.lang.Override + public _FinalStage optInAccepted(Boolean optInAccepted) { + this.optInAccepted = Optional.ofNullable(optInAccepted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_accepted", nulls = Nulls.SKIP) + public _FinalStage optInAccepted(Optional optInAccepted) { + this.optInAccepted = optInAccepted; + return this; + } + @java.lang.Override public _FinalStage addAllCustomFieldValues(List customFieldValues) { if (customFieldValues != null) { @@ -506,6 +537,7 @@ public ChangeSubscriptionInternalRequestBody build() { customFieldValues, newPlanId, newPriceId, + optInAccepted, payInAdvance, paymentMethodId, promoCode, diff --git a/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java b/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java index 4a8d8bc..6cc9c72 100644 --- a/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java +++ b/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java @@ -37,6 +37,8 @@ public final class ChangeSubscriptionRequestBody { private final String newPriceId; + private final Optional optInAccepted; + private final List payInAdvance; private final Optional paymentMethodId; @@ -55,6 +57,7 @@ private ChangeSubscriptionRequestBody( List customFieldValues, String newPlanId, String newPriceId, + Optional optInAccepted, List payInAdvance, Optional paymentMethodId, Optional promoCode, @@ -67,6 +70,7 @@ private ChangeSubscriptionRequestBody( this.customFieldValues = customFieldValues; this.newPlanId = newPlanId; this.newPriceId = newPriceId; + this.optInAccepted = optInAccepted; this.payInAdvance = payInAdvance; this.paymentMethodId = paymentMethodId; this.promoCode = promoCode; @@ -109,6 +113,11 @@ public String getNewPriceId() { return newPriceId; } + @JsonProperty("opt_in_accepted") + public Optional getOptInAccepted() { + return optInAccepted; + } + @JsonProperty("pay_in_advance") public List getPayInAdvance() { return payInAdvance; @@ -148,6 +157,7 @@ private boolean equalTo(ChangeSubscriptionRequestBody other) { && customFieldValues.equals(other.customFieldValues) && newPlanId.equals(other.newPlanId) && newPriceId.equals(other.newPriceId) + && optInAccepted.equals(other.optInAccepted) && payInAdvance.equals(other.payInAdvance) && paymentMethodId.equals(other.paymentMethodId) && promoCode.equals(other.promoCode) @@ -164,6 +174,7 @@ public int hashCode() { this.customFieldValues, this.newPlanId, this.newPriceId, + this.optInAccepted, this.payInAdvance, this.paymentMethodId, this.promoCode, @@ -228,6 +239,10 @@ public interface _FinalStage { _FinalStage addAllCustomFieldValues(List customFieldValues); + _FinalStage optInAccepted(Optional optInAccepted); + + _FinalStage optInAccepted(Boolean optInAccepted); + _FinalStage payInAdvance(List payInAdvance); _FinalStage addPayInAdvance(UpdatePayInAdvanceRequestBody payInAdvance); @@ -257,6 +272,8 @@ public static final class Builder implements NewPlanIdStage, NewPriceIdStage, Sk private List payInAdvance = new ArrayList<>(); + private Optional optInAccepted = Optional.empty(); + private List customFieldValues = new ArrayList<>(); private List creditBundles = new ArrayList<>(); @@ -281,6 +298,7 @@ public Builder from(ChangeSubscriptionRequestBody other) { customFieldValues(other.getCustomFieldValues()); newPlanId(other.getNewPlanId()); newPriceId(other.getNewPriceId()); + optInAccepted(other.getOptInAccepted()); payInAdvance(other.getPayInAdvance()); paymentMethodId(other.getPaymentMethodId()); promoCode(other.getPromoCode()); @@ -359,6 +377,19 @@ public _FinalStage payInAdvance(List payInAdvance return this; } + @java.lang.Override + public _FinalStage optInAccepted(Boolean optInAccepted) { + this.optInAccepted = Optional.ofNullable(optInAccepted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_accepted", nulls = Nulls.SKIP) + public _FinalStage optInAccepted(Optional optInAccepted) { + this.optInAccepted = optInAccepted; + return this; + } + @java.lang.Override public _FinalStage addAllCustomFieldValues(List customFieldValues) { if (customFieldValues != null) { @@ -478,6 +509,7 @@ public ChangeSubscriptionRequestBody build() { customFieldValues, newPlanId, newPriceId, + optInAccepted, payInAdvance, paymentMethodId, promoCode, diff --git a/src/main/java/com/schematic/api/types/CheckoutSettingsResponseData.java b/src/main/java/com/schematic/api/types/CheckoutSettingsResponseData.java index 905dd8c..fd9d53d 100644 --- a/src/main/java/com/schematic/api/types/CheckoutSettingsResponseData.java +++ b/src/main/java/com/schematic/api/types/CheckoutSettingsResponseData.java @@ -9,11 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.schematic.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CheckoutSettingsResponseData.Builder.class) @@ -24,16 +26,28 @@ public final class CheckoutSettingsResponseData { private final boolean collectPhone; + private final boolean optInEnabled; + + private final Optional optInText; + + private final Optional optInTitle; + private final Map additionalProperties; private CheckoutSettingsResponseData( boolean collectAddress, boolean collectEmail, boolean collectPhone, + boolean optInEnabled, + Optional optInText, + Optional optInTitle, Map additionalProperties) { this.collectAddress = collectAddress; this.collectEmail = collectEmail; this.collectPhone = collectPhone; + this.optInEnabled = optInEnabled; + this.optInText = optInText; + this.optInTitle = optInTitle; this.additionalProperties = additionalProperties; } @@ -52,6 +66,21 @@ public boolean getCollectPhone() { return collectPhone; } + @JsonProperty("opt_in_enabled") + public boolean getOptInEnabled() { + return optInEnabled; + } + + @JsonProperty("opt_in_text") + public Optional getOptInText() { + return optInText; + } + + @JsonProperty("opt_in_title") + public Optional getOptInTitle() { + return optInTitle; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -66,12 +95,21 @@ public Map getAdditionalProperties() { private boolean equalTo(CheckoutSettingsResponseData other) { return collectAddress == other.collectAddress && collectEmail == other.collectEmail - && collectPhone == other.collectPhone; + && collectPhone == other.collectPhone + && optInEnabled == other.optInEnabled + && optInText.equals(other.optInText) + && optInTitle.equals(other.optInTitle); } @java.lang.Override public int hashCode() { - return Objects.hash(this.collectAddress, this.collectEmail, this.collectPhone); + return Objects.hash( + this.collectAddress, + this.collectEmail, + this.collectPhone, + this.optInEnabled, + this.optInText, + this.optInTitle); } @java.lang.Override @@ -94,7 +132,11 @@ public interface CollectEmailStage { } public interface CollectPhoneStage { - _FinalStage collectPhone(boolean collectPhone); + OptInEnabledStage collectPhone(boolean collectPhone); + } + + public interface OptInEnabledStage { + _FinalStage optInEnabled(boolean optInEnabled); } public interface _FinalStage { @@ -103,17 +145,31 @@ public interface _FinalStage { _FinalStage additionalProperty(String key, Object value); _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage optInText(Optional optInText); + + _FinalStage optInText(String optInText); + + _FinalStage optInTitle(Optional optInTitle); + + _FinalStage optInTitle(String optInTitle); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements CollectAddressStage, CollectEmailStage, CollectPhoneStage, _FinalStage { + implements CollectAddressStage, CollectEmailStage, CollectPhoneStage, OptInEnabledStage, _FinalStage { private boolean collectAddress; private boolean collectEmail; private boolean collectPhone; + private boolean optInEnabled; + + private Optional optInTitle = Optional.empty(); + + private Optional optInText = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -124,6 +180,9 @@ public Builder from(CheckoutSettingsResponseData other) { collectAddress(other.getCollectAddress()); collectEmail(other.getCollectEmail()); collectPhone(other.getCollectPhone()); + optInEnabled(other.getOptInEnabled()); + optInText(other.getOptInText()); + optInTitle(other.getOptInTitle()); return this; } @@ -143,14 +202,54 @@ public CollectPhoneStage collectEmail(boolean collectEmail) { @java.lang.Override @JsonSetter("collect_phone") - public _FinalStage collectPhone(boolean collectPhone) { + public OptInEnabledStage collectPhone(boolean collectPhone) { this.collectPhone = collectPhone; return this; } + @java.lang.Override + @JsonSetter("opt_in_enabled") + public _FinalStage optInEnabled(boolean optInEnabled) { + this.optInEnabled = optInEnabled; + return this; + } + + @java.lang.Override + public _FinalStage optInTitle(String optInTitle) { + this.optInTitle = Optional.ofNullable(optInTitle); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_title", nulls = Nulls.SKIP) + public _FinalStage optInTitle(Optional optInTitle) { + this.optInTitle = optInTitle; + return this; + } + + @java.lang.Override + public _FinalStage optInText(String optInText) { + this.optInText = Optional.ofNullable(optInText); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_text", nulls = Nulls.SKIP) + public _FinalStage optInText(Optional optInText) { + this.optInText = optInText; + return this; + } + @java.lang.Override public CheckoutSettingsResponseData build() { - return new CheckoutSettingsResponseData(collectAddress, collectEmail, collectPhone, additionalProperties); + return new CheckoutSettingsResponseData( + collectAddress, + collectEmail, + collectPhone, + optInEnabled, + optInText, + optInTitle, + additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/schematic/api/types/CreditLedgerEnrichedEntryResponseData.java b/src/main/java/com/schematic/api/types/CreditLedgerEnrichedEntryResponseData.java deleted file mode 100644 index 505129b..0000000 --- a/src/main/java/com/schematic/api/types/CreditLedgerEnrichedEntryResponseData.java +++ /dev/null @@ -1,716 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.schematic.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreditLedgerEnrichedEntryResponseData.Builder.class) -public final class CreditLedgerEnrichedEntryResponseData { - private final long billingCreditAutoTopupGrantCount; - - private final String billingCreditId; - - private final Optional company; - - private final String companyId; - - private final Optional credit; - - private final long expiredGrantCount; - - private final Optional feature; - - private final Optional featureId; - - private final OffsetDateTime firstTransactionAt; - - private final long freeGrantCount; - - private final long grantCount; - - private final OffsetDateTime lastTransactionAt; - - private final long manuallyZeroedCount; - - private final double netChange; - - private final long planGrantCount; - - private final long purchasedGrantCount; - - private final OffsetDateTime timeBucket; - - private final double totalConsumed; - - private final double totalGranted; - - private final long transactionCount; - - private final long usageCount; - - private final long zeroedOutCount; - - private final Map additionalProperties; - - private CreditLedgerEnrichedEntryResponseData( - long billingCreditAutoTopupGrantCount, - String billingCreditId, - Optional company, - String companyId, - Optional credit, - long expiredGrantCount, - Optional feature, - Optional featureId, - OffsetDateTime firstTransactionAt, - long freeGrantCount, - long grantCount, - OffsetDateTime lastTransactionAt, - long manuallyZeroedCount, - double netChange, - long planGrantCount, - long purchasedGrantCount, - OffsetDateTime timeBucket, - double totalConsumed, - double totalGranted, - long transactionCount, - long usageCount, - long zeroedOutCount, - Map additionalProperties) { - this.billingCreditAutoTopupGrantCount = billingCreditAutoTopupGrantCount; - this.billingCreditId = billingCreditId; - this.company = company; - this.companyId = companyId; - this.credit = credit; - this.expiredGrantCount = expiredGrantCount; - this.feature = feature; - this.featureId = featureId; - this.firstTransactionAt = firstTransactionAt; - this.freeGrantCount = freeGrantCount; - this.grantCount = grantCount; - this.lastTransactionAt = lastTransactionAt; - this.manuallyZeroedCount = manuallyZeroedCount; - this.netChange = netChange; - this.planGrantCount = planGrantCount; - this.purchasedGrantCount = purchasedGrantCount; - this.timeBucket = timeBucket; - this.totalConsumed = totalConsumed; - this.totalGranted = totalGranted; - this.transactionCount = transactionCount; - this.usageCount = usageCount; - this.zeroedOutCount = zeroedOutCount; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("billing_credit_auto_topup_grant_count") - public long getBillingCreditAutoTopupGrantCount() { - return billingCreditAutoTopupGrantCount; - } - - @JsonProperty("billing_credit_id") - public String getBillingCreditId() { - return billingCreditId; - } - - @JsonProperty("company") - public Optional getCompany() { - return company; - } - - @JsonProperty("company_id") - public String getCompanyId() { - return companyId; - } - - @JsonProperty("credit") - public Optional getCredit() { - return credit; - } - - @JsonProperty("expired_grant_count") - public long getExpiredGrantCount() { - return expiredGrantCount; - } - - @JsonProperty("feature") - public Optional getFeature() { - return feature; - } - - @JsonProperty("feature_id") - public Optional getFeatureId() { - return featureId; - } - - @JsonProperty("first_transaction_at") - public OffsetDateTime getFirstTransactionAt() { - return firstTransactionAt; - } - - @JsonProperty("free_grant_count") - public long getFreeGrantCount() { - return freeGrantCount; - } - - @JsonProperty("grant_count") - public long getGrantCount() { - return grantCount; - } - - @JsonProperty("last_transaction_at") - public OffsetDateTime getLastTransactionAt() { - return lastTransactionAt; - } - - @JsonProperty("manually_zeroed_count") - public long getManuallyZeroedCount() { - return manuallyZeroedCount; - } - - @JsonProperty("net_change") - public double getNetChange() { - return netChange; - } - - @JsonProperty("plan_grant_count") - public long getPlanGrantCount() { - return planGrantCount; - } - - @JsonProperty("purchased_grant_count") - public long getPurchasedGrantCount() { - return purchasedGrantCount; - } - - @JsonProperty("time_bucket") - public OffsetDateTime getTimeBucket() { - return timeBucket; - } - - @JsonProperty("total_consumed") - public double getTotalConsumed() { - return totalConsumed; - } - - @JsonProperty("total_granted") - public double getTotalGranted() { - return totalGranted; - } - - @JsonProperty("transaction_count") - public long getTransactionCount() { - return transactionCount; - } - - @JsonProperty("usage_count") - public long getUsageCount() { - return usageCount; - } - - @JsonProperty("zeroed_out_count") - public long getZeroedOutCount() { - return zeroedOutCount; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreditLedgerEnrichedEntryResponseData - && equalTo((CreditLedgerEnrichedEntryResponseData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreditLedgerEnrichedEntryResponseData other) { - return billingCreditAutoTopupGrantCount == other.billingCreditAutoTopupGrantCount - && billingCreditId.equals(other.billingCreditId) - && company.equals(other.company) - && companyId.equals(other.companyId) - && credit.equals(other.credit) - && expiredGrantCount == other.expiredGrantCount - && feature.equals(other.feature) - && featureId.equals(other.featureId) - && firstTransactionAt.equals(other.firstTransactionAt) - && freeGrantCount == other.freeGrantCount - && grantCount == other.grantCount - && lastTransactionAt.equals(other.lastTransactionAt) - && manuallyZeroedCount == other.manuallyZeroedCount - && netChange == other.netChange - && planGrantCount == other.planGrantCount - && purchasedGrantCount == other.purchasedGrantCount - && timeBucket.equals(other.timeBucket) - && totalConsumed == other.totalConsumed - && totalGranted == other.totalGranted - && transactionCount == other.transactionCount - && usageCount == other.usageCount - && zeroedOutCount == other.zeroedOutCount; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.billingCreditAutoTopupGrantCount, - this.billingCreditId, - this.company, - this.companyId, - this.credit, - this.expiredGrantCount, - this.feature, - this.featureId, - this.firstTransactionAt, - this.freeGrantCount, - this.grantCount, - this.lastTransactionAt, - this.manuallyZeroedCount, - this.netChange, - this.planGrantCount, - this.purchasedGrantCount, - this.timeBucket, - this.totalConsumed, - this.totalGranted, - this.transactionCount, - this.usageCount, - this.zeroedOutCount); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BillingCreditAutoTopupGrantCountStage builder() { - return new Builder(); - } - - public interface BillingCreditAutoTopupGrantCountStage { - BillingCreditIdStage billingCreditAutoTopupGrantCount(long billingCreditAutoTopupGrantCount); - - Builder from(CreditLedgerEnrichedEntryResponseData other); - } - - public interface BillingCreditIdStage { - CompanyIdStage billingCreditId(@NotNull String billingCreditId); - } - - public interface CompanyIdStage { - ExpiredGrantCountStage companyId(@NotNull String companyId); - } - - public interface ExpiredGrantCountStage { - FirstTransactionAtStage expiredGrantCount(long expiredGrantCount); - } - - public interface FirstTransactionAtStage { - FreeGrantCountStage firstTransactionAt(@NotNull OffsetDateTime firstTransactionAt); - } - - public interface FreeGrantCountStage { - GrantCountStage freeGrantCount(long freeGrantCount); - } - - public interface GrantCountStage { - LastTransactionAtStage grantCount(long grantCount); - } - - public interface LastTransactionAtStage { - ManuallyZeroedCountStage lastTransactionAt(@NotNull OffsetDateTime lastTransactionAt); - } - - public interface ManuallyZeroedCountStage { - NetChangeStage manuallyZeroedCount(long manuallyZeroedCount); - } - - public interface NetChangeStage { - PlanGrantCountStage netChange(double netChange); - } - - public interface PlanGrantCountStage { - PurchasedGrantCountStage planGrantCount(long planGrantCount); - } - - public interface PurchasedGrantCountStage { - TimeBucketStage purchasedGrantCount(long purchasedGrantCount); - } - - public interface TimeBucketStage { - TotalConsumedStage timeBucket(@NotNull OffsetDateTime timeBucket); - } - - public interface TotalConsumedStage { - TotalGrantedStage totalConsumed(double totalConsumed); - } - - public interface TotalGrantedStage { - TransactionCountStage totalGranted(double totalGranted); - } - - public interface TransactionCountStage { - UsageCountStage transactionCount(long transactionCount); - } - - public interface UsageCountStage { - ZeroedOutCountStage usageCount(long usageCount); - } - - public interface ZeroedOutCountStage { - _FinalStage zeroedOutCount(long zeroedOutCount); - } - - public interface _FinalStage { - CreditLedgerEnrichedEntryResponseData build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - _FinalStage company(Optional company); - - _FinalStage company(CompanyLedgerResponseData company); - - _FinalStage credit(Optional credit); - - _FinalStage credit(BillingCreditLedgerResponseData credit); - - _FinalStage feature(Optional feature); - - _FinalStage feature(FeatureLedgerResponseData feature); - - _FinalStage featureId(Optional featureId); - - _FinalStage featureId(String featureId); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements BillingCreditAutoTopupGrantCountStage, - BillingCreditIdStage, - CompanyIdStage, - ExpiredGrantCountStage, - FirstTransactionAtStage, - FreeGrantCountStage, - GrantCountStage, - LastTransactionAtStage, - ManuallyZeroedCountStage, - NetChangeStage, - PlanGrantCountStage, - PurchasedGrantCountStage, - TimeBucketStage, - TotalConsumedStage, - TotalGrantedStage, - TransactionCountStage, - UsageCountStage, - ZeroedOutCountStage, - _FinalStage { - private long billingCreditAutoTopupGrantCount; - - private String billingCreditId; - - private String companyId; - - private long expiredGrantCount; - - private OffsetDateTime firstTransactionAt; - - private long freeGrantCount; - - private long grantCount; - - private OffsetDateTime lastTransactionAt; - - private long manuallyZeroedCount; - - private double netChange; - - private long planGrantCount; - - private long purchasedGrantCount; - - private OffsetDateTime timeBucket; - - private double totalConsumed; - - private double totalGranted; - - private long transactionCount; - - private long usageCount; - - private long zeroedOutCount; - - private Optional featureId = Optional.empty(); - - private Optional feature = Optional.empty(); - - private Optional credit = Optional.empty(); - - private Optional company = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreditLedgerEnrichedEntryResponseData other) { - billingCreditAutoTopupGrantCount(other.getBillingCreditAutoTopupGrantCount()); - billingCreditId(other.getBillingCreditId()); - company(other.getCompany()); - companyId(other.getCompanyId()); - credit(other.getCredit()); - expiredGrantCount(other.getExpiredGrantCount()); - feature(other.getFeature()); - featureId(other.getFeatureId()); - firstTransactionAt(other.getFirstTransactionAt()); - freeGrantCount(other.getFreeGrantCount()); - grantCount(other.getGrantCount()); - lastTransactionAt(other.getLastTransactionAt()); - manuallyZeroedCount(other.getManuallyZeroedCount()); - netChange(other.getNetChange()); - planGrantCount(other.getPlanGrantCount()); - purchasedGrantCount(other.getPurchasedGrantCount()); - timeBucket(other.getTimeBucket()); - totalConsumed(other.getTotalConsumed()); - totalGranted(other.getTotalGranted()); - transactionCount(other.getTransactionCount()); - usageCount(other.getUsageCount()); - zeroedOutCount(other.getZeroedOutCount()); - return this; - } - - @java.lang.Override - @JsonSetter("billing_credit_auto_topup_grant_count") - public BillingCreditIdStage billingCreditAutoTopupGrantCount(long billingCreditAutoTopupGrantCount) { - this.billingCreditAutoTopupGrantCount = billingCreditAutoTopupGrantCount; - return this; - } - - @java.lang.Override - @JsonSetter("billing_credit_id") - public CompanyIdStage billingCreditId(@NotNull String billingCreditId) { - this.billingCreditId = Objects.requireNonNull(billingCreditId, "billingCreditId must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("company_id") - public ExpiredGrantCountStage companyId(@NotNull String companyId) { - this.companyId = Objects.requireNonNull(companyId, "companyId must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("expired_grant_count") - public FirstTransactionAtStage expiredGrantCount(long expiredGrantCount) { - this.expiredGrantCount = expiredGrantCount; - return this; - } - - @java.lang.Override - @JsonSetter("first_transaction_at") - public FreeGrantCountStage firstTransactionAt(@NotNull OffsetDateTime firstTransactionAt) { - this.firstTransactionAt = Objects.requireNonNull(firstTransactionAt, "firstTransactionAt must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("free_grant_count") - public GrantCountStage freeGrantCount(long freeGrantCount) { - this.freeGrantCount = freeGrantCount; - return this; - } - - @java.lang.Override - @JsonSetter("grant_count") - public LastTransactionAtStage grantCount(long grantCount) { - this.grantCount = grantCount; - return this; - } - - @java.lang.Override - @JsonSetter("last_transaction_at") - public ManuallyZeroedCountStage lastTransactionAt(@NotNull OffsetDateTime lastTransactionAt) { - this.lastTransactionAt = Objects.requireNonNull(lastTransactionAt, "lastTransactionAt must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("manually_zeroed_count") - public NetChangeStage manuallyZeroedCount(long manuallyZeroedCount) { - this.manuallyZeroedCount = manuallyZeroedCount; - return this; - } - - @java.lang.Override - @JsonSetter("net_change") - public PlanGrantCountStage netChange(double netChange) { - this.netChange = netChange; - return this; - } - - @java.lang.Override - @JsonSetter("plan_grant_count") - public PurchasedGrantCountStage planGrantCount(long planGrantCount) { - this.planGrantCount = planGrantCount; - return this; - } - - @java.lang.Override - @JsonSetter("purchased_grant_count") - public TimeBucketStage purchasedGrantCount(long purchasedGrantCount) { - this.purchasedGrantCount = purchasedGrantCount; - return this; - } - - @java.lang.Override - @JsonSetter("time_bucket") - public TotalConsumedStage timeBucket(@NotNull OffsetDateTime timeBucket) { - this.timeBucket = Objects.requireNonNull(timeBucket, "timeBucket must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("total_consumed") - public TotalGrantedStage totalConsumed(double totalConsumed) { - this.totalConsumed = totalConsumed; - return this; - } - - @java.lang.Override - @JsonSetter("total_granted") - public TransactionCountStage totalGranted(double totalGranted) { - this.totalGranted = totalGranted; - return this; - } - - @java.lang.Override - @JsonSetter("transaction_count") - public UsageCountStage transactionCount(long transactionCount) { - this.transactionCount = transactionCount; - return this; - } - - @java.lang.Override - @JsonSetter("usage_count") - public ZeroedOutCountStage usageCount(long usageCount) { - this.usageCount = usageCount; - return this; - } - - @java.lang.Override - @JsonSetter("zeroed_out_count") - public _FinalStage zeroedOutCount(long zeroedOutCount) { - this.zeroedOutCount = zeroedOutCount; - return this; - } - - @java.lang.Override - public _FinalStage featureId(String featureId) { - this.featureId = Optional.ofNullable(featureId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "feature_id", nulls = Nulls.SKIP) - public _FinalStage featureId(Optional featureId) { - this.featureId = featureId; - return this; - } - - @java.lang.Override - public _FinalStage feature(FeatureLedgerResponseData feature) { - this.feature = Optional.ofNullable(feature); - return this; - } - - @java.lang.Override - @JsonSetter(value = "feature", nulls = Nulls.SKIP) - public _FinalStage feature(Optional feature) { - this.feature = feature; - return this; - } - - @java.lang.Override - public _FinalStage credit(BillingCreditLedgerResponseData credit) { - this.credit = Optional.ofNullable(credit); - return this; - } - - @java.lang.Override - @JsonSetter(value = "credit", nulls = Nulls.SKIP) - public _FinalStage credit(Optional credit) { - this.credit = credit; - return this; - } - - @java.lang.Override - public _FinalStage company(CompanyLedgerResponseData company) { - this.company = Optional.ofNullable(company); - return this; - } - - @java.lang.Override - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public _FinalStage company(Optional company) { - this.company = company; - return this; - } - - @java.lang.Override - public CreditLedgerEnrichedEntryResponseData build() { - return new CreditLedgerEnrichedEntryResponseData( - billingCreditAutoTopupGrantCount, - billingCreditId, - company, - companyId, - credit, - expiredGrantCount, - feature, - featureId, - firstTransactionAt, - freeGrantCount, - grantCount, - lastTransactionAt, - manuallyZeroedCount, - netChange, - planGrantCount, - purchasedGrantCount, - timeBucket, - totalConsumed, - totalGranted, - transactionCount, - usageCount, - zeroedOutCount, - additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/schematic/api/types/CreditLedgerPeriod.java b/src/main/java/com/schematic/api/types/CreditLedgerPeriod.java deleted file mode 100644 index 61ff096..0000000 --- a/src/main/java/com/schematic/api/types/CreditLedgerPeriod.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.schematic.api.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public final class CreditLedgerPeriod { - public static final CreditLedgerPeriod DAILY = new CreditLedgerPeriod(Value.DAILY, "daily"); - - public static final CreditLedgerPeriod WEEKLY = new CreditLedgerPeriod(Value.WEEKLY, "weekly"); - - public static final CreditLedgerPeriod RAW = new CreditLedgerPeriod(Value.RAW, "raw"); - - public static final CreditLedgerPeriod MONTHLY = new CreditLedgerPeriod(Value.MONTHLY, "monthly"); - - private final Value value; - - private final String string; - - CreditLedgerPeriod(Value value, String string) { - this.value = value; - this.string = string; - } - - public Value getEnumValue() { - return value; - } - - @java.lang.Override - @JsonValue - public String toString() { - return this.string; - } - - @java.lang.Override - public boolean equals(Object other) { - return (this == other) - || (other instanceof CreditLedgerPeriod && this.string.equals(((CreditLedgerPeriod) other).string)); - } - - @java.lang.Override - public int hashCode() { - return this.string.hashCode(); - } - - public T visit(Visitor visitor) { - switch (value) { - case DAILY: - return visitor.visitDaily(); - case WEEKLY: - return visitor.visitWeekly(); - case RAW: - return visitor.visitRaw(); - case MONTHLY: - return visitor.visitMonthly(); - case UNKNOWN: - default: - return visitor.visitUnknown(string); - } - } - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static CreditLedgerPeriod valueOf(String value) { - switch (value) { - case "daily": - return DAILY; - case "weekly": - return WEEKLY; - case "raw": - return RAW; - case "monthly": - return MONTHLY; - default: - return new CreditLedgerPeriod(Value.UNKNOWN, value); - } - } - - public enum Value { - DAILY, - - MONTHLY, - - RAW, - - WEEKLY, - - UNKNOWN - } - - public interface Visitor { - T visitDaily(); - - T visitMonthly(); - - T visitRaw(); - - T visitWeekly(); - - T visitUnknown(String unknownType); - } -} diff --git a/src/main/java/com/schematic/api/types/FeatureEntitlement.java b/src/main/java/com/schematic/api/types/FeatureEntitlement.java index dccc967..5b13904 100644 --- a/src/main/java/com/schematic/api/types/FeatureEntitlement.java +++ b/src/main/java/com/schematic/api/types/FeatureEntitlement.java @@ -28,6 +28,10 @@ public final class FeatureEntitlement { private final Optional creditRemaining; + private final Optional creditReserved; + + private final Optional creditSettled; + private final Optional creditTotal; private final Optional creditUsed; @@ -56,6 +60,8 @@ private FeatureEntitlement( Optional allocation, Optional creditId, Optional creditRemaining, + Optional creditReserved, + Optional creditSettled, Optional creditTotal, Optional creditUsed, Optional eventName, @@ -71,6 +77,8 @@ private FeatureEntitlement( this.allocation = allocation; this.creditId = creditId; this.creditRemaining = creditRemaining; + this.creditReserved = creditReserved; + this.creditSettled = creditSettled; this.creditTotal = creditTotal; this.creditUsed = creditUsed; this.eventName = eventName; @@ -102,13 +110,29 @@ public Optional getCreditId() { } /** - * @return If the company has a credit-based entitlement for this feature, the remaining credit amount + * @return If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead */ @JsonProperty("credit_remaining") public Optional getCreditRemaining() { return creditRemaining; } + /** + * @return If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released + */ + @JsonProperty("credit_reserved") + public Optional getCreditReserved() { + return creditReserved; + } + + /** + * @return If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users + */ + @JsonProperty("credit_settled") + public Optional getCreditSettled() { + return creditSettled; + } + /** * @return If the company has a credit-based entitlement for this feature, the total credit amount */ @@ -212,6 +236,8 @@ private boolean equalTo(FeatureEntitlement other) { return allocation.equals(other.allocation) && creditId.equals(other.creditId) && creditRemaining.equals(other.creditRemaining) + && creditReserved.equals(other.creditReserved) + && creditSettled.equals(other.creditSettled) && creditTotal.equals(other.creditTotal) && creditUsed.equals(other.creditUsed) && eventName.equals(other.eventName) @@ -231,6 +257,8 @@ public int hashCode() { this.allocation, this.creditId, this.creditRemaining, + this.creditReserved, + this.creditSettled, this.creditTotal, this.creditUsed, this.eventName, @@ -298,12 +326,26 @@ public interface _FinalStage { _FinalStage creditId(String creditId); /** - *

If the company has a credit-based entitlement for this feature, the remaining credit amount

+ *

If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead

*/ _FinalStage creditRemaining(Optional creditRemaining); _FinalStage creditRemaining(Double creditRemaining); + /** + *

If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released

+ */ + _FinalStage creditReserved(Optional creditReserved); + + _FinalStage creditReserved(Double creditReserved); + + /** + *

If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users

+ */ + _FinalStage creditSettled(Optional creditSettled); + + _FinalStage creditSettled(Double creditSettled); + /** *

If the company has a credit-based entitlement for this feature, the total credit amount

*/ @@ -385,6 +427,10 @@ public static final class Builder implements FeatureIdStage, FeatureKeyStage, Va private Optional creditTotal = Optional.empty(); + private Optional creditSettled = Optional.empty(); + + private Optional creditReserved = Optional.empty(); + private Optional creditRemaining = Optional.empty(); private Optional creditId = Optional.empty(); @@ -401,6 +447,8 @@ public Builder from(FeatureEntitlement other) { allocation(other.getAllocation()); creditId(other.getCreditId()); creditRemaining(other.getCreditRemaining()); + creditReserved(other.getCreditReserved()); + creditSettled(other.getCreditSettled()); creditTotal(other.getCreditTotal()); creditUsed(other.getCreditUsed()); eventName(other.getEventName()); @@ -612,7 +660,47 @@ public _FinalStage creditTotal(Optional creditTotal) { } /** - *

If the company has a credit-based entitlement for this feature, the remaining credit amount

+ *

If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage creditSettled(Double creditSettled) { + this.creditSettled = Optional.ofNullable(creditSettled); + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users

+ */ + @java.lang.Override + @JsonSetter(value = "credit_settled", nulls = Nulls.SKIP) + public _FinalStage creditSettled(Optional creditSettled) { + this.creditSettled = creditSettled; + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage creditReserved(Double creditReserved) { + this.creditReserved = Optional.ofNullable(creditReserved); + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released

+ */ + @java.lang.Override + @JsonSetter(value = "credit_reserved", nulls = Nulls.SKIP) + public _FinalStage creditReserved(Optional creditReserved) { + this.creditReserved = creditReserved; + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -622,7 +710,7 @@ public _FinalStage creditRemaining(Double creditRemaining) { } /** - *

If the company has a credit-based entitlement for this feature, the remaining credit amount

+ *

If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead

*/ @java.lang.Override @JsonSetter(value = "credit_remaining", nulls = Nulls.SKIP) @@ -677,6 +765,8 @@ public FeatureEntitlement build() { allocation, creditId, creditRemaining, + creditReserved, + creditSettled, creditTotal, creditUsed, eventName, diff --git a/src/main/java/com/schematic/api/types/PlanChangeResponseData.java b/src/main/java/com/schematic/api/types/PlanChangeResponseData.java index b459a7c..9004467 100644 --- a/src/main/java/com/schematic/api/types/PlanChangeResponseData.java +++ b/src/main/java/com/schematic/api/types/PlanChangeResponseData.java @@ -52,6 +52,8 @@ public final class PlanChangeResponseData { private final String id; + private final boolean isVersionUpgrade; + private final Optional previousBasePlan; private final Optional previousBasePlanVersion; @@ -85,6 +87,7 @@ private PlanChangeResponseData( OffsetDateTime createdAt, String environmentId, String id, + boolean isVersionUpgrade, Optional previousBasePlan, Optional previousBasePlanVersion, Optional requestId, @@ -108,6 +111,7 @@ private PlanChangeResponseData( this.createdAt = createdAt; this.environmentId = environmentId; this.id = id; + this.isVersionUpgrade = isVersionUpgrade; this.previousBasePlan = previousBasePlan; this.previousBasePlanVersion = previousBasePlanVersion; this.requestId = requestId; @@ -195,6 +199,14 @@ public String getId() { return id; } + /** + * @return True when this change moved the company to a different version of the same plan (e.g. a plan version migration) rather than to a different plan. + */ + @JsonProperty("is_version_upgrade") + public boolean getIsVersionUpgrade() { + return isVersionUpgrade; + } + @JsonProperty("previous_base_plan") public Optional getPreviousBasePlan() { return previousBasePlan; @@ -270,6 +282,7 @@ private boolean equalTo(PlanChangeResponseData other) { && createdAt.equals(other.createdAt) && environmentId.equals(other.environmentId) && id.equals(other.id) + && isVersionUpgrade == other.isVersionUpgrade && previousBasePlan.equals(other.previousBasePlan) && previousBasePlanVersion.equals(other.previousBasePlanVersion) && requestId.equals(other.requestId) @@ -297,6 +310,7 @@ public int hashCode() { this.createdAt, this.environmentId, this.id, + this.isVersionUpgrade, this.previousBasePlan, this.previousBasePlanVersion, this.requestId, @@ -339,7 +353,14 @@ public interface EnvironmentIdStage { } public interface IdStage { - UpdatedAtStage id(@NotNull String id); + IsVersionUpgradeStage id(@NotNull String id); + } + + public interface IsVersionUpgradeStage { + /** + *

True when this change moved the company to a different version of the same plan (e.g. a plan version migration) rather than to a different plan.

+ */ + UpdatedAtStage isVersionUpgrade(boolean isVersionUpgrade); } public interface UpdatedAtStage { @@ -443,6 +464,7 @@ public static final class Builder CreatedAtStage, EnvironmentIdStage, IdStage, + IsVersionUpgradeStage, UpdatedAtStage, _FinalStage { private PlanChangeAction action; @@ -457,6 +479,8 @@ public static final class Builder private String id; + private boolean isVersionUpgrade; + private OffsetDateTime updatedAt; private Optional userName = Optional.empty(); @@ -510,6 +534,7 @@ public Builder from(PlanChangeResponseData other) { createdAt(other.getCreatedAt()); environmentId(other.getEnvironmentId()); id(other.getId()); + isVersionUpgrade(other.getIsVersionUpgrade()); previousBasePlan(other.getPreviousBasePlan()); previousBasePlanVersion(other.getPreviousBasePlanVersion()); requestId(other.getRequestId()); @@ -558,11 +583,23 @@ public IdStage environmentId(@NotNull String environmentId) { @java.lang.Override @JsonSetter("id") - public UpdatedAtStage id(@NotNull String id) { + public IsVersionUpgradeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } + /** + *

True when this change moved the company to a different version of the same plan (e.g. a plan version migration) rather than to a different plan.

+ *

True when this change moved the company to a different version of the same plan (e.g. a plan version migration) rather than to a different plan.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_version_upgrade") + public UpdatedAtStage isVersionUpgrade(boolean isVersionUpgrade) { + this.isVersionUpgrade = isVersionUpgrade; + return this; + } + @java.lang.Override @JsonSetter("updated_at") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { @@ -854,6 +891,7 @@ public PlanChangeResponseData build() { createdAt, environmentId, id, + isVersionUpgrade, previousBasePlan, previousBasePlanVersion, requestId, diff --git a/src/main/java/com/schematic/api/types/PreviewSubscriptionChangeResponseData.java b/src/main/java/com/schematic/api/types/PreviewSubscriptionChangeResponseData.java index 70b80ac..0575a9a 100644 --- a/src/main/java/com/schematic/api/types/PreviewSubscriptionChangeResponseData.java +++ b/src/main/java/com/schematic/api/types/PreviewSubscriptionChangeResponseData.java @@ -34,6 +34,12 @@ public final class PreviewSubscriptionChangeResponseData { private final long newCharges; + private final boolean optInRequired; + + private final Optional optInText; + + private final Optional optInTitle; + private final boolean paymentMethodRequired; private final double percentOff; @@ -58,6 +64,9 @@ private PreviewSubscriptionChangeResponseData( Optional finance, boolean isScheduledDowngrade, long newCharges, + boolean optInRequired, + Optional optInText, + Optional optInTitle, boolean paymentMethodRequired, double percentOff, OffsetDateTime periodStart, @@ -72,6 +81,9 @@ private PreviewSubscriptionChangeResponseData( this.finance = finance; this.isScheduledDowngrade = isScheduledDowngrade; this.newCharges = newCharges; + this.optInRequired = optInRequired; + this.optInText = optInText; + this.optInTitle = optInTitle; this.paymentMethodRequired = paymentMethodRequired; this.percentOff = percentOff; this.periodStart = periodStart; @@ -108,6 +120,21 @@ public long getNewCharges() { return newCharges; } + @JsonProperty("opt_in_required") + public boolean getOptInRequired() { + return optInRequired; + } + + @JsonProperty("opt_in_text") + public Optional getOptInText() { + return optInText; + } + + @JsonProperty("opt_in_title") + public Optional getOptInTitle() { + return optInTitle; + } + @JsonProperty("payment_method_required") public boolean getPaymentMethodRequired() { return paymentMethodRequired; @@ -166,6 +193,9 @@ private boolean equalTo(PreviewSubscriptionChangeResponseData other) { && finance.equals(other.finance) && isScheduledDowngrade == other.isScheduledDowngrade && newCharges == other.newCharges + && optInRequired == other.optInRequired + && optInText.equals(other.optInText) + && optInTitle.equals(other.optInTitle) && paymentMethodRequired == other.paymentMethodRequired && percentOff == other.percentOff && periodStart.equals(other.periodStart) @@ -184,6 +214,9 @@ public int hashCode() { this.finance, this.isScheduledDowngrade, this.newCharges, + this.optInRequired, + this.optInText, + this.optInTitle, this.paymentMethodRequired, this.percentOff, this.periodStart, @@ -218,7 +251,11 @@ public interface IsScheduledDowngradeStage { } public interface NewChargesStage { - PaymentMethodRequiredStage newCharges(long newCharges); + OptInRequiredStage newCharges(long newCharges); + } + + public interface OptInRequiredStage { + PaymentMethodRequiredStage optInRequired(boolean optInRequired); } public interface PaymentMethodRequiredStage { @@ -252,6 +289,14 @@ public interface _FinalStage { _FinalStage finance(PreviewSubscriptionFinanceResponseData finance); + _FinalStage optInText(Optional optInText); + + _FinalStage optInText(String optInText); + + _FinalStage optInTitle(Optional optInTitle); + + _FinalStage optInTitle(String optInTitle); + _FinalStage scheduledChangeTime(Optional scheduledChangeTime); _FinalStage scheduledChangeTime(OffsetDateTime scheduledChangeTime); @@ -273,6 +318,7 @@ public static final class Builder DueNowStage, IsScheduledDowngradeStage, NewChargesStage, + OptInRequiredStage, PaymentMethodRequiredStage, PercentOffStage, PeriodStartStage, @@ -287,6 +333,8 @@ public static final class Builder private long newCharges; + private boolean optInRequired; + private boolean paymentMethodRequired; private double percentOff; @@ -303,6 +351,10 @@ public static final class Builder private Optional scheduledChangeTime = Optional.empty(); + private Optional optInTitle = Optional.empty(); + + private Optional optInText = Optional.empty(); + private Optional finance = Optional.empty(); @JsonAnySetter @@ -317,6 +369,9 @@ public Builder from(PreviewSubscriptionChangeResponseData other) { finance(other.getFinance()); isScheduledDowngrade(other.getIsScheduledDowngrade()); newCharges(other.getNewCharges()); + optInRequired(other.getOptInRequired()); + optInText(other.getOptInText()); + optInTitle(other.getOptInTitle()); paymentMethodRequired(other.getPaymentMethodRequired()); percentOff(other.getPercentOff()); periodStart(other.getPeriodStart()); @@ -351,11 +406,18 @@ public NewChargesStage isScheduledDowngrade(boolean isScheduledDowngrade) { @java.lang.Override @JsonSetter("new_charges") - public PaymentMethodRequiredStage newCharges(long newCharges) { + public OptInRequiredStage newCharges(long newCharges) { this.newCharges = newCharges; return this; } + @java.lang.Override + @JsonSetter("opt_in_required") + public PaymentMethodRequiredStage optInRequired(boolean optInRequired) { + this.optInRequired = optInRequired; + return this; + } + @java.lang.Override @JsonSetter("payment_method_required") public PercentOffStage paymentMethodRequired(boolean paymentMethodRequired) { @@ -441,6 +503,32 @@ public _FinalStage scheduledChangeTime(Optional scheduledChangeT return this; } + @java.lang.Override + public _FinalStage optInTitle(String optInTitle) { + this.optInTitle = Optional.ofNullable(optInTitle); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_title", nulls = Nulls.SKIP) + public _FinalStage optInTitle(Optional optInTitle) { + this.optInTitle = optInTitle; + return this; + } + + @java.lang.Override + public _FinalStage optInText(String optInText) { + this.optInText = Optional.ofNullable(optInText); + return this; + } + + @java.lang.Override + @JsonSetter(value = "opt_in_text", nulls = Nulls.SKIP) + public _FinalStage optInText(Optional optInText) { + this.optInText = optInText; + return this; + } + @java.lang.Override public _FinalStage finance(PreviewSubscriptionFinanceResponseData finance) { this.finance = Optional.ofNullable(finance); @@ -462,6 +550,9 @@ public PreviewSubscriptionChangeResponseData build() { finance, isScheduledDowngrade, newCharges, + optInRequired, + optInText, + optInTitle, paymentMethodRequired, percentOff, periodStart, diff --git a/src/main/java/com/schematic/api/types/RulesengineFeatureEntitlement.java b/src/main/java/com/schematic/api/types/RulesengineFeatureEntitlement.java index 30c7f02..f871640 100644 --- a/src/main/java/com/schematic/api/types/RulesengineFeatureEntitlement.java +++ b/src/main/java/com/schematic/api/types/RulesengineFeatureEntitlement.java @@ -28,6 +28,10 @@ public final class RulesengineFeatureEntitlement { private final Optional creditRemaining; + private final Optional creditReserved; + + private final Optional creditSettled; + private final Optional creditTotal; private final Optional creditUsed; @@ -56,6 +60,8 @@ private RulesengineFeatureEntitlement( Optional allocation, Optional creditId, Optional creditRemaining, + Optional creditReserved, + Optional creditSettled, Optional creditTotal, Optional creditUsed, Optional eventName, @@ -71,6 +77,8 @@ private RulesengineFeatureEntitlement( this.allocation = allocation; this.creditId = creditId; this.creditRemaining = creditRemaining; + this.creditReserved = creditReserved; + this.creditSettled = creditSettled; this.creditTotal = creditTotal; this.creditUsed = creditUsed; this.eventName = eventName; @@ -102,13 +110,29 @@ public Optional getCreditId() { } /** - * @return If the company has a credit-based entitlement for this feature, the remaining credit amount + * @return If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead */ @JsonProperty("credit_remaining") public Optional getCreditRemaining() { return creditRemaining; } + /** + * @return If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released + */ + @JsonProperty("credit_reserved") + public Optional getCreditReserved() { + return creditReserved; + } + + /** + * @return If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users + */ + @JsonProperty("credit_settled") + public Optional getCreditSettled() { + return creditSettled; + } + /** * @return If the company has a credit-based entitlement for this feature, the total credit amount */ @@ -212,6 +236,8 @@ private boolean equalTo(RulesengineFeatureEntitlement other) { return allocation.equals(other.allocation) && creditId.equals(other.creditId) && creditRemaining.equals(other.creditRemaining) + && creditReserved.equals(other.creditReserved) + && creditSettled.equals(other.creditSettled) && creditTotal.equals(other.creditTotal) && creditUsed.equals(other.creditUsed) && eventName.equals(other.eventName) @@ -231,6 +257,8 @@ public int hashCode() { this.allocation, this.creditId, this.creditRemaining, + this.creditReserved, + this.creditSettled, this.creditTotal, this.creditUsed, this.eventName, @@ -298,12 +326,26 @@ public interface _FinalStage { _FinalStage creditId(String creditId); /** - *

If the company has a credit-based entitlement for this feature, the remaining credit amount

+ *

If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead

*/ _FinalStage creditRemaining(Optional creditRemaining); _FinalStage creditRemaining(Double creditRemaining); + /** + *

If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released

+ */ + _FinalStage creditReserved(Optional creditReserved); + + _FinalStage creditReserved(Double creditReserved); + + /** + *

If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users

+ */ + _FinalStage creditSettled(Optional creditSettled); + + _FinalStage creditSettled(Double creditSettled); + /** *

If the company has a credit-based entitlement for this feature, the total credit amount

*/ @@ -385,6 +427,10 @@ public static final class Builder implements FeatureIdStage, FeatureKeyStage, Va private Optional creditTotal = Optional.empty(); + private Optional creditSettled = Optional.empty(); + + private Optional creditReserved = Optional.empty(); + private Optional creditRemaining = Optional.empty(); private Optional creditId = Optional.empty(); @@ -401,6 +447,8 @@ public Builder from(RulesengineFeatureEntitlement other) { allocation(other.getAllocation()); creditId(other.getCreditId()); creditRemaining(other.getCreditRemaining()); + creditReserved(other.getCreditReserved()); + creditSettled(other.getCreditSettled()); creditTotal(other.getCreditTotal()); creditUsed(other.getCreditUsed()); eventName(other.getEventName()); @@ -612,7 +660,47 @@ public _FinalStage creditTotal(Optional creditTotal) { } /** - *

If the company has a credit-based entitlement for this feature, the remaining credit amount

+ *

If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage creditSettled(Double creditSettled) { + this.creditSettled = Optional.ofNullable(creditSettled); + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users

+ */ + @java.lang.Override + @JsonSetter(value = "credit_settled", nulls = Nulls.SKIP) + public _FinalStage creditSettled(Optional creditSettled) { + this.creditSettled = creditSettled; + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage creditReserved(Double creditReserved) { + this.creditReserved = Optional.ofNullable(creditReserved); + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released

+ */ + @java.lang.Override + @JsonSetter(value = "credit_reserved", nulls = Nulls.SKIP) + public _FinalStage creditReserved(Optional creditReserved) { + this.creditReserved = creditReserved; + return this; + } + + /** + *

If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -622,7 +710,7 @@ public _FinalStage creditRemaining(Double creditRemaining) { } /** - *

If the company has a credit-based entitlement for this feature, the remaining credit amount

+ *

If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead

*/ @java.lang.Override @JsonSetter(value = "credit_remaining", nulls = Nulls.SKIP) @@ -677,6 +765,8 @@ public RulesengineFeatureEntitlement build() { allocation, creditId, creditRemaining, + creditReserved, + creditSettled, creditTotal, creditUsed, eventName,