From 4db31b80b3498376dd6c82960867f7f79f058181 Mon Sep 17 00:00:00 2001
From: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Date: Mon, 1 Jun 2026 16:30:22 +0000
Subject: [PATCH] [fern-generated] Update SDK
Generated by Fern
CLI Version: unknown
Generators:
- fernapi/fern-java-sdk: 4.8.11
---
.fern/metadata.json | 8 +-
build.gradle | 4 +-
reference.md | 318 ++++++++++++++++
.../com/schematic/api/core/ClientOptions.java | 4 +-
.../companies/AsyncRawCompaniesClient.java | 8 +
.../companies/RawCompaniesClient.java | 8 +
.../requests/CountCompaniesRequest.java | 37 ++
.../requests/ListCompaniesRequest.java | 37 ++
.../companies/types/CountCompaniesParams.java | 32 ++
.../companies/types/ListCompaniesParams.java | 32 ++
...llingLinkedPlanEntitlementRequestBody.java | 45 +++
.../CreatePlanEntitlementRequestBody.java | 45 +++
.../UpdatePlanEntitlementRequestBody.java | 45 +++
.../AsyncPlanmigrationsClient.java | 40 ++
.../AsyncRawPlanmigrationsClient.java | 283 +++++++++++++++
.../planmigrations/PlanmigrationsClient.java | 37 ++
.../RawPlanmigrationsClient.java | 212 +++++++++++
.../requests/CreateMigrationInput.java | 342 ++++++++++++++++++
.../requests/RetryMigrationRequestBody.java | 117 ++++++
.../types/CreateMigrationResponse.java | 183 ++++++++++
.../types/RetryCompanyMigrationResponse.java | 183 ++++++++++
.../types/RetryMigrationResponse.java | 183 ++++++++++
.../api/resources/plans/AsyncPlansClient.java | 17 +
.../resources/plans/AsyncRawPlansClient.java | 108 ++++++
.../api/resources/plans/PlansClient.java | 17 +
.../api/resources/plans/RawPlansClient.java | 84 +++++
.../plans/requests/CountPlansRequest.java | 32 ++
.../plans/requests/ListPlansRequest.java | 32 ++
.../plans/types/CountPlansParams.java | 32 ++
.../plans/types/ListPlansParams.java | 32 ++
.../MarkCustomPlanBillingPaidResponse.java | 183 ++++++++++
.../api/types/CheckoutSubscription.java | 32 ++
.../types/CompanyPlanDetailResponseData.java | 78 ++--
.../CreateEntitlementInBundleRequestBody.java | 45 +++
.../types/CustomPlanBillingResponseData.java | 32 ++
.../api/types/IntegrationConfig.java | 60 ++-
.../schematic/api/types/IntegrationType.java | 10 +
.../api/types/MigrationErrorCode.java | 183 ++++++++++
.../api/types/PlanDetailResponseData.java | 32 ++
.../types/PlanEntitlementResponseData.java | 45 +++
.../PlanGroupPlanDetailResponseData.java | 78 ++--
.../schematic/api/types/PlanPriceCadence.java | 93 +++++
...anVersionCompanyMigrationResponseData.java | 32 ++
.../PlanVersionMigrationResponseData.java | 47 +++
.../api/types/PlanViewPublicResponseData.java | 78 ++--
.../api/types/StripeIntegrationConfig.java | 55 +--
.../UsageBasedEntitlementRequestBody.java | 32 ++
.../UsageBasedEntitlementResponseData.java | 45 +++
.../api/types/WorkOsIntegrationConfig.java | 142 ++++++++
49 files changed, 3732 insertions(+), 127 deletions(-)
create mode 100644 src/main/java/com/schematic/api/resources/planmigrations/requests/CreateMigrationInput.java
create mode 100644 src/main/java/com/schematic/api/resources/planmigrations/requests/RetryMigrationRequestBody.java
create mode 100644 src/main/java/com/schematic/api/resources/planmigrations/types/CreateMigrationResponse.java
create mode 100644 src/main/java/com/schematic/api/resources/planmigrations/types/RetryCompanyMigrationResponse.java
create mode 100644 src/main/java/com/schematic/api/resources/planmigrations/types/RetryMigrationResponse.java
create mode 100644 src/main/java/com/schematic/api/resources/plans/types/MarkCustomPlanBillingPaidResponse.java
create mode 100644 src/main/java/com/schematic/api/types/MigrationErrorCode.java
create mode 100644 src/main/java/com/schematic/api/types/PlanPriceCadence.java
create mode 100644 src/main/java/com/schematic/api/types/WorkOsIntegrationConfig.java
diff --git a/.fern/metadata.json b/.fern/metadata.json
index 4187eb6..da30af9 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -1,7 +1,7 @@
{
"cliVersion": "5.6.0",
"generatorName": "fernapi/fern-java-sdk",
- "generatorVersion": "4.8.10",
+ "generatorVersion": "4.8.11",
"generatorConfig": {
"client-class-name": "BaseSchematic",
"generate-unknown-as-json-node": true,
@@ -14,10 +14,10 @@
"implementation redis.clients:jedis:5.2.0"
]
},
- "originGitCommit": "470e0f433ab9bb0e88784674fa2e1efce62ebd9b",
+ "originGitCommit": "a3057c10aa6a1daa708dc714c89ce943f67a722a",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
- "requestedVersion": "1.4.0",
+ "requestedVersion": "1.4.1",
"ciProvider": "github",
- "sdkVersion": "1.4.0"
+ "sdkVersion": "1.4.1"
}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 672a8ee..6162f37 100644
--- a/build.gradle
+++ b/build.gradle
@@ -52,7 +52,7 @@ java {
group = 'com.schematichq'
-version = '1.4.0'
+version = '1.4.1'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -83,7 +83,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.schematichq'
artifactId = 'schematic-java'
- version = '1.4.0'
+ version = '1.4.1'
from components.java
pom {
name = 'Schematic'
diff --git a/reference.md b/reference.md
index 52ed1da..fe12d17 100644
--- a/reference.md
+++ b/reference.md
@@ -6483,6 +6483,9 @@ client.companies().listCompanies(
.planIds(
Arrays.asList("plan_ids")
)
+ .planVersionIds(
+ Arrays.asList("plan_version_ids")
+ )
.subscriptionStatuses(
Arrays.asList(SubscriptionStatus.ACTIVE)
)
@@ -6575,6 +6578,14 @@ client.companies().listCompanies(
-
+**planVersionIds:** `Optional` — Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+
+
+
+
+
+-
+
**q:** `Optional` — Search for companies by name, keys or string traits
@@ -6852,6 +6863,9 @@ client.companies().countCompanies(
.planIds(
Arrays.asList("plan_ids")
)
+ .planVersionIds(
+ Arrays.asList("plan_version_ids")
+ )
.subscriptionStatuses(
Arrays.asList(SubscriptionStatus.ACTIVE)
)
@@ -6944,6 +6958,14 @@ client.companies().countCompanies(
-
+**planVersionIds:** `Optional` — Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+
+
+
+
+
+-
+
**q:** `Optional` — Search for companies by name, keys or string traits
@@ -10625,6 +10647,14 @@ client.entitlements().createPlanEntitlement(
-
+**usageQuantity:** `Optional` — The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+
+
+
+
+
+-
+
**valueBool:** `Optional`
@@ -10943,6 +10973,14 @@ client.entitlements().updatePlanEntitlement(
-
+**usageQuantity:** `Optional` — The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+
+
+
+
+
+-
+
**valueBool:** `Optional`
@@ -11296,6 +11334,14 @@ client.entitlements().upsertPlanEntitlementForBillingProduct(
-
+**usageQuantity:** `Optional` — The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+
+
+
+
+
+-
+
**valueBool:** `Optional`
@@ -11771,6 +11817,59 @@ client.plans().listCustomPlanBillings(
+
+
+
+
+client.plans.markCustomPlanBillingPaid(customPlanBillingId, request) -> MarkCustomPlanBillingPaidResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.plans().markCustomPlanBillingPaid(
+ "custom_plan_billing_id",
+ new HashMap() {{
+ put("key", ObjectMappers.JSON_MAPPER.valueToTree("value"));
+ }}
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**customPlanBillingId:** `String` — custom_plan_billing_id
+
+
+
+
+
+-
+
+**request:** `Map`
+
+
+
+
+
+
+
@@ -11971,6 +12070,7 @@ client.plans().listPlans(
.planType(PlanType.PLAN)
.q("q")
.scopedToCompanyId("scoped_to_company_id")
+ .withEntitlements(true)
.withoutEntitlementFor("without_entitlement_for")
.withoutPaidProductId(true)
.limit(1000000L)
@@ -12087,6 +12187,14 @@ client.plans().listPlans(
-
+**withEntitlements:** `Optional` — Include each plan's entitlements in the response
+
+
+
+
+
+-
+
**withoutEntitlementFor:** `Optional` — Filter out plans that already have a plan entitlement for the specified feature ID
@@ -12644,6 +12752,7 @@ client.plans().countPlans(
.planType(PlanType.PLAN)
.q("q")
.scopedToCompanyId("scoped_to_company_id")
+ .withEntitlements(true)
.withoutEntitlementFor("without_entitlement_for")
.withoutPaidProductId(true)
.limit(1000000L)
@@ -12760,6 +12869,14 @@ client.plans().countPlans(
-
+**withEntitlements:** `Optional` — Include each plan's entitlements in the response
+
+
+
+
+
+-
+
**withoutEntitlementFor:** `Optional` — Filter out plans that already have a plan entitlement for the specified feature ID
@@ -16886,6 +17003,46 @@ client.planmigrations().listCompanyMigrations(
+
+
+
+
+client.planmigrations.retryCompanyMigration(planVersionCompanyMigrationId) -> RetryCompanyMigrationResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.planmigrations().retryCompanyMigration("plan_version_company_migration_id");
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**planVersionCompanyMigrationId:** `String` — plan_version_company_migration_id
+
+
+
+
+
+
+
@@ -17039,6 +17196,111 @@ client.planmigrations().listMigrations(
+
+
+
+
+client.planmigrations.createMigration(request) -> CreateMigrationResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.planmigrations().createMigration(
+ CreateMigrationInput
+ .builder()
+ .planId("plan_id")
+ .planVersionIdTo("plan_version_id_to")
+ .strategy(PlanVersionMigrationStrategy.IMMEDIATE)
+ .targetPlanType(PlanType.PLAN)
+ .companyIds(
+ Arrays.asList("company_ids")
+ )
+ .excludedCompanyIds(
+ Arrays.asList("excluded_company_ids")
+ )
+ .planVersionIdsFrom(
+ Arrays.asList("plan_version_ids_from")
+ )
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**companyIds:** `List`
+
+
+
+
+
+-
+
+**excludedCompanyIds:** `List`
+
+
+
+
+
+-
+
+**planId:** `String`
+
+
+
+
+
+-
+
+**planVersionIdTo:** `String`
+
+
+
+
+
+-
+
+**planVersionIdsFrom:** `List`
+
+
+
+
+
+-
+
+**strategy:** `PlanVersionMigrationStrategy`
+
+
+
+
+
+-
+
+**targetPlanType:** `PlanType`
+
+
+
+
+
+
+
@@ -17079,6 +17341,62 @@ client.planmigrations().getMigration("plan_version_migration_id");
+
+
+
+
+client.planmigrations.retryMigration(planVersionMigrationId, request) -> RetryMigrationResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.planmigrations().retryMigration(
+ "plan_version_migration_id",
+ RetryMigrationRequestBody
+ .builder()
+ .errorCodes(
+ Arrays.asList(MigrationErrorCode.AMBIGUOUS_SUBSCRIPTION_ITEM)
+ )
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**planVersionMigrationId:** `String` — plan_version_migration_id
+
+
+
+
+
+-
+
+**errorCodes:** `List`
+
+
+
+
+
+
+
diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java
index b5d94b9..8a4dc65 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.0");
+ put("User-Agent", "com.schematichq:schematic-java/1.4.1");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk");
- put("X-Fern-SDK-Version", "1.4.0");
+ put("X-Fern-SDK-Version", "1.4.1");
}
});
this.headerSuppliers = headerSuppliers;
diff --git a/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java b/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java
index 8080ce8..84ed57d 100644
--- a/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java
+++ b/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java
@@ -202,6 +202,10 @@ public CompletableFuture> listC
QueryStringMapper.addQueryParameter(
httpUrl, "plan_ids", request.getPlanIds().get(), true);
}
+ if (request.getPlanVersionIds().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "plan_version_ids", request.getPlanVersionIds().get(), true);
+ }
if (request.getSubscriptionStatuses().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl,
@@ -673,6 +677,10 @@ public CompletableFuture> coun
QueryStringMapper.addQueryParameter(
httpUrl, "plan_ids", request.getPlanIds().get(), true);
}
+ if (request.getPlanVersionIds().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "plan_version_ids", request.getPlanVersionIds().get(), true);
+ }
if (request.getSubscriptionStatuses().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl,
diff --git a/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java b/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java
index 99aed3b..b513da1 100644
--- a/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java
+++ b/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java
@@ -196,6 +196,10 @@ public BaseSchematicHttpResponse listCompanies(
QueryStringMapper.addQueryParameter(
httpUrl, "plan_ids", request.getPlanIds().get(), true);
}
+ if (request.getPlanVersionIds().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "plan_version_ids", request.getPlanVersionIds().get(), true);
+ }
if (request.getSubscriptionStatuses().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl,
@@ -569,6 +573,10 @@ public BaseSchematicHttpResponse countCompanies(
QueryStringMapper.addQueryParameter(
httpUrl, "plan_ids", request.getPlanIds().get(), true);
}
+ if (request.getPlanVersionIds().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "plan_version_ids", request.getPlanVersionIds().get(), true);
+ }
if (request.getSubscriptionStatuses().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl,
diff --git a/src/main/java/com/schematic/api/resources/companies/requests/CountCompaniesRequest.java b/src/main/java/com/schematic/api/resources/companies/requests/CountCompaniesRequest.java
index fb2b7bc..933d8b1 100644
--- a/src/main/java/com/schematic/api/resources/companies/requests/CountCompaniesRequest.java
+++ b/src/main/java/com/schematic/api/resources/companies/requests/CountCompaniesRequest.java
@@ -31,6 +31,8 @@ public final class CountCompaniesRequest {
private final Optional> planIds;
+ private final Optional> planVersionIds;
+
private final Optional> subscriptionStatuses;
private final Optional> subscriptionTypes;
@@ -69,6 +71,7 @@ private CountCompaniesRequest(
Optional> creditTypeIds,
Optional> ids,
Optional> planIds,
+ Optional> planVersionIds,
Optional> subscriptionStatuses,
Optional> subscriptionTypes,
Optional hasScheduledDowngrade,
@@ -89,6 +92,7 @@ private CountCompaniesRequest(
this.creditTypeIds = creditTypeIds;
this.ids = ids;
this.planIds = planIds;
+ this.planVersionIds = planVersionIds;
this.subscriptionStatuses = subscriptionStatuses;
this.subscriptionTypes = subscriptionTypes;
this.hasScheduledDowngrade = hasScheduledDowngrade;
@@ -132,6 +136,14 @@ public Optional> getPlanIds() {
return planIds;
}
+ /**
+ * @return Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonProperty("plan_version_ids")
+ public Optional> getPlanVersionIds() {
+ return planVersionIds;
+ }
+
/**
* @return Filter companies by one or more subscription statuses
*/
@@ -275,6 +287,7 @@ private boolean equalTo(CountCompaniesRequest other) {
return creditTypeIds.equals(other.creditTypeIds)
&& ids.equals(other.ids)
&& planIds.equals(other.planIds)
+ && planVersionIds.equals(other.planVersionIds)
&& subscriptionStatuses.equals(other.subscriptionStatuses)
&& subscriptionTypes.equals(other.subscriptionTypes)
&& hasScheduledDowngrade.equals(other.hasScheduledDowngrade)
@@ -299,6 +312,7 @@ public int hashCode() {
this.creditTypeIds,
this.ids,
this.planIds,
+ this.planVersionIds,
this.subscriptionStatuses,
this.subscriptionTypes,
this.hasScheduledDowngrade,
@@ -334,6 +348,8 @@ public static final class Builder {
private Optional> planIds = Optional.empty();
+ private Optional> planVersionIds = Optional.empty();
+
private Optional> subscriptionStatuses = Optional.empty();
private Optional> subscriptionTypes = Optional.empty();
@@ -375,6 +391,7 @@ public Builder from(CountCompaniesRequest other) {
creditTypeIds(other.getCreditTypeIds());
ids(other.getIds());
planIds(other.getPlanIds());
+ planVersionIds(other.getPlanVersionIds());
subscriptionStatuses(other.getSubscriptionStatuses());
subscriptionTypes(other.getSubscriptionTypes());
hasScheduledDowngrade(other.getHasScheduledDowngrade());
@@ -451,6 +468,25 @@ public Builder planIds(String planIds) {
return this;
}
+ /**
+ * Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonSetter(value = "plan_version_ids", nulls = Nulls.SKIP)
+ public Builder planVersionIds(Optional> planVersionIds) {
+ this.planVersionIds = planVersionIds;
+ return this;
+ }
+
+ public Builder planVersionIds(List planVersionIds) {
+ this.planVersionIds = Optional.ofNullable(planVersionIds);
+ return this;
+ }
+
+ public Builder planVersionIds(String planVersionIds) {
+ this.planVersionIds = Optional.of(Collections.singletonList(planVersionIds));
+ return this;
+ }
+
/**
* Filter companies by one or more subscription statuses
*/
@@ -690,6 +726,7 @@ public CountCompaniesRequest build() {
creditTypeIds,
ids,
planIds,
+ planVersionIds,
subscriptionStatuses,
subscriptionTypes,
hasScheduledDowngrade,
diff --git a/src/main/java/com/schematic/api/resources/companies/requests/ListCompaniesRequest.java b/src/main/java/com/schematic/api/resources/companies/requests/ListCompaniesRequest.java
index 28ee241..67fe63f 100644
--- a/src/main/java/com/schematic/api/resources/companies/requests/ListCompaniesRequest.java
+++ b/src/main/java/com/schematic/api/resources/companies/requests/ListCompaniesRequest.java
@@ -31,6 +31,8 @@ public final class ListCompaniesRequest {
private final Optional> planIds;
+ private final Optional> planVersionIds;
+
private final Optional> subscriptionStatuses;
private final Optional> subscriptionTypes;
@@ -69,6 +71,7 @@ private ListCompaniesRequest(
Optional> creditTypeIds,
Optional> ids,
Optional> planIds,
+ Optional> planVersionIds,
Optional> subscriptionStatuses,
Optional> subscriptionTypes,
Optional hasScheduledDowngrade,
@@ -89,6 +92,7 @@ private ListCompaniesRequest(
this.creditTypeIds = creditTypeIds;
this.ids = ids;
this.planIds = planIds;
+ this.planVersionIds = planVersionIds;
this.subscriptionStatuses = subscriptionStatuses;
this.subscriptionTypes = subscriptionTypes;
this.hasScheduledDowngrade = hasScheduledDowngrade;
@@ -132,6 +136,14 @@ public Optional> getPlanIds() {
return planIds;
}
+ /**
+ * @return Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonProperty("plan_version_ids")
+ public Optional> getPlanVersionIds() {
+ return planVersionIds;
+ }
+
/**
* @return Filter companies by one or more subscription statuses
*/
@@ -275,6 +287,7 @@ private boolean equalTo(ListCompaniesRequest other) {
return creditTypeIds.equals(other.creditTypeIds)
&& ids.equals(other.ids)
&& planIds.equals(other.planIds)
+ && planVersionIds.equals(other.planVersionIds)
&& subscriptionStatuses.equals(other.subscriptionStatuses)
&& subscriptionTypes.equals(other.subscriptionTypes)
&& hasScheduledDowngrade.equals(other.hasScheduledDowngrade)
@@ -299,6 +312,7 @@ public int hashCode() {
this.creditTypeIds,
this.ids,
this.planIds,
+ this.planVersionIds,
this.subscriptionStatuses,
this.subscriptionTypes,
this.hasScheduledDowngrade,
@@ -334,6 +348,8 @@ public static final class Builder {
private Optional> planIds = Optional.empty();
+ private Optional> planVersionIds = Optional.empty();
+
private Optional> subscriptionStatuses = Optional.empty();
private Optional> subscriptionTypes = Optional.empty();
@@ -375,6 +391,7 @@ public Builder from(ListCompaniesRequest other) {
creditTypeIds(other.getCreditTypeIds());
ids(other.getIds());
planIds(other.getPlanIds());
+ planVersionIds(other.getPlanVersionIds());
subscriptionStatuses(other.getSubscriptionStatuses());
subscriptionTypes(other.getSubscriptionTypes());
hasScheduledDowngrade(other.getHasScheduledDowngrade());
@@ -451,6 +468,25 @@ public Builder planIds(String planIds) {
return this;
}
+ /**
+ * Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonSetter(value = "plan_version_ids", nulls = Nulls.SKIP)
+ public Builder planVersionIds(Optional> planVersionIds) {
+ this.planVersionIds = planVersionIds;
+ return this;
+ }
+
+ public Builder planVersionIds(List planVersionIds) {
+ this.planVersionIds = Optional.ofNullable(planVersionIds);
+ return this;
+ }
+
+ public Builder planVersionIds(String planVersionIds) {
+ this.planVersionIds = Optional.of(Collections.singletonList(planVersionIds));
+ return this;
+ }
+
/**
* Filter companies by one or more subscription statuses
*/
@@ -690,6 +726,7 @@ public ListCompaniesRequest build() {
creditTypeIds,
ids,
planIds,
+ planVersionIds,
subscriptionStatuses,
subscriptionTypes,
hasScheduledDowngrade,
diff --git a/src/main/java/com/schematic/api/resources/companies/types/CountCompaniesParams.java b/src/main/java/com/schematic/api/resources/companies/types/CountCompaniesParams.java
index 3b58715..d4a60ff 100644
--- a/src/main/java/com/schematic/api/resources/companies/types/CountCompaniesParams.java
+++ b/src/main/java/com/schematic/api/resources/companies/types/CountCompaniesParams.java
@@ -42,6 +42,8 @@ public final class CountCompaniesParams {
private final Optional planVersionId;
+ private final Optional> planVersionIds;
+
private final Optional q;
private final Optional sortOrderColumn;
@@ -74,6 +76,7 @@ private CountCompaniesParams(
Optional planId,
Optional> planIds,
Optional planVersionId,
+ Optional> planVersionIds,
Optional q,
Optional sortOrderColumn,
Optional sortOrderDirection,
@@ -94,6 +97,7 @@ private CountCompaniesParams(
this.planId = planId;
this.planIds = planIds;
this.planVersionId = planVersionId;
+ this.planVersionIds = planVersionIds;
this.q = q;
this.sortOrderColumn = sortOrderColumn;
this.sortOrderDirection = sortOrderDirection;
@@ -179,6 +183,14 @@ public Optional getPlanVersionId() {
return planVersionId;
}
+ /**
+ * @return Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonProperty("plan_version_ids")
+ public Optional> getPlanVersionIds() {
+ return planVersionIds;
+ }
+
/**
* @return Search for companies by name, keys or string traits
*/
@@ -280,6 +292,7 @@ private boolean equalTo(CountCompaniesParams other) {
&& planId.equals(other.planId)
&& planIds.equals(other.planIds)
&& planVersionId.equals(other.planVersionId)
+ && planVersionIds.equals(other.planVersionIds)
&& q.equals(other.q)
&& sortOrderColumn.equals(other.sortOrderColumn)
&& sortOrderDirection.equals(other.sortOrderDirection)
@@ -304,6 +317,7 @@ public int hashCode() {
this.planId,
this.planIds,
this.planVersionId,
+ this.planVersionIds,
this.q,
this.sortOrderColumn,
this.sortOrderDirection,
@@ -345,6 +359,8 @@ public static final class Builder {
private Optional planVersionId = Optional.empty();
+ private Optional> planVersionIds = Optional.empty();
+
private Optional q = Optional.empty();
private Optional sortOrderColumn = Optional.empty();
@@ -380,6 +396,7 @@ public Builder from(CountCompaniesParams other) {
planId(other.getPlanId());
planIds(other.getPlanIds());
planVersionId(other.getPlanVersionId());
+ planVersionIds(other.getPlanVersionIds());
q(other.getQ());
sortOrderColumn(other.getSortOrderColumn());
sortOrderDirection(other.getSortOrderDirection());
@@ -519,6 +536,20 @@ public Builder planVersionId(String planVersionId) {
return this;
}
+ /**
+ * Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonSetter(value = "plan_version_ids", nulls = Nulls.SKIP)
+ public Builder planVersionIds(Optional> planVersionIds) {
+ this.planVersionIds = planVersionIds;
+ return this;
+ }
+
+ public Builder planVersionIds(List planVersionIds) {
+ this.planVersionIds = Optional.ofNullable(planVersionIds);
+ return this;
+ }
+
/**
* Search for companies by name, keys or string traits
*/
@@ -670,6 +701,7 @@ public CountCompaniesParams build() {
planId,
planIds,
planVersionId,
+ planVersionIds,
q,
sortOrderColumn,
sortOrderDirection,
diff --git a/src/main/java/com/schematic/api/resources/companies/types/ListCompaniesParams.java b/src/main/java/com/schematic/api/resources/companies/types/ListCompaniesParams.java
index c6ae112..9bf973a 100644
--- a/src/main/java/com/schematic/api/resources/companies/types/ListCompaniesParams.java
+++ b/src/main/java/com/schematic/api/resources/companies/types/ListCompaniesParams.java
@@ -42,6 +42,8 @@ public final class ListCompaniesParams {
private final Optional planVersionId;
+ private final Optional> planVersionIds;
+
private final Optional q;
private final Optional sortOrderColumn;
@@ -74,6 +76,7 @@ private ListCompaniesParams(
Optional planId,
Optional> planIds,
Optional planVersionId,
+ Optional> planVersionIds,
Optional q,
Optional sortOrderColumn,
Optional sortOrderDirection,
@@ -94,6 +97,7 @@ private ListCompaniesParams(
this.planId = planId;
this.planIds = planIds;
this.planVersionId = planVersionId;
+ this.planVersionIds = planVersionIds;
this.q = q;
this.sortOrderColumn = sortOrderColumn;
this.sortOrderDirection = sortOrderDirection;
@@ -179,6 +183,14 @@ public Optional getPlanVersionId() {
return planVersionId;
}
+ /**
+ * @return Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonProperty("plan_version_ids")
+ public Optional> getPlanVersionIds() {
+ return planVersionIds;
+ }
+
/**
* @return Search for companies by name, keys or string traits
*/
@@ -280,6 +292,7 @@ private boolean equalTo(ListCompaniesParams other) {
&& planId.equals(other.planId)
&& planIds.equals(other.planIds)
&& planVersionId.equals(other.planVersionId)
+ && planVersionIds.equals(other.planVersionIds)
&& q.equals(other.q)
&& sortOrderColumn.equals(other.sortOrderColumn)
&& sortOrderDirection.equals(other.sortOrderDirection)
@@ -304,6 +317,7 @@ public int hashCode() {
this.planId,
this.planIds,
this.planVersionId,
+ this.planVersionIds,
this.q,
this.sortOrderColumn,
this.sortOrderDirection,
@@ -345,6 +359,8 @@ public static final class Builder {
private Optional planVersionId = Optional.empty();
+ private Optional> planVersionIds = Optional.empty();
+
private Optional q = Optional.empty();
private Optional sortOrderColumn = Optional.empty();
@@ -380,6 +396,7 @@ public Builder from(ListCompaniesParams other) {
planId(other.getPlanId());
planIds(other.getPlanIds());
planVersionId(other.getPlanVersionId());
+ planVersionIds(other.getPlanVersionIds());
q(other.getQ());
sortOrderColumn(other.getSortOrderColumn());
sortOrderDirection(other.getSortOrderDirection());
@@ -519,6 +536,20 @@ public Builder planVersionId(String planVersionId) {
return this;
}
+ /**
+ * Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.
+ */
+ @JsonSetter(value = "plan_version_ids", nulls = Nulls.SKIP)
+ public Builder planVersionIds(Optional> planVersionIds) {
+ this.planVersionIds = planVersionIds;
+ return this;
+ }
+
+ public Builder planVersionIds(List planVersionIds) {
+ this.planVersionIds = Optional.ofNullable(planVersionIds);
+ return this;
+ }
+
/**
* Search for companies by name, keys or string traits
*/
@@ -670,6 +701,7 @@ public ListCompaniesParams build() {
planId,
planIds,
planVersionId,
+ planVersionIds,
q,
sortOrderColumn,
sortOrderDirection,
diff --git a/src/main/java/com/schematic/api/resources/entitlements/requests/CreateBillingLinkedPlanEntitlementRequestBody.java b/src/main/java/com/schematic/api/resources/entitlements/requests/CreateBillingLinkedPlanEntitlementRequestBody.java
index 88a4a4b..96a25bf 100644
--- a/src/main/java/com/schematic/api/resources/entitlements/requests/CreateBillingLinkedPlanEntitlementRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/entitlements/requests/CreateBillingLinkedPlanEntitlementRequestBody.java
@@ -80,6 +80,8 @@ public final class CreateBillingLinkedPlanEntitlementRequestBody {
private final Optional tierMode;
+ private final Optional usageQuantity;
+
private final Optional valueBool;
private final Optional valueCreditId;
@@ -126,6 +128,7 @@ private CreateBillingLinkedPlanEntitlementRequestBody(
Optional quarterlyUnitPriceDecimal,
Optional softLimit,
Optional tierMode,
+ Optional usageQuantity,
Optional valueBool,
Optional valueCreditId,
Optional valueNumeric,
@@ -161,6 +164,7 @@ private CreateBillingLinkedPlanEntitlementRequestBody(
this.quarterlyUnitPriceDecimal = quarterlyUnitPriceDecimal;
this.softLimit = softLimit;
this.tierMode = tierMode;
+ this.usageQuantity = usageQuantity;
this.valueBool = valueBool;
this.valueCreditId = valueCreditId;
this.valueNumeric = valueNumeric;
@@ -301,6 +305,14 @@ public Optional getTierMode() {
return tierMode;
}
+ /**
+ * @return The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ @JsonProperty("usage_quantity")
+ public Optional getUsageQuantity() {
+ return usageQuantity;
+ }
+
@JsonProperty("value_bool")
public Optional getValueBool() {
return valueBool;
@@ -384,6 +396,7 @@ private boolean equalTo(CreateBillingLinkedPlanEntitlementRequestBody other) {
&& quarterlyUnitPriceDecimal.equals(other.quarterlyUnitPriceDecimal)
&& softLimit.equals(other.softLimit)
&& tierMode.equals(other.tierMode)
+ && usageQuantity.equals(other.usageQuantity)
&& valueBool.equals(other.valueBool)
&& valueCreditId.equals(other.valueCreditId)
&& valueNumeric.equals(other.valueNumeric)
@@ -423,6 +436,7 @@ public int hashCode() {
this.quarterlyUnitPriceDecimal,
this.softLimit,
this.tierMode,
+ this.usageQuantity,
this.valueBool,
this.valueCreditId,
this.valueNumeric,
@@ -559,6 +573,13 @@ public interface _FinalStage {
_FinalStage tierMode(BillingTiersMode tierMode);
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ _FinalStage usageQuantity(Optional usageQuantity);
+
+ _FinalStage usageQuantity(Long usageQuantity);
+
_FinalStage valueBool(Optional valueBool);
_FinalStage valueBool(Boolean valueBool);
@@ -626,6 +647,8 @@ public static final class Builder
private Optional valueBool = Optional.empty();
+ private Optional usageQuantity = Optional.empty();
+
private Optional tierMode = Optional.empty();
private Optional softLimit = Optional.empty();
@@ -700,6 +723,7 @@ public Builder from(CreateBillingLinkedPlanEntitlementRequestBody other) {
quarterlyUnitPriceDecimal(other.getQuarterlyUnitPriceDecimal());
softLimit(other.getSoftLimit());
tierMode(other.getTierMode());
+ usageQuantity(other.getUsageQuantity());
valueBool(other.getValueBool());
valueCreditId(other.getValueCreditId());
valueNumeric(other.getValueNumeric());
@@ -851,6 +875,26 @@ public _FinalStage valueBool(Optional valueBool) {
return this;
}
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage usageQuantity(Long usageQuantity) {
+ this.usageQuantity = Optional.ofNullable(usageQuantity);
+ return this;
+ }
+
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ @java.lang.Override
+ @JsonSetter(value = "usage_quantity", nulls = Nulls.SKIP)
+ public _FinalStage usageQuantity(Optional usageQuantity) {
+ this.usageQuantity = usageQuantity;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage tierMode(BillingTiersMode tierMode) {
this.tierMode = Optional.ofNullable(tierMode);
@@ -1159,6 +1203,7 @@ public CreateBillingLinkedPlanEntitlementRequestBody build() {
quarterlyUnitPriceDecimal,
softLimit,
tierMode,
+ usageQuantity,
valueBool,
valueCreditId,
valueNumeric,
diff --git a/src/main/java/com/schematic/api/resources/entitlements/requests/CreatePlanEntitlementRequestBody.java b/src/main/java/com/schematic/api/resources/entitlements/requests/CreatePlanEntitlementRequestBody.java
index 67b6de5..bae882b 100644
--- a/src/main/java/com/schematic/api/resources/entitlements/requests/CreatePlanEntitlementRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/entitlements/requests/CreatePlanEntitlementRequestBody.java
@@ -75,6 +75,8 @@ public final class CreatePlanEntitlementRequestBody {
private final Optional tierMode;
+ private final Optional usageQuantity;
+
private final Optional valueBool;
private final Optional valueCreditId;
@@ -119,6 +121,7 @@ private CreatePlanEntitlementRequestBody(
Optional quarterlyUnitPriceDecimal,
Optional softLimit,
Optional tierMode,
+ Optional usageQuantity,
Optional valueBool,
Optional valueCreditId,
Optional valueNumeric,
@@ -152,6 +155,7 @@ private CreatePlanEntitlementRequestBody(
this.quarterlyUnitPriceDecimal = quarterlyUnitPriceDecimal;
this.softLimit = softLimit;
this.tierMode = tierMode;
+ this.usageQuantity = usageQuantity;
this.valueBool = valueBool;
this.valueCreditId = valueCreditId;
this.valueNumeric = valueNumeric;
@@ -282,6 +286,14 @@ public Optional getTierMode() {
return tierMode;
}
+ /**
+ * @return The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ @JsonProperty("usage_quantity")
+ public Optional getUsageQuantity() {
+ return usageQuantity;
+ }
+
@JsonProperty("value_bool")
public Optional getValueBool() {
return valueBool;
@@ -362,6 +374,7 @@ private boolean equalTo(CreatePlanEntitlementRequestBody other) {
&& quarterlyUnitPriceDecimal.equals(other.quarterlyUnitPriceDecimal)
&& softLimit.equals(other.softLimit)
&& tierMode.equals(other.tierMode)
+ && usageQuantity.equals(other.usageQuantity)
&& valueBool.equals(other.valueBool)
&& valueCreditId.equals(other.valueCreditId)
&& valueNumeric.equals(other.valueNumeric)
@@ -399,6 +412,7 @@ public int hashCode() {
this.quarterlyUnitPriceDecimal,
this.softLimit,
this.tierMode,
+ this.usageQuantity,
this.valueBool,
this.valueCreditId,
this.valueNumeric,
@@ -527,6 +541,13 @@ public interface _FinalStage {
_FinalStage tierMode(BillingTiersMode tierMode);
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ _FinalStage usageQuantity(Optional usageQuantity);
+
+ _FinalStage usageQuantity(Long usageQuantity);
+
_FinalStage valueBool(Optional valueBool);
_FinalStage valueBool(Boolean valueBool);
@@ -584,6 +605,8 @@ public static final class Builder implements FeatureIdStage, PlanIdStage, ValueT
private Optional valueBool = Optional.empty();
+ private Optional usageQuantity = Optional.empty();
+
private Optional tierMode = Optional.empty();
private Optional softLimit = Optional.empty();
@@ -656,6 +679,7 @@ public Builder from(CreatePlanEntitlementRequestBody other) {
quarterlyUnitPriceDecimal(other.getQuarterlyUnitPriceDecimal());
softLimit(other.getSoftLimit());
tierMode(other.getTierMode());
+ usageQuantity(other.getUsageQuantity());
valueBool(other.getValueBool());
valueCreditId(other.getValueCreditId());
valueNumeric(other.getValueNumeric());
@@ -793,6 +817,26 @@ public _FinalStage valueBool(Optional valueBool) {
return this;
}
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage usageQuantity(Long usageQuantity) {
+ this.usageQuantity = Optional.ofNullable(usageQuantity);
+ return this;
+ }
+
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ @java.lang.Override
+ @JsonSetter(value = "usage_quantity", nulls = Nulls.SKIP)
+ public _FinalStage usageQuantity(Optional usageQuantity) {
+ this.usageQuantity = usageQuantity;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage tierMode(BillingTiersMode tierMode) {
this.tierMode = Optional.ofNullable(tierMode);
@@ -1099,6 +1143,7 @@ public CreatePlanEntitlementRequestBody build() {
quarterlyUnitPriceDecimal,
softLimit,
tierMode,
+ usageQuantity,
valueBool,
valueCreditId,
valueNumeric,
diff --git a/src/main/java/com/schematic/api/resources/entitlements/requests/UpdatePlanEntitlementRequestBody.java b/src/main/java/com/schematic/api/resources/entitlements/requests/UpdatePlanEntitlementRequestBody.java
index 2a39f38..2f80d73 100644
--- a/src/main/java/com/schematic/api/resources/entitlements/requests/UpdatePlanEntitlementRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/entitlements/requests/UpdatePlanEntitlementRequestBody.java
@@ -69,6 +69,8 @@ public final class UpdatePlanEntitlementRequestBody {
private final Optional tierMode;
+ private final Optional usageQuantity;
+
private final Optional valueBool;
private final Optional valueCreditId;
@@ -110,6 +112,7 @@ private UpdatePlanEntitlementRequestBody(
Optional quarterlyUnitPriceDecimal,
Optional softLimit,
Optional tierMode,
+ Optional usageQuantity,
Optional valueBool,
Optional valueCreditId,
Optional valueNumeric,
@@ -140,6 +143,7 @@ private UpdatePlanEntitlementRequestBody(
this.quarterlyUnitPriceDecimal = quarterlyUnitPriceDecimal;
this.softLimit = softLimit;
this.tierMode = tierMode;
+ this.usageQuantity = usageQuantity;
this.valueBool = valueBool;
this.valueCreditId = valueCreditId;
this.valueNumeric = valueNumeric;
@@ -255,6 +259,14 @@ public Optional getTierMode() {
return tierMode;
}
+ /**
+ * @return The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ @JsonProperty("usage_quantity")
+ public Optional getUsageQuantity() {
+ return usageQuantity;
+ }
+
@JsonProperty("value_bool")
public Optional getValueBool() {
return valueBool;
@@ -332,6 +344,7 @@ private boolean equalTo(UpdatePlanEntitlementRequestBody other) {
&& quarterlyUnitPriceDecimal.equals(other.quarterlyUnitPriceDecimal)
&& softLimit.equals(other.softLimit)
&& tierMode.equals(other.tierMode)
+ && usageQuantity.equals(other.usageQuantity)
&& valueBool.equals(other.valueBool)
&& valueCreditId.equals(other.valueCreditId)
&& valueNumeric.equals(other.valueNumeric)
@@ -366,6 +379,7 @@ public int hashCode() {
this.quarterlyUnitPriceDecimal,
this.softLimit,
this.tierMode,
+ this.usageQuantity,
this.valueBool,
this.valueCreditId,
this.valueNumeric,
@@ -482,6 +496,13 @@ public interface _FinalStage {
_FinalStage tierMode(BillingTiersMode tierMode);
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ _FinalStage usageQuantity(Optional usageQuantity);
+
+ _FinalStage usageQuantity(Long usageQuantity);
+
_FinalStage valueBool(Optional valueBool);
_FinalStage valueBool(Boolean valueBool);
@@ -535,6 +556,8 @@ public static final class Builder implements ValueTypeStage, _FinalStage {
private Optional valueBool = Optional.empty();
+ private Optional usageQuantity = Optional.empty();
+
private Optional tierMode = Optional.empty();
private Optional softLimit = Optional.empty();
@@ -602,6 +625,7 @@ public Builder from(UpdatePlanEntitlementRequestBody other) {
quarterlyUnitPriceDecimal(other.getQuarterlyUnitPriceDecimal());
softLimit(other.getSoftLimit());
tierMode(other.getTierMode());
+ usageQuantity(other.getUsageQuantity());
valueBool(other.getValueBool());
valueCreditId(other.getValueCreditId());
valueNumeric(other.getValueNumeric());
@@ -725,6 +749,26 @@ public _FinalStage valueBool(Optional valueBool) {
return this;
}
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage usageQuantity(Long usageQuantity) {
+ this.usageQuantity = Optional.ofNullable(usageQuantity);
+ return this;
+ }
+
+ /**
+ * The committed unit quantity for this entitlement. For custom plans this is the quantity the company is contractually committed to; for standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. Note: this is not yet enforced/auto-provisioned as a true default — it is currently stored for downstream billing use.
+ */
+ @java.lang.Override
+ @JsonSetter(value = "usage_quantity", nulls = Nulls.SKIP)
+ public _FinalStage usageQuantity(Optional usageQuantity) {
+ this.usageQuantity = usageQuantity;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage tierMode(BillingTiersMode tierMode) {
this.tierMode = Optional.ofNullable(tierMode);
@@ -1015,6 +1059,7 @@ public UpdatePlanEntitlementRequestBody build() {
quarterlyUnitPriceDecimal,
softLimit,
tierMode,
+ usageQuantity,
valueBool,
valueCreditId,
valueNumeric,
diff --git a/src/main/java/com/schematic/api/resources/planmigrations/AsyncPlanmigrationsClient.java b/src/main/java/com/schematic/api/resources/planmigrations/AsyncPlanmigrationsClient.java
index 448e672..cfb395c 100644
--- a/src/main/java/com/schematic/api/resources/planmigrations/AsyncPlanmigrationsClient.java
+++ b/src/main/java/com/schematic/api/resources/planmigrations/AsyncPlanmigrationsClient.java
@@ -7,13 +7,18 @@
import com.schematic.api.core.RequestOptions;
import com.schematic.api.resources.planmigrations.requests.CountCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.CountMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.CreateMigrationInput;
import com.schematic.api.resources.planmigrations.requests.ListCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.ListMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody;
import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.CreateMigrationResponse;
import com.schematic.api.resources.planmigrations.types.GetMigrationResponse;
import com.schematic.api.resources.planmigrations.types.ListCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.ListMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse;
+import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse;
import java.util.concurrent.CompletableFuture;
public class AsyncPlanmigrationsClient {
@@ -51,6 +56,20 @@ public CompletableFuture listCompanyMigrations(
return this.rawClient.listCompanyMigrations(request, requestOptions).thenApply(response -> response.body());
}
+ public CompletableFuture retryCompanyMigration(
+ String planVersionCompanyMigrationId) {
+ return this.rawClient
+ .retryCompanyMigration(planVersionCompanyMigrationId)
+ .thenApply(response -> response.body());
+ }
+
+ public CompletableFuture retryCompanyMigration(
+ String planVersionCompanyMigrationId, RequestOptions requestOptions) {
+ return this.rawClient
+ .retryCompanyMigration(planVersionCompanyMigrationId, requestOptions)
+ .thenApply(response -> response.body());
+ }
+
public CompletableFuture countCompanyMigrations() {
return this.rawClient.countCompanyMigrations().thenApply(response -> response.body());
}
@@ -86,6 +105,15 @@ public CompletableFuture listMigrations(
return this.rawClient.listMigrations(request, requestOptions).thenApply(response -> response.body());
}
+ public CompletableFuture createMigration(CreateMigrationInput request) {
+ return this.rawClient.createMigration(request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture createMigration(
+ CreateMigrationInput request, RequestOptions requestOptions) {
+ return this.rawClient.createMigration(request, requestOptions).thenApply(response -> response.body());
+ }
+
public CompletableFuture getMigration(String planVersionMigrationId) {
return this.rawClient.getMigration(planVersionMigrationId).thenApply(response -> response.body());
}
@@ -97,6 +125,18 @@ public CompletableFuture getMigration(
.thenApply(response -> response.body());
}
+ public CompletableFuture retryMigration(
+ String planVersionMigrationId, RetryMigrationRequestBody request) {
+ return this.rawClient.retryMigration(planVersionMigrationId, request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture retryMigration(
+ String planVersionMigrationId, RetryMigrationRequestBody request, RequestOptions requestOptions) {
+ return this.rawClient
+ .retryMigration(planVersionMigrationId, request, requestOptions)
+ .thenApply(response -> response.body());
+ }
+
public CompletableFuture countMigrations() {
return this.rawClient.countMigrations().thenApply(response -> response.body());
}
diff --git a/src/main/java/com/schematic/api/resources/planmigrations/AsyncRawPlanmigrationsClient.java b/src/main/java/com/schematic/api/resources/planmigrations/AsyncRawPlanmigrationsClient.java
index b948f0b..0d21687 100644
--- a/src/main/java/com/schematic/api/resources/planmigrations/AsyncRawPlanmigrationsClient.java
+++ b/src/main/java/com/schematic/api/resources/planmigrations/AsyncRawPlanmigrationsClient.java
@@ -8,6 +8,7 @@
import com.schematic.api.core.BaseSchematicException;
import com.schematic.api.core.BaseSchematicHttpResponse;
import com.schematic.api.core.ClientOptions;
+import com.schematic.api.core.MediaTypes;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
@@ -18,13 +19,18 @@
import com.schematic.api.errors.UnauthorizedError;
import com.schematic.api.resources.planmigrations.requests.CountCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.CountMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.CreateMigrationInput;
import com.schematic.api.resources.planmigrations.requests.ListCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.ListMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody;
import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.CreateMigrationResponse;
import com.schematic.api.resources.planmigrations.types.GetMigrationResponse;
import com.schematic.api.resources.planmigrations.types.ListCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.ListMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse;
+import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse;
import com.schematic.api.types.ApiError;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
@@ -34,6 +40,7 @@
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
+import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import org.jetbrains.annotations.NotNull;
@@ -159,6 +166,94 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
return future;
}
+ public CompletableFuture> retryCompanyMigration(
+ String planVersionCompanyMigrationId) {
+ return retryCompanyMigration(planVersionCompanyMigrationId, null);
+ }
+
+ public CompletableFuture> retryCompanyMigration(
+ String planVersionCompanyMigrationId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("plan-version-company-migrations")
+ .addPathSegment(planVersionCompanyMigrationId)
+ .addPathSegments("retry");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("POST", RequestBody.create("", null))
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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, RetryCompanyMigrationResponse.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> countCompanyMigrations() {
return countCompanyMigrations(CountCompanyMigrationsRequest.builder().build());
}
@@ -383,6 +478,99 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
return future;
}
+ public CompletableFuture> createMigration(
+ CreateMigrationInput request) {
+ return createMigration(request, null);
+ }
+
+ public CompletableFuture> createMigration(
+ CreateMigrationInput request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("plan-version-migrations");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .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, CreateMigrationResponse.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> getMigration(
String planVersionMigrationId) {
return getMigration(planVersionMigrationId, null);
@@ -464,6 +652,101 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
return future;
}
+ public CompletableFuture> retryMigration(
+ String planVersionMigrationId, RetryMigrationRequestBody request) {
+ return retryMigration(planVersionMigrationId, request, null);
+ }
+
+ public CompletableFuture> retryMigration(
+ String planVersionMigrationId, RetryMigrationRequestBody request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("plan-version-migrations")
+ .addPathSegment(planVersionMigrationId)
+ .addPathSegments("retry");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .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, RetryMigrationResponse.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> countMigrations() {
return countMigrations(CountMigrationsRequest.builder().build());
}
diff --git a/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java b/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java
index b837657..689508b 100644
--- a/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java
+++ b/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java
@@ -7,13 +7,18 @@
import com.schematic.api.core.RequestOptions;
import com.schematic.api.resources.planmigrations.requests.CountCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.CountMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.CreateMigrationInput;
import com.schematic.api.resources.planmigrations.requests.ListCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.ListMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody;
import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.CreateMigrationResponse;
import com.schematic.api.resources.planmigrations.types.GetMigrationResponse;
import com.schematic.api.resources.planmigrations.types.ListCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.ListMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse;
+import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse;
public class PlanmigrationsClient {
protected final ClientOptions clientOptions;
@@ -49,6 +54,19 @@ public ListCompanyMigrationsResponse listCompanyMigrations(
return this.rawClient.listCompanyMigrations(request, requestOptions).body();
}
+ public RetryCompanyMigrationResponse retryCompanyMigration(String planVersionCompanyMigrationId) {
+ return this.rawClient
+ .retryCompanyMigration(planVersionCompanyMigrationId)
+ .body();
+ }
+
+ public RetryCompanyMigrationResponse retryCompanyMigration(
+ String planVersionCompanyMigrationId, RequestOptions requestOptions) {
+ return this.rawClient
+ .retryCompanyMigration(planVersionCompanyMigrationId, requestOptions)
+ .body();
+ }
+
public CountCompanyMigrationsResponse countCompanyMigrations() {
return this.rawClient.countCompanyMigrations().body();
}
@@ -82,6 +100,14 @@ public ListMigrationsResponse listMigrations(ListMigrationsRequest request, Requ
return this.rawClient.listMigrations(request, requestOptions).body();
}
+ public CreateMigrationResponse createMigration(CreateMigrationInput request) {
+ return this.rawClient.createMigration(request).body();
+ }
+
+ public CreateMigrationResponse createMigration(CreateMigrationInput request, RequestOptions requestOptions) {
+ return this.rawClient.createMigration(request, requestOptions).body();
+ }
+
public GetMigrationResponse getMigration(String planVersionMigrationId) {
return this.rawClient.getMigration(planVersionMigrationId).body();
}
@@ -92,6 +118,17 @@ public GetMigrationResponse getMigration(String planVersionMigrationId, RequestO
.body();
}
+ public RetryMigrationResponse retryMigration(String planVersionMigrationId, RetryMigrationRequestBody request) {
+ return this.rawClient.retryMigration(planVersionMigrationId, request).body();
+ }
+
+ public RetryMigrationResponse retryMigration(
+ String planVersionMigrationId, RetryMigrationRequestBody request, RequestOptions requestOptions) {
+ return this.rawClient
+ .retryMigration(planVersionMigrationId, request, requestOptions)
+ .body();
+ }
+
public CountMigrationsResponse countMigrations() {
return this.rawClient.countMigrations().body();
}
diff --git a/src/main/java/com/schematic/api/resources/planmigrations/RawPlanmigrationsClient.java b/src/main/java/com/schematic/api/resources/planmigrations/RawPlanmigrationsClient.java
index 964fae3..28deea0 100644
--- a/src/main/java/com/schematic/api/resources/planmigrations/RawPlanmigrationsClient.java
+++ b/src/main/java/com/schematic/api/resources/planmigrations/RawPlanmigrationsClient.java
@@ -8,6 +8,7 @@
import com.schematic.api.core.BaseSchematicException;
import com.schematic.api.core.BaseSchematicHttpResponse;
import com.schematic.api.core.ClientOptions;
+import com.schematic.api.core.MediaTypes;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
@@ -18,19 +19,25 @@
import com.schematic.api.errors.UnauthorizedError;
import com.schematic.api.resources.planmigrations.requests.CountCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.CountMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.CreateMigrationInput;
import com.schematic.api.resources.planmigrations.requests.ListCompanyMigrationsRequest;
import com.schematic.api.resources.planmigrations.requests.ListMigrationsRequest;
+import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody;
import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.CreateMigrationResponse;
import com.schematic.api.resources.planmigrations.types.GetMigrationResponse;
import com.schematic.api.resources.planmigrations.types.ListCompanyMigrationsResponse;
import com.schematic.api.resources.planmigrations.types.ListMigrationsResponse;
+import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse;
+import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse;
import com.schematic.api.types.ApiError;
import java.io.IOException;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
+import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
@@ -131,6 +138,70 @@ public BaseSchematicHttpResponse listCompanyMigra
}
}
+ public BaseSchematicHttpResponse retryCompanyMigration(
+ String planVersionCompanyMigrationId) {
+ return retryCompanyMigration(planVersionCompanyMigrationId, null);
+ }
+
+ public BaseSchematicHttpResponse retryCompanyMigration(
+ String planVersionCompanyMigrationId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("plan-version-company-migrations")
+ .addPathSegment(planVersionCompanyMigrationId)
+ .addPathSegments("retry");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("POST", RequestBody.create("", null))
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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, RetryCompanyMigrationResponse.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 countCompanyMigrations() {
return countCompanyMigrations(CountCompanyMigrationsRequest.builder().build());
}
@@ -306,6 +377,75 @@ public BaseSchematicHttpResponse listMigrations(
}
}
+ public BaseSchematicHttpResponse createMigration(CreateMigrationInput request) {
+ return createMigration(request, null);
+ }
+
+ public BaseSchematicHttpResponse createMigration(
+ CreateMigrationInput request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("plan-version-migrations");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .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, CreateMigrationResponse.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 getMigration(String planVersionMigrationId) {
return getMigration(planVersionMigrationId, null);
}
@@ -364,6 +504,78 @@ public BaseSchematicHttpResponse getMigration(
}
}
+ public BaseSchematicHttpResponse retryMigration(
+ String planVersionMigrationId, RetryMigrationRequestBody request) {
+ return retryMigration(planVersionMigrationId, request, null);
+ }
+
+ public BaseSchematicHttpResponse retryMigration(
+ String planVersionMigrationId, RetryMigrationRequestBody request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("plan-version-migrations")
+ .addPathSegment(planVersionMigrationId)
+ .addPathSegments("retry");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .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, RetryMigrationResponse.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 countMigrations() {
return countMigrations(CountMigrationsRequest.builder().build());
}
diff --git a/src/main/java/com/schematic/api/resources/planmigrations/requests/CreateMigrationInput.java b/src/main/java/com/schematic/api/resources/planmigrations/requests/CreateMigrationInput.java
new file mode 100644
index 0000000..adca4fa
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/planmigrations/requests/CreateMigrationInput.java
@@ -0,0 +1,342 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.planmigrations.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.PlanType;
+import com.schematic.api.types.PlanVersionMigrationStrategy;
+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 = CreateMigrationInput.Builder.class)
+public final class CreateMigrationInput {
+ private final List companyIds;
+
+ private final List excludedCompanyIds;
+
+ private final String planId;
+
+ private final String planVersionIdTo;
+
+ private final List planVersionIdsFrom;
+
+ private final PlanVersionMigrationStrategy strategy;
+
+ private final PlanType targetPlanType;
+
+ private final Map additionalProperties;
+
+ private CreateMigrationInput(
+ List companyIds,
+ List excludedCompanyIds,
+ String planId,
+ String planVersionIdTo,
+ List planVersionIdsFrom,
+ PlanVersionMigrationStrategy strategy,
+ PlanType targetPlanType,
+ Map additionalProperties) {
+ this.companyIds = companyIds;
+ this.excludedCompanyIds = excludedCompanyIds;
+ this.planId = planId;
+ this.planVersionIdTo = planVersionIdTo;
+ this.planVersionIdsFrom = planVersionIdsFrom;
+ this.strategy = strategy;
+ this.targetPlanType = targetPlanType;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("company_ids")
+ public List getCompanyIds() {
+ return companyIds;
+ }
+
+ @JsonProperty("excluded_company_ids")
+ public List getExcludedCompanyIds() {
+ return excludedCompanyIds;
+ }
+
+ @JsonProperty("plan_id")
+ public String getPlanId() {
+ return planId;
+ }
+
+ @JsonProperty("plan_version_id_to")
+ public String getPlanVersionIdTo() {
+ return planVersionIdTo;
+ }
+
+ @JsonProperty("plan_version_ids_from")
+ public List getPlanVersionIdsFrom() {
+ return planVersionIdsFrom;
+ }
+
+ @JsonProperty("strategy")
+ public PlanVersionMigrationStrategy getStrategy() {
+ return strategy;
+ }
+
+ @JsonProperty("target_plan_type")
+ public PlanType getTargetPlanType() {
+ return targetPlanType;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof CreateMigrationInput && equalTo((CreateMigrationInput) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(CreateMigrationInput other) {
+ return companyIds.equals(other.companyIds)
+ && excludedCompanyIds.equals(other.excludedCompanyIds)
+ && planId.equals(other.planId)
+ && planVersionIdTo.equals(other.planVersionIdTo)
+ && planVersionIdsFrom.equals(other.planVersionIdsFrom)
+ && strategy.equals(other.strategy)
+ && targetPlanType.equals(other.targetPlanType);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(
+ this.companyIds,
+ this.excludedCompanyIds,
+ this.planId,
+ this.planVersionIdTo,
+ this.planVersionIdsFrom,
+ this.strategy,
+ this.targetPlanType);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static PlanIdStage builder() {
+ return new Builder();
+ }
+
+ public interface PlanIdStage {
+ PlanVersionIdToStage planId(@NotNull String planId);
+
+ Builder from(CreateMigrationInput other);
+ }
+
+ public interface PlanVersionIdToStage {
+ StrategyStage planVersionIdTo(@NotNull String planVersionIdTo);
+ }
+
+ public interface StrategyStage {
+ TargetPlanTypeStage strategy(@NotNull PlanVersionMigrationStrategy strategy);
+ }
+
+ public interface TargetPlanTypeStage {
+ _FinalStage targetPlanType(@NotNull PlanType targetPlanType);
+ }
+
+ public interface _FinalStage {
+ CreateMigrationInput build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+
+ _FinalStage companyIds(List companyIds);
+
+ _FinalStage addCompanyIds(String companyIds);
+
+ _FinalStage addAllCompanyIds(List companyIds);
+
+ _FinalStage excludedCompanyIds(List excludedCompanyIds);
+
+ _FinalStage addExcludedCompanyIds(String excludedCompanyIds);
+
+ _FinalStage addAllExcludedCompanyIds(List excludedCompanyIds);
+
+ _FinalStage planVersionIdsFrom(List planVersionIdsFrom);
+
+ _FinalStage addPlanVersionIdsFrom(String planVersionIdsFrom);
+
+ _FinalStage addAllPlanVersionIdsFrom(List planVersionIdsFrom);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder
+ implements PlanIdStage, PlanVersionIdToStage, StrategyStage, TargetPlanTypeStage, _FinalStage {
+ private String planId;
+
+ private String planVersionIdTo;
+
+ private PlanVersionMigrationStrategy strategy;
+
+ private PlanType targetPlanType;
+
+ private List planVersionIdsFrom = new ArrayList<>();
+
+ private List excludedCompanyIds = new ArrayList<>();
+
+ private List companyIds = new ArrayList<>();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(CreateMigrationInput other) {
+ companyIds(other.getCompanyIds());
+ excludedCompanyIds(other.getExcludedCompanyIds());
+ planId(other.getPlanId());
+ planVersionIdTo(other.getPlanVersionIdTo());
+ planVersionIdsFrom(other.getPlanVersionIdsFrom());
+ strategy(other.getStrategy());
+ targetPlanType(other.getTargetPlanType());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("plan_id")
+ public PlanVersionIdToStage planId(@NotNull String planId) {
+ this.planId = Objects.requireNonNull(planId, "planId must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("plan_version_id_to")
+ public StrategyStage planVersionIdTo(@NotNull String planVersionIdTo) {
+ this.planVersionIdTo = Objects.requireNonNull(planVersionIdTo, "planVersionIdTo must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("strategy")
+ public TargetPlanTypeStage strategy(@NotNull PlanVersionMigrationStrategy strategy) {
+ this.strategy = Objects.requireNonNull(strategy, "strategy must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("target_plan_type")
+ public _FinalStage targetPlanType(@NotNull PlanType targetPlanType) {
+ this.targetPlanType = Objects.requireNonNull(targetPlanType, "targetPlanType must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addAllPlanVersionIdsFrom(List planVersionIdsFrom) {
+ if (planVersionIdsFrom != null) {
+ this.planVersionIdsFrom.addAll(planVersionIdsFrom);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addPlanVersionIdsFrom(String planVersionIdsFrom) {
+ this.planVersionIdsFrom.add(planVersionIdsFrom);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "plan_version_ids_from", nulls = Nulls.SKIP)
+ public _FinalStage planVersionIdsFrom(List planVersionIdsFrom) {
+ this.planVersionIdsFrom.clear();
+ if (planVersionIdsFrom != null) {
+ this.planVersionIdsFrom.addAll(planVersionIdsFrom);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addAllExcludedCompanyIds(List excludedCompanyIds) {
+ if (excludedCompanyIds != null) {
+ this.excludedCompanyIds.addAll(excludedCompanyIds);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addExcludedCompanyIds(String excludedCompanyIds) {
+ this.excludedCompanyIds.add(excludedCompanyIds);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "excluded_company_ids", nulls = Nulls.SKIP)
+ public _FinalStage excludedCompanyIds(List excludedCompanyIds) {
+ this.excludedCompanyIds.clear();
+ if (excludedCompanyIds != null) {
+ this.excludedCompanyIds.addAll(excludedCompanyIds);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addAllCompanyIds(List companyIds) {
+ if (companyIds != null) {
+ this.companyIds.addAll(companyIds);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public _FinalStage addCompanyIds(String companyIds) {
+ this.companyIds.add(companyIds);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "company_ids", nulls = Nulls.SKIP)
+ public _FinalStage companyIds(List companyIds) {
+ this.companyIds.clear();
+ if (companyIds != null) {
+ this.companyIds.addAll(companyIds);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public CreateMigrationInput build() {
+ return new CreateMigrationInput(
+ companyIds,
+ excludedCompanyIds,
+ planId,
+ planVersionIdTo,
+ planVersionIdsFrom,
+ strategy,
+ targetPlanType,
+ 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/planmigrations/requests/RetryMigrationRequestBody.java b/src/main/java/com/schematic/api/resources/planmigrations/requests/RetryMigrationRequestBody.java
new file mode 100644
index 0000000..69822eb
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/planmigrations/requests/RetryMigrationRequestBody.java
@@ -0,0 +1,117 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.planmigrations.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.MigrationErrorCode;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = RetryMigrationRequestBody.Builder.class)
+public final class RetryMigrationRequestBody {
+ private final List errorCodes;
+
+ private final Map additionalProperties;
+
+ private RetryMigrationRequestBody(List errorCodes, Map additionalProperties) {
+ this.errorCodes = errorCodes;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("error_codes")
+ public List getErrorCodes() {
+ return errorCodes;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof RetryMigrationRequestBody && equalTo((RetryMigrationRequestBody) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(RetryMigrationRequestBody other) {
+ return errorCodes.equals(other.errorCodes);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.errorCodes);
+ }
+
+ @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 List errorCodes = new ArrayList<>();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(RetryMigrationRequestBody other) {
+ errorCodes(other.getErrorCodes());
+ return this;
+ }
+
+ @JsonSetter(value = "error_codes", nulls = Nulls.SKIP)
+ public Builder errorCodes(List errorCodes) {
+ this.errorCodes.clear();
+ if (errorCodes != null) {
+ this.errorCodes.addAll(errorCodes);
+ }
+ return this;
+ }
+
+ public Builder addErrorCodes(MigrationErrorCode errorCodes) {
+ this.errorCodes.add(errorCodes);
+ return this;
+ }
+
+ public Builder addAllErrorCodes(List errorCodes) {
+ if (errorCodes != null) {
+ this.errorCodes.addAll(errorCodes);
+ }
+ return this;
+ }
+
+ public RetryMigrationRequestBody build() {
+ return new RetryMigrationRequestBody(errorCodes, 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/planmigrations/types/CreateMigrationResponse.java b/src/main/java/com/schematic/api/resources/planmigrations/types/CreateMigrationResponse.java
new file mode 100644
index 0000000..46897a5
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/planmigrations/types/CreateMigrationResponse.java
@@ -0,0 +1,183 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.planmigrations.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.JsonNode;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import com.schematic.api.types.PlanVersionMigrationResponseData;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = CreateMigrationResponse.Builder.class)
+public final class CreateMigrationResponse {
+ private final PlanVersionMigrationResponseData data;
+
+ private final Map params;
+
+ private final Map additionalProperties;
+
+ private CreateMigrationResponse(
+ PlanVersionMigrationResponseData data,
+ Map params,
+ Map additionalProperties) {
+ this.data = data;
+ this.params = params;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("data")
+ public PlanVersionMigrationResponseData getData() {
+ return data;
+ }
+
+ /**
+ * @return Input parameters
+ */
+ @JsonProperty("params")
+ public Map getParams() {
+ return params;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof CreateMigrationResponse && equalTo((CreateMigrationResponse) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(CreateMigrationResponse 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 {
+ _FinalStage data(@NotNull PlanVersionMigrationResponseData data);
+
+ Builder from(CreateMigrationResponse other);
+ }
+
+ public interface _FinalStage {
+ CreateMigrationResponse build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+
+ /**
+ * Input parameters
+ */
+ _FinalStage params(Map params);
+
+ _FinalStage putAllParams(Map params);
+
+ _FinalStage params(String key, JsonNode value);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements DataStage, _FinalStage {
+ private PlanVersionMigrationResponseData data;
+
+ private Map params = new LinkedHashMap<>();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(CreateMigrationResponse other) {
+ data(other.getData());
+ params(other.getParams());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("data")
+ public _FinalStage data(@NotNull PlanVersionMigrationResponseData data) {
+ this.data = Objects.requireNonNull(data, "data must not be null");
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage params(String key, JsonNode value) {
+ this.params.put(key, value);
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage putAllParams(Map params) {
+ if (params != null) {
+ this.params.putAll(params);
+ }
+ return this;
+ }
+
+ /**
+ * Input parameters
+ */
+ @java.lang.Override
+ @JsonSetter(value = "params", nulls = Nulls.SKIP)
+ public _FinalStage params(Map params) {
+ this.params.clear();
+ if (params != null) {
+ this.params.putAll(params);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public CreateMigrationResponse build() {
+ return new CreateMigrationResponse(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/planmigrations/types/RetryCompanyMigrationResponse.java b/src/main/java/com/schematic/api/resources/planmigrations/types/RetryCompanyMigrationResponse.java
new file mode 100644
index 0000000..ced059d
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/planmigrations/types/RetryCompanyMigrationResponse.java
@@ -0,0 +1,183 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.planmigrations.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.JsonNode;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import com.schematic.api.types.PlanVersionCompanyMigrationResponseData;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = RetryCompanyMigrationResponse.Builder.class)
+public final class RetryCompanyMigrationResponse {
+ private final PlanVersionCompanyMigrationResponseData data;
+
+ private final Map params;
+
+ private final Map additionalProperties;
+
+ private RetryCompanyMigrationResponse(
+ PlanVersionCompanyMigrationResponseData data,
+ Map params,
+ Map additionalProperties) {
+ this.data = data;
+ this.params = params;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("data")
+ public PlanVersionCompanyMigrationResponseData getData() {
+ return data;
+ }
+
+ /**
+ * @return Input parameters
+ */
+ @JsonProperty("params")
+ public Map getParams() {
+ return params;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof RetryCompanyMigrationResponse && equalTo((RetryCompanyMigrationResponse) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(RetryCompanyMigrationResponse 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 {
+ _FinalStage data(@NotNull PlanVersionCompanyMigrationResponseData data);
+
+ Builder from(RetryCompanyMigrationResponse other);
+ }
+
+ public interface _FinalStage {
+ RetryCompanyMigrationResponse build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+
+ /**
+ * Input parameters
+ */
+ _FinalStage params(Map params);
+
+ _FinalStage putAllParams(Map params);
+
+ _FinalStage params(String key, JsonNode value);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements DataStage, _FinalStage {
+ private PlanVersionCompanyMigrationResponseData data;
+
+ private Map params = new LinkedHashMap<>();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(RetryCompanyMigrationResponse other) {
+ data(other.getData());
+ params(other.getParams());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("data")
+ public _FinalStage data(@NotNull PlanVersionCompanyMigrationResponseData data) {
+ this.data = Objects.requireNonNull(data, "data must not be null");
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage params(String key, JsonNode value) {
+ this.params.put(key, value);
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage putAllParams(Map params) {
+ if (params != null) {
+ this.params.putAll(params);
+ }
+ return this;
+ }
+
+ /**
+ * Input parameters
+ */
+ @java.lang.Override
+ @JsonSetter(value = "params", nulls = Nulls.SKIP)
+ public _FinalStage params(Map params) {
+ this.params.clear();
+ if (params != null) {
+ this.params.putAll(params);
+ }
+ return this;
+ }
+
+ @java.lang.Override
+ public RetryCompanyMigrationResponse build() {
+ return new RetryCompanyMigrationResponse(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/planmigrations/types/RetryMigrationResponse.java b/src/main/java/com/schematic/api/resources/planmigrations/types/RetryMigrationResponse.java
new file mode 100644
index 0000000..79449d7
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/planmigrations/types/RetryMigrationResponse.java
@@ -0,0 +1,183 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.planmigrations.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.JsonNode;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import com.schematic.api.types.PlanVersionMigrationResponseData;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = RetryMigrationResponse.Builder.class)
+public final class RetryMigrationResponse {
+ private final PlanVersionMigrationResponseData data;
+
+ private final Map params;
+
+ private final Map