From 66522cb8ab30f986fc1c3f620d1fa248b2db5524 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 18:19:48 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-java-sdk: 4.11.1 --- .fern/metadata.json | 6 +- build.gradle | 4 +- reference.md | 303 ++++++++++++++ .../com/schematic/api/AsyncBaseSchematic.java | 8 + .../com/schematic/api/core/ClientOptions.java | 4 +- .../accounts/AsyncRawAccountsClient.java | 8 + .../resources/accounts/RawAccountsClient.java | 8 + .../requests/CountAccountMembersRequest.java | 40 +- .../requests/ListAccountMembersRequest.java | 40 +- .../types/CountAccountMembersParams.java | 40 +- .../types/ListAccountMembersParams.java | 40 +- .../licenses/AsyncLicensesClient.java | 74 ++++ .../licenses/AsyncRawLicensesClient.java | 386 ++++++++++++++++++ .../resources/licenses/LicensesClient.java | 70 ++++ .../resources/licenses/RawLicensesClient.java | 306 ++++++++++++++ .../requests/CountLicensesRequest.java | 227 ++++++++++ .../requests/ListLicensesRequest.java | 227 ++++++++++ .../licenses/types/CountLicensesParams.java | 216 ++++++++++ .../licenses/types/CountLicensesResponse.java | 152 +++++++ .../types/GetSingleLicenseResponse.java | 181 ++++++++ .../licenses/types/ListLicensesParams.java | 216 ++++++++++ .../licenses/types/ListLicensesResponse.java | 174 ++++++++ .../AsyncPlanmigrationsClient.java | 11 + .../AsyncRawPlanmigrationsClient.java | 107 +++++ .../planmigrations/PlanmigrationsClient.java | 11 + .../RawPlanmigrationsClient.java | 82 ++++ .../requests/PreviewMigrationRequestBody.java | 216 ++++++++++ .../types/PreviewMigrationResponse.java | 183 +++++++++ .../BillingCreditGrantZeroedOutReason.java | 11 + .../api/types/FeatureDetailResponseData.java | 139 ++++++- .../api/types/FeatureInPlanResponseData.java | 94 ++++- .../api/types/FeatureResponseData.java | 94 ++++- .../com/schematic/api/types/FeatureType.java | 10 + .../com/schematic/api/types/FeatureView.java | 64 +++ .../api/types/LicenseResponseData.java | 193 +++++++++ ...onMigrationPreviewCompanyResponseData.java | 273 +++++++++++++ ...anVersionMigrationPreviewResponseData.java | 118 ++++++ 37 files changed, 4311 insertions(+), 25 deletions(-) create mode 100644 src/main/java/com/schematic/api/resources/licenses/AsyncLicensesClient.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/AsyncRawLicensesClient.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/LicensesClient.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/RawLicensesClient.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/requests/CountLicensesRequest.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/requests/ListLicensesRequest.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/types/CountLicensesParams.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/types/CountLicensesResponse.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/types/GetSingleLicenseResponse.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/types/ListLicensesParams.java create mode 100644 src/main/java/com/schematic/api/resources/licenses/types/ListLicensesResponse.java create mode 100644 src/main/java/com/schematic/api/resources/planmigrations/requests/PreviewMigrationRequestBody.java create mode 100644 src/main/java/com/schematic/api/resources/planmigrations/types/PreviewMigrationResponse.java create mode 100644 src/main/java/com/schematic/api/types/LicenseResponseData.java create mode 100644 src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewCompanyResponseData.java create mode 100644 src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewResponseData.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 68b76a32..5ee5cee3 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -14,10 +14,10 @@ "implementation redis.clients:jedis:5.2.0" ] }, - "originGitCommit": "75191b40ce7af084ca4fb11f623ab59c57cf97e3", + "originGitCommit": "340529eacf4f1dcc5522e771872c1dd94b9c4891", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "1.5.2", + "requestedVersion": "1.5.3", "ciProvider": "github", - "sdkVersion": "1.5.2" + "sdkVersion": "1.5.3" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1307bd8f..a292004d 100644 --- a/build.gradle +++ b/build.gradle @@ -62,7 +62,7 @@ java { group = 'com.schematichq' -version = '1.5.2' +version = '1.5.3' jar { dependsOn(":generatePomFileForMavenPublication") @@ -93,7 +93,7 @@ publishing { maven(MavenPublication) { groupId = 'com.schematichq' artifactId = 'schematic-java' - version = '1.5.2' + version = '1.5.3' from components.java pom { name = 'Schematic' diff --git a/reference.md b/reference.md index 2d2fd29f..d28f526b 100644 --- a/reference.md +++ b/reference.md @@ -45,6 +45,7 @@ client.accounts().listAccountMembers( Arrays.asList("ids") ) .q("q") + .role(AccountMemberRole.ADMIN) .limit(1000000L) .offset(1000000L) .build() @@ -79,6 +80,14 @@ client.accounts().listAccountMembers(
+**role:** `Optional` — Filter by member role + +
+
+ +
+
+ **limit:** `Optional` — Page limit (default 100)
@@ -159,6 +168,7 @@ client.accounts().countAccountMembers( Arrays.asList("ids") ) .q("q") + .role(AccountMemberRole.ADMIN) .limit(1000000L) .offset(1000000L) .build() @@ -193,6 +203,14 @@ client.accounts().countAccountMembers(
+**role:** `Optional` — Filter by member role + +
+
+ +
+
+ **limit:** `Optional` — Page limit (default 100)
@@ -17547,6 +17565,217 @@ client.integrationsapi().uninstallIntegration("integration_id");
+ +
+ + +## licenses +
client.licenses.listLicenses() -> ListLicensesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.licenses().listLicenses( + ListLicensesRequest + .builder() + .featureIds( + Arrays.asList("feature_ids") + ) + .ids( + Arrays.asList("ids") + ) + .name("name") + .limit(1000000L) + .offset(1000000L) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**featureIds:** `Optional` + +
+
+ +
+
+ +**ids:** `Optional` + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**limit:** `Optional` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `Optional` — Page offset (default 0) + +
+
+
+
+ + +
+
+
+ +
client.licenses.getSingleLicense(licenseId) -> GetSingleLicenseResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.licenses().getSingleLicense("license_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**licenseId:** `String` — license_id + +
+
+
+
+ + +
+
+
+ +
client.licenses.countLicenses() -> CountLicensesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.licenses().countLicenses( + CountLicensesRequest + .builder() + .featureIds( + Arrays.asList("feature_ids") + ) + .ids( + Arrays.asList("ids") + ) + .name("name") + .limit(1000000L) + .offset(1000000L) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**featureIds:** `Optional` + +
+
+ +
+
+ +**ids:** `Optional` + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**limit:** `Optional` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `Optional` — Page offset (default 0) + +
+
+
+
+ +
@@ -18882,6 +19111,80 @@ client.planmigrations().countMigrations( + + + + +
client.planmigrations.previewMigration(request) -> PreviewMigrationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.planmigrations().previewMigration( + PreviewMigrationRequestBody + .builder() + .planId("plan_id") + .planVersionIdTo("plan_version_id_to") + .targetPlanType(PlanType.PLAN) + .companyIds( + Arrays.asList("company_ids") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyIds:** `List` + +
+
+ +
+
+ +**planId:** `String` + +
+
+ +
+
+ +**planVersionIdTo:** `String` + +
+
+ +
+
+ +**targetPlanType:** `PlanType` + +
+
+
+
+ +
diff --git a/src/main/java/com/schematic/api/AsyncBaseSchematic.java b/src/main/java/com/schematic/api/AsyncBaseSchematic.java index fada1c1a..7a7774db 100644 --- a/src/main/java/com/schematic/api/AsyncBaseSchematic.java +++ b/src/main/java/com/schematic/api/AsyncBaseSchematic.java @@ -21,6 +21,7 @@ import com.schematic.api.resources.features.AsyncFeaturesClient; import com.schematic.api.resources.insights.AsyncInsightsClient; import com.schematic.api.resources.integrationsapi.AsyncIntegrationsapiClient; +import com.schematic.api.resources.licenses.AsyncLicensesClient; import com.schematic.api.resources.planbundle.AsyncPlanbundleClient; import com.schematic.api.resources.plangroups.AsyncPlangroupsClient; import com.schematic.api.resources.planmigrations.AsyncPlanmigrationsClient; @@ -65,6 +66,8 @@ public class AsyncBaseSchematic { protected final Supplier integrationsapiClient; + protected final Supplier licensesClient; + protected final Supplier plangroupsClient; protected final Supplier planmigrationsClient; @@ -95,6 +98,7 @@ public AsyncBaseSchematic(ClientOptions clientOptions) { this.featuresClient = Suppliers.memoize(() -> new AsyncFeaturesClient(clientOptions)); this.insightsClient = Suppliers.memoize(() -> new AsyncInsightsClient(clientOptions)); this.integrationsapiClient = Suppliers.memoize(() -> new AsyncIntegrationsapiClient(clientOptions)); + this.licensesClient = Suppliers.memoize(() -> new AsyncLicensesClient(clientOptions)); this.plangroupsClient = Suppliers.memoize(() -> new AsyncPlangroupsClient(clientOptions)); this.planmigrationsClient = Suppliers.memoize(() -> new AsyncPlanmigrationsClient(clientOptions)); this.componentspublicClient = Suppliers.memoize(() -> new AsyncComponentspublicClient(clientOptions)); @@ -178,6 +182,10 @@ public AsyncIntegrationsapiClient integrationsapi() { return this.integrationsapiClient.get(); } + public AsyncLicensesClient licenses() { + return this.licensesClient.get(); + } + public AsyncPlangroupsClient plangroups() { return this.plangroupsClient.get(); } diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java index d48b7c89..d3dc508d 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.5.2"); + put("User-Agent", "com.schematichq:schematic-java/1.5.3"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.5.2"); + put("X-Fern-SDK-Version", "1.5.3"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java b/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java index 1fc9b4d9..a0ed7419 100644 --- a/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java +++ b/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java @@ -91,6 +91,10 @@ public CompletableFuture> if (request.getQ().isPresent()) { QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); } + if (request.getRole().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "role", request.getRole().get(), false); + } if (request.getLimit().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "limit", request.getLimit().get(), false); @@ -305,6 +309,10 @@ public CompletableFuture> if (request.getQ().isPresent()) { QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); } + if (request.getRole().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "role", request.getRole().get(), false); + } if (request.getLimit().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "limit", request.getLimit().get(), false); diff --git a/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java b/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java index b91959d6..5f46f468 100644 --- a/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java +++ b/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java @@ -85,6 +85,10 @@ public BaseSchematicHttpResponse listAccountMembers( if (request.getQ().isPresent()) { QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); } + if (request.getRole().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "role", request.getRole().get(), false); + } if (request.getLimit().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "limit", request.getLimit().get(), false); @@ -250,6 +254,10 @@ public BaseSchematicHttpResponse countAccountMember if (request.getQ().isPresent()) { QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); } + if (request.getRole().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "role", request.getRole().get(), false); + } if (request.getLimit().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "limit", request.getLimit().get(), false); diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java index 7b8a6212..e43cac0a 100644 --- a/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java +++ b/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.AccountMemberRole; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -26,6 +27,8 @@ public final class CountAccountMembersRequest { private final Optional q; + private final Optional role; + private final Optional limit; private final Optional offset; @@ -35,11 +38,13 @@ public final class CountAccountMembersRequest { private CountAccountMembersRequest( Optional> ids, Optional q, + Optional role, Optional limit, Optional offset, Map additionalProperties) { this.ids = ids; this.q = q; + this.role = role; this.limit = limit; this.offset = offset; this.additionalProperties = additionalProperties; @@ -58,6 +63,14 @@ public Optional getQ() { return q; } + /** + * @return Filter by member role + */ + @JsonProperty("role") + public Optional getRole() { + return role; + } + /** * @return Page limit (default 100) */ @@ -86,12 +99,16 @@ public Map getAdditionalProperties() { } private boolean equalTo(CountAccountMembersRequest other) { - return ids.equals(other.ids) && q.equals(other.q) && limit.equals(other.limit) && offset.equals(other.offset); + return ids.equals(other.ids) + && q.equals(other.q) + && role.equals(other.role) + && limit.equals(other.limit) + && offset.equals(other.offset); } @java.lang.Override public int hashCode() { - return Objects.hash(this.ids, this.q, this.limit, this.offset); + return Objects.hash(this.ids, this.q, this.role, this.limit, this.offset); } @java.lang.Override @@ -109,6 +126,8 @@ public static final class Builder { private Optional q = Optional.empty(); + private Optional role = Optional.empty(); + private Optional limit = Optional.empty(); private Optional offset = Optional.empty(); @@ -121,6 +140,7 @@ private Builder() {} public Builder from(CountAccountMembersRequest other) { ids(other.getIds()); q(other.getQ()); + role(other.getRole()); limit(other.getLimit()); offset(other.getOffset()); return this; @@ -156,6 +176,20 @@ public Builder q(String q) { return this; } + /** + *

Filter by member role

+ */ + @JsonSetter(value = "role", nulls = Nulls.SKIP) + public Builder role(Optional role) { + this.role = role; + return this; + } + + public Builder role(AccountMemberRole role) { + this.role = Optional.ofNullable(role); + return this; + } + /** *

Page limit (default 100)

*/ @@ -185,7 +219,7 @@ public Builder offset(Long offset) { } public CountAccountMembersRequest build() { - return new CountAccountMembersRequest(ids, q, limit, offset, additionalProperties); + return new CountAccountMembersRequest(ids, q, role, limit, offset, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java index 10a0328f..e17b7512 100644 --- a/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java +++ b/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.AccountMemberRole; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -26,6 +27,8 @@ public final class ListAccountMembersRequest { private final Optional q; + private final Optional role; + private final Optional limit; private final Optional offset; @@ -35,11 +38,13 @@ public final class ListAccountMembersRequest { private ListAccountMembersRequest( Optional> ids, Optional q, + Optional role, Optional limit, Optional offset, Map additionalProperties) { this.ids = ids; this.q = q; + this.role = role; this.limit = limit; this.offset = offset; this.additionalProperties = additionalProperties; @@ -58,6 +63,14 @@ public Optional getQ() { return q; } + /** + * @return Filter by member role + */ + @JsonProperty("role") + public Optional getRole() { + return role; + } + /** * @return Page limit (default 100) */ @@ -86,12 +99,16 @@ public Map getAdditionalProperties() { } private boolean equalTo(ListAccountMembersRequest other) { - return ids.equals(other.ids) && q.equals(other.q) && limit.equals(other.limit) && offset.equals(other.offset); + return ids.equals(other.ids) + && q.equals(other.q) + && role.equals(other.role) + && limit.equals(other.limit) + && offset.equals(other.offset); } @java.lang.Override public int hashCode() { - return Objects.hash(this.ids, this.q, this.limit, this.offset); + return Objects.hash(this.ids, this.q, this.role, this.limit, this.offset); } @java.lang.Override @@ -109,6 +126,8 @@ public static final class Builder { private Optional q = Optional.empty(); + private Optional role = Optional.empty(); + private Optional limit = Optional.empty(); private Optional offset = Optional.empty(); @@ -121,6 +140,7 @@ private Builder() {} public Builder from(ListAccountMembersRequest other) { ids(other.getIds()); q(other.getQ()); + role(other.getRole()); limit(other.getLimit()); offset(other.getOffset()); return this; @@ -156,6 +176,20 @@ public Builder q(String q) { return this; } + /** + *

Filter by member role

+ */ + @JsonSetter(value = "role", nulls = Nulls.SKIP) + public Builder role(Optional role) { + this.role = role; + return this; + } + + public Builder role(AccountMemberRole role) { + this.role = Optional.ofNullable(role); + return this; + } + /** *

Page limit (default 100)

*/ @@ -185,7 +219,7 @@ public Builder offset(Long offset) { } public ListAccountMembersRequest build() { - return new ListAccountMembersRequest(ids, q, limit, offset, additionalProperties); + return new ListAccountMembersRequest(ids, q, role, limit, offset, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java index 4981fc50..bddf655a 100644 --- a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java +++ b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.AccountMemberRole; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -29,6 +30,8 @@ public final class CountAccountMembersParams { private final Optional q; + private final Optional role; + private final Map additionalProperties; private CountAccountMembersParams( @@ -36,11 +39,13 @@ private CountAccountMembersParams( Optional limit, Optional offset, Optional q, + Optional role, Map additionalProperties) { this.ids = ids; this.limit = limit; this.offset = offset; this.q = q; + this.role = role; this.additionalProperties = additionalProperties; } @@ -73,6 +78,14 @@ public Optional getQ() { return q; } + /** + * @return Filter by member role + */ + @JsonProperty("role") + public Optional getRole() { + return role; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -85,12 +98,16 @@ public Map getAdditionalProperties() { } private boolean equalTo(CountAccountMembersParams other) { - return ids.equals(other.ids) && limit.equals(other.limit) && offset.equals(other.offset) && q.equals(other.q); + return ids.equals(other.ids) + && limit.equals(other.limit) + && offset.equals(other.offset) + && q.equals(other.q) + && role.equals(other.role); } @java.lang.Override public int hashCode() { - return Objects.hash(this.ids, this.limit, this.offset, this.q); + return Objects.hash(this.ids, this.limit, this.offset, this.q, this.role); } @java.lang.Override @@ -112,6 +129,8 @@ public static final class Builder { private Optional q = Optional.empty(); + private Optional role = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -122,6 +141,7 @@ public Builder from(CountAccountMembersParams other) { limit(other.getLimit()); offset(other.getOffset()); q(other.getQ()); + role(other.getRole()); return this; } @@ -178,8 +198,22 @@ public Builder q(String q) { return this; } + /** + *

Filter by member role

+ */ + @JsonSetter(value = "role", nulls = Nulls.SKIP) + public Builder role(Optional role) { + this.role = role; + return this; + } + + public Builder role(AccountMemberRole role) { + this.role = Optional.ofNullable(role); + return this; + } + public CountAccountMembersParams build() { - return new CountAccountMembersParams(ids, limit, offset, q, additionalProperties); + return new CountAccountMembersParams(ids, limit, offset, q, role, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java index 42e47f14..286b24ad 100644 --- a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java +++ b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.AccountMemberRole; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -29,6 +30,8 @@ public final class ListAccountMembersParams { private final Optional q; + private final Optional role; + private final Map additionalProperties; private ListAccountMembersParams( @@ -36,11 +39,13 @@ private ListAccountMembersParams( Optional limit, Optional offset, Optional q, + Optional role, Map additionalProperties) { this.ids = ids; this.limit = limit; this.offset = offset; this.q = q; + this.role = role; this.additionalProperties = additionalProperties; } @@ -73,6 +78,14 @@ public Optional getQ() { return q; } + /** + * @return Filter by member role + */ + @JsonProperty("role") + public Optional getRole() { + return role; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -85,12 +98,16 @@ public Map getAdditionalProperties() { } private boolean equalTo(ListAccountMembersParams other) { - return ids.equals(other.ids) && limit.equals(other.limit) && offset.equals(other.offset) && q.equals(other.q); + return ids.equals(other.ids) + && limit.equals(other.limit) + && offset.equals(other.offset) + && q.equals(other.q) + && role.equals(other.role); } @java.lang.Override public int hashCode() { - return Objects.hash(this.ids, this.limit, this.offset, this.q); + return Objects.hash(this.ids, this.limit, this.offset, this.q, this.role); } @java.lang.Override @@ -112,6 +129,8 @@ public static final class Builder { private Optional q = Optional.empty(); + private Optional role = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -122,6 +141,7 @@ public Builder from(ListAccountMembersParams other) { limit(other.getLimit()); offset(other.getOffset()); q(other.getQ()); + role(other.getRole()); return this; } @@ -178,8 +198,22 @@ public Builder q(String q) { return this; } + /** + *

Filter by member role

+ */ + @JsonSetter(value = "role", nulls = Nulls.SKIP) + public Builder role(Optional role) { + this.role = role; + return this; + } + + public Builder role(AccountMemberRole role) { + this.role = Optional.ofNullable(role); + return this; + } + public ListAccountMembersParams build() { - return new ListAccountMembersParams(ids, limit, offset, q, additionalProperties); + return new ListAccountMembersParams(ids, limit, offset, q, role, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/schematic/api/resources/licenses/AsyncLicensesClient.java b/src/main/java/com/schematic/api/resources/licenses/AsyncLicensesClient.java new file mode 100644 index 00000000..08a058c4 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/AsyncLicensesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses; + +import com.schematic.api.core.ClientOptions; +import com.schematic.api.core.RequestOptions; +import com.schematic.api.resources.licenses.requests.CountLicensesRequest; +import com.schematic.api.resources.licenses.requests.ListLicensesRequest; +import com.schematic.api.resources.licenses.types.CountLicensesResponse; +import com.schematic.api.resources.licenses.types.GetSingleLicenseResponse; +import com.schematic.api.resources.licenses.types.ListLicensesResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncLicensesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLicensesClient rawClient; + + public AsyncLicensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLicensesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLicensesClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture listLicenses() { + return this.rawClient.listLicenses().thenApply(response -> response.body()); + } + + public CompletableFuture listLicenses(RequestOptions requestOptions) { + return this.rawClient.listLicenses(requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture listLicenses(ListLicensesRequest request) { + return this.rawClient.listLicenses(request).thenApply(response -> response.body()); + } + + public CompletableFuture listLicenses( + ListLicensesRequest request, RequestOptions requestOptions) { + return this.rawClient.listLicenses(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture getSingleLicense(String licenseId) { + return this.rawClient.getSingleLicense(licenseId).thenApply(response -> response.body()); + } + + public CompletableFuture getSingleLicense( + String licenseId, RequestOptions requestOptions) { + return this.rawClient.getSingleLicense(licenseId, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture countLicenses() { + return this.rawClient.countLicenses().thenApply(response -> response.body()); + } + + public CompletableFuture countLicenses(RequestOptions requestOptions) { + return this.rawClient.countLicenses(requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture countLicenses(CountLicensesRequest request) { + return this.rawClient.countLicenses(request).thenApply(response -> response.body()); + } + + public CompletableFuture countLicenses( + CountLicensesRequest request, RequestOptions requestOptions) { + return this.rawClient.countLicenses(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/schematic/api/resources/licenses/AsyncRawLicensesClient.java b/src/main/java/com/schematic/api/resources/licenses/AsyncRawLicensesClient.java new file mode 100644 index 00000000..6edf0950 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/AsyncRawLicensesClient.java @@ -0,0 +1,386 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.schematic.api.core.BaseSchematicApiException; +import com.schematic.api.core.BaseSchematicException; +import com.schematic.api.core.BaseSchematicHttpResponse; +import com.schematic.api.core.ClientOptions; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.core.QueryStringMapper; +import com.schematic.api.core.RequestOptions; +import com.schematic.api.core.RetryInterceptor; +import com.schematic.api.errors.BadRequestError; +import com.schematic.api.errors.ForbiddenError; +import com.schematic.api.errors.InternalServerError; +import com.schematic.api.errors.NotFoundError; +import com.schematic.api.errors.UnauthorizedError; +import com.schematic.api.resources.licenses.requests.CountLicensesRequest; +import com.schematic.api.resources.licenses.requests.ListLicensesRequest; +import com.schematic.api.resources.licenses.types.CountLicensesResponse; +import com.schematic.api.resources.licenses.types.GetSingleLicenseResponse; +import com.schematic.api.resources.licenses.types.ListLicensesResponse; +import com.schematic.api.types.ApiError; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLicensesClient { + protected final ClientOptions clientOptions; + + public AsyncRawLicensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture> listLicenses() { + return listLicenses(ListLicensesRequest.builder().build()); + } + + public CompletableFuture> listLicenses( + RequestOptions requestOptions) { + return listLicenses(ListLicensesRequest.builder().build(), requestOptions); + } + + public CompletableFuture> listLicenses( + ListLicensesRequest request) { + return listLicenses(request, null); + } + + public CompletableFuture> listLicenses( + ListLicensesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("licenses"); + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getOffset().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offset", request.getOffset().get(), false); + } + if (request.getFeatureIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "feature_ids", request.getFeatureIds().get(), true); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), true); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, ListLicensesResponse.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 (JsonProcessingException e) { + future.completeExceptionally( + new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e)); + } 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> getSingleLicense(String licenseId) { + return getSingleLicense(licenseId, null); + } + + public CompletableFuture> getSingleLicense( + String licenseId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("licenses") + .addPathSegment(licenseId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, GetSingleLicenseResponse.class), + response)); + return; + } + try { + switch (response.code()) { + 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 (JsonProcessingException e) { + future.completeExceptionally( + new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e)); + } 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> countLicenses() { + return countLicenses(CountLicensesRequest.builder().build()); + } + + public CompletableFuture> countLicenses( + RequestOptions requestOptions) { + return countLicenses(CountLicensesRequest.builder().build(), requestOptions); + } + + public CompletableFuture> countLicenses( + CountLicensesRequest request) { + return countLicenses(request, null); + } + + public CompletableFuture> countLicenses( + CountLicensesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("licenses/count"); + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getOffset().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offset", request.getOffset().get(), false); + } + if (request.getFeatureIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "feature_ids", request.getFeatureIds().get(), true); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), true); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, CountLicensesResponse.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 (JsonProcessingException e) { + future.completeExceptionally( + new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/schematic/api/resources/licenses/LicensesClient.java b/src/main/java/com/schematic/api/resources/licenses/LicensesClient.java new file mode 100644 index 00000000..180a9083 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/LicensesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses; + +import com.schematic.api.core.ClientOptions; +import com.schematic.api.core.RequestOptions; +import com.schematic.api.resources.licenses.requests.CountLicensesRequest; +import com.schematic.api.resources.licenses.requests.ListLicensesRequest; +import com.schematic.api.resources.licenses.types.CountLicensesResponse; +import com.schematic.api.resources.licenses.types.GetSingleLicenseResponse; +import com.schematic.api.resources.licenses.types.ListLicensesResponse; + +public class LicensesClient { + protected final ClientOptions clientOptions; + + private final RawLicensesClient rawClient; + + public LicensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLicensesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLicensesClient withRawResponse() { + return this.rawClient; + } + + public ListLicensesResponse listLicenses() { + return this.rawClient.listLicenses().body(); + } + + public ListLicensesResponse listLicenses(RequestOptions requestOptions) { + return this.rawClient.listLicenses(requestOptions).body(); + } + + public ListLicensesResponse listLicenses(ListLicensesRequest request) { + return this.rawClient.listLicenses(request).body(); + } + + public ListLicensesResponse listLicenses(ListLicensesRequest request, RequestOptions requestOptions) { + return this.rawClient.listLicenses(request, requestOptions).body(); + } + + public GetSingleLicenseResponse getSingleLicense(String licenseId) { + return this.rawClient.getSingleLicense(licenseId).body(); + } + + public GetSingleLicenseResponse getSingleLicense(String licenseId, RequestOptions requestOptions) { + return this.rawClient.getSingleLicense(licenseId, requestOptions).body(); + } + + public CountLicensesResponse countLicenses() { + return this.rawClient.countLicenses().body(); + } + + public CountLicensesResponse countLicenses(RequestOptions requestOptions) { + return this.rawClient.countLicenses(requestOptions).body(); + } + + public CountLicensesResponse countLicenses(CountLicensesRequest request) { + return this.rawClient.countLicenses(request).body(); + } + + public CountLicensesResponse countLicenses(CountLicensesRequest request, RequestOptions requestOptions) { + return this.rawClient.countLicenses(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/schematic/api/resources/licenses/RawLicensesClient.java b/src/main/java/com/schematic/api/resources/licenses/RawLicensesClient.java new file mode 100644 index 00000000..03ab6d26 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/RawLicensesClient.java @@ -0,0 +1,306 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.schematic.api.core.BaseSchematicApiException; +import com.schematic.api.core.BaseSchematicException; +import com.schematic.api.core.BaseSchematicHttpResponse; +import com.schematic.api.core.ClientOptions; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.core.QueryStringMapper; +import com.schematic.api.core.RequestOptions; +import com.schematic.api.core.RetryInterceptor; +import com.schematic.api.errors.BadRequestError; +import com.schematic.api.errors.ForbiddenError; +import com.schematic.api.errors.InternalServerError; +import com.schematic.api.errors.NotFoundError; +import com.schematic.api.errors.UnauthorizedError; +import com.schematic.api.resources.licenses.requests.CountLicensesRequest; +import com.schematic.api.resources.licenses.requests.ListLicensesRequest; +import com.schematic.api.resources.licenses.types.CountLicensesResponse; +import com.schematic.api.resources.licenses.types.GetSingleLicenseResponse; +import com.schematic.api.resources.licenses.types.ListLicensesResponse; +import com.schematic.api.types.ApiError; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLicensesClient { + protected final ClientOptions clientOptions; + + public RawLicensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public BaseSchematicHttpResponse listLicenses() { + return listLicenses(ListLicensesRequest.builder().build()); + } + + public BaseSchematicHttpResponse listLicenses(RequestOptions requestOptions) { + return listLicenses(ListLicensesRequest.builder().build(), requestOptions); + } + + public BaseSchematicHttpResponse listLicenses(ListLicensesRequest request) { + return listLicenses(request, null); + } + + public BaseSchematicHttpResponse listLicenses( + ListLicensesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("licenses"); + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getOffset().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offset", request.getOffset().get(), false); + } + if (request.getFeatureIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "feature_ids", request.getFeatureIds().get(), true); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), true); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, ListLicensesResponse.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 (JsonProcessingException e) { + throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } + + public BaseSchematicHttpResponse getSingleLicense(String licenseId) { + return getSingleLicense(licenseId, null); + } + + public BaseSchematicHttpResponse getSingleLicense( + String licenseId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("licenses") + .addPathSegment(licenseId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, GetSingleLicenseResponse.class), + response); + } + try { + switch (response.code()) { + 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 (JsonProcessingException e) { + throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } + + public BaseSchematicHttpResponse countLicenses() { + return countLicenses(CountLicensesRequest.builder().build()); + } + + public BaseSchematicHttpResponse countLicenses(RequestOptions requestOptions) { + return countLicenses(CountLicensesRequest.builder().build(), requestOptions); + } + + public BaseSchematicHttpResponse countLicenses(CountLicensesRequest request) { + return countLicenses(request, null); + } + + public BaseSchematicHttpResponse countLicenses( + CountLicensesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("licenses/count"); + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getOffset().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offset", request.getOffset().get(), false); + } + if (request.getFeatureIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "feature_ids", request.getFeatureIds().get(), true); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), true); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, CountLicensesResponse.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 (JsonProcessingException e) { + throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/schematic/api/resources/licenses/requests/CountLicensesRequest.java b/src/main/java/com/schematic/api/resources/licenses/requests/CountLicensesRequest.java new file mode 100644 index 00000000..309f2e35 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/requests/CountLicensesRequest.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses.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 java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CountLicensesRequest.Builder.class) +public final class CountLicensesRequest { + private final Optional> featureIds; + + private final Optional> ids; + + private final Optional name; + + private final Optional limit; + + private final Optional offset; + + private final Map additionalProperties; + + private CountLicensesRequest( + Optional> featureIds, + Optional> ids, + Optional name, + Optional limit, + Optional offset, + Map additionalProperties) { + this.featureIds = featureIds; + this.ids = ids; + this.name = name; + this.limit = limit; + this.offset = offset; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("feature_ids") + public Optional> getFeatureIds() { + return featureIds; + } + + @JsonProperty("ids") + public Optional> getIds() { + return ids; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Page limit (default 100) + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return Page offset (default 0) + */ + @JsonProperty("offset") + public Optional getOffset() { + return offset; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CountLicensesRequest && equalTo((CountLicensesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CountLicensesRequest other) { + return featureIds.equals(other.featureIds) + && ids.equals(other.ids) + && name.equals(other.name) + && limit.equals(other.limit) + && offset.equals(other.offset); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.featureIds, this.ids, this.name, this.limit, this.offset); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> featureIds = Optional.empty(); + + private Optional> ids = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional offset = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CountLicensesRequest other) { + featureIds(other.getFeatureIds()); + ids(other.getIds()); + name(other.getName()); + limit(other.getLimit()); + offset(other.getOffset()); + return this; + } + + @JsonSetter(value = "feature_ids", nulls = Nulls.SKIP) + public Builder featureIds(Optional> featureIds) { + this.featureIds = featureIds; + return this; + } + + public Builder featureIds(List featureIds) { + this.featureIds = Optional.ofNullable(featureIds); + return this; + } + + public Builder featureIds(String featureIds) { + this.featureIds = Optional.of(Collections.singletonList(featureIds)); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional> ids) { + this.ids = ids; + return this; + } + + public Builder ids(List ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.of(Collections.singletonList(ids)); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Page limit (default 100)

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

Page offset (default 0)

+ */ + @JsonSetter(value = "offset", nulls = Nulls.SKIP) + public Builder offset(Optional offset) { + this.offset = offset; + return this; + } + + public Builder offset(Long offset) { + this.offset = Optional.ofNullable(offset); + return this; + } + + public CountLicensesRequest build() { + return new CountLicensesRequest(featureIds, ids, name, limit, offset, 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/licenses/requests/ListLicensesRequest.java b/src/main/java/com/schematic/api/resources/licenses/requests/ListLicensesRequest.java new file mode 100644 index 00000000..df697e68 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/requests/ListLicensesRequest.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses.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 java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListLicensesRequest.Builder.class) +public final class ListLicensesRequest { + private final Optional> featureIds; + + private final Optional> ids; + + private final Optional name; + + private final Optional limit; + + private final Optional offset; + + private final Map additionalProperties; + + private ListLicensesRequest( + Optional> featureIds, + Optional> ids, + Optional name, + Optional limit, + Optional offset, + Map additionalProperties) { + this.featureIds = featureIds; + this.ids = ids; + this.name = name; + this.limit = limit; + this.offset = offset; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("feature_ids") + public Optional> getFeatureIds() { + return featureIds; + } + + @JsonProperty("ids") + public Optional> getIds() { + return ids; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Page limit (default 100) + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return Page offset (default 0) + */ + @JsonProperty("offset") + public Optional getOffset() { + return offset; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListLicensesRequest && equalTo((ListLicensesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListLicensesRequest other) { + return featureIds.equals(other.featureIds) + && ids.equals(other.ids) + && name.equals(other.name) + && limit.equals(other.limit) + && offset.equals(other.offset); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.featureIds, this.ids, this.name, this.limit, this.offset); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> featureIds = Optional.empty(); + + private Optional> ids = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional offset = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListLicensesRequest other) { + featureIds(other.getFeatureIds()); + ids(other.getIds()); + name(other.getName()); + limit(other.getLimit()); + offset(other.getOffset()); + return this; + } + + @JsonSetter(value = "feature_ids", nulls = Nulls.SKIP) + public Builder featureIds(Optional> featureIds) { + this.featureIds = featureIds; + return this; + } + + public Builder featureIds(List featureIds) { + this.featureIds = Optional.ofNullable(featureIds); + return this; + } + + public Builder featureIds(String featureIds) { + this.featureIds = Optional.of(Collections.singletonList(featureIds)); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional> ids) { + this.ids = ids; + return this; + } + + public Builder ids(List ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.of(Collections.singletonList(ids)); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Page limit (default 100)

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

Page offset (default 0)

+ */ + @JsonSetter(value = "offset", nulls = Nulls.SKIP) + public Builder offset(Optional offset) { + this.offset = offset; + return this; + } + + public Builder offset(Long offset) { + this.offset = Optional.ofNullable(offset); + return this; + } + + public ListLicensesRequest build() { + return new ListLicensesRequest(featureIds, ids, name, limit, offset, 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/licenses/types/CountLicensesParams.java b/src/main/java/com/schematic/api/resources/licenses/types/CountLicensesParams.java new file mode 100644 index 00000000..a1280613 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/types/CountLicensesParams.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CountLicensesParams.Builder.class) +public final class CountLicensesParams { + private final Optional> featureIds; + + private final Optional> ids; + + private final Optional limit; + + private final Optional name; + + private final Optional offset; + + private final Map additionalProperties; + + private CountLicensesParams( + Optional> featureIds, + Optional> ids, + Optional limit, + Optional name, + Optional offset, + Map additionalProperties) { + this.featureIds = featureIds; + this.ids = ids; + this.limit = limit; + this.name = name; + this.offset = offset; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("feature_ids") + public Optional> getFeatureIds() { + return featureIds; + } + + @JsonProperty("ids") + public Optional> getIds() { + return ids; + } + + /** + * @return Page limit (default 100) + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Page offset (default 0) + */ + @JsonProperty("offset") + public Optional getOffset() { + return offset; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CountLicensesParams && equalTo((CountLicensesParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CountLicensesParams other) { + return featureIds.equals(other.featureIds) + && ids.equals(other.ids) + && limit.equals(other.limit) + && name.equals(other.name) + && offset.equals(other.offset); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.featureIds, this.ids, this.limit, this.name, this.offset); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> featureIds = Optional.empty(); + + private Optional> ids = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional offset = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CountLicensesParams other) { + featureIds(other.getFeatureIds()); + ids(other.getIds()); + limit(other.getLimit()); + name(other.getName()); + offset(other.getOffset()); + return this; + } + + @JsonSetter(value = "feature_ids", nulls = Nulls.SKIP) + public Builder featureIds(Optional> featureIds) { + this.featureIds = featureIds; + return this; + } + + public Builder featureIds(List featureIds) { + this.featureIds = Optional.ofNullable(featureIds); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional> ids) { + this.ids = ids; + return this; + } + + public Builder ids(List ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + /** + *

Page limit (default 100)

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

Page offset (default 0)

+ */ + @JsonSetter(value = "offset", nulls = Nulls.SKIP) + public Builder offset(Optional offset) { + this.offset = offset; + return this; + } + + public Builder offset(Long offset) { + this.offset = Optional.ofNullable(offset); + return this; + } + + public CountLicensesParams build() { + return new CountLicensesParams(featureIds, ids, limit, name, offset, 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/licenses/types/CountLicensesResponse.java b/src/main/java/com/schematic/api/resources/licenses/types/CountLicensesResponse.java new file mode 100644 index 00000000..24d389d9 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/types/CountLicensesResponse.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.CountResponse; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CountLicensesResponse.Builder.class) +public final class CountLicensesResponse { + private final CountResponse data; + + private final CountLicensesParams params; + + private final Map additionalProperties; + + private CountLicensesResponse( + CountResponse data, CountLicensesParams params, Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public CountResponse getData() { + return data; + } + + /** + * @return Input parameters + */ + @JsonProperty("params") + public CountLicensesParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CountLicensesResponse && equalTo((CountLicensesResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CountLicensesResponse other) { + return data.equals(other.data) && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.data, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DataStage builder() { + return new Builder(); + } + + public interface DataStage { + ParamsStage data(@NotNull CountResponse data); + + Builder from(CountLicensesResponse other); + } + + public interface ParamsStage { + /** + *

Input parameters

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

Input parameters

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull CountLicensesParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public CountLicensesResponse build() { + return new CountLicensesResponse(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/licenses/types/GetSingleLicenseResponse.java b/src/main/java/com/schematic/api/resources/licenses/types/GetSingleLicenseResponse.java new file mode 100644 index 00000000..efa52bdf --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/types/GetSingleLicenseResponse.java @@ -0,0 +1,181 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses.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.LicenseResponseData; +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 = GetSingleLicenseResponse.Builder.class) +public final class GetSingleLicenseResponse { + private final LicenseResponseData data; + + private final Map params; + + private final Map additionalProperties; + + private GetSingleLicenseResponse( + LicenseResponseData data, Map params, Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public LicenseResponseData 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 GetSingleLicenseResponse && equalTo((GetSingleLicenseResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetSingleLicenseResponse 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 LicenseResponseData data); + + Builder from(GetSingleLicenseResponse other); + } + + public interface _FinalStage { + GetSingleLicenseResponse 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 LicenseResponseData data; + + private Map params = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetSingleLicenseResponse other) { + data(other.getData()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull LicenseResponseData 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 GetSingleLicenseResponse build() { + return new GetSingleLicenseResponse(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/licenses/types/ListLicensesParams.java b/src/main/java/com/schematic/api/resources/licenses/types/ListLicensesParams.java new file mode 100644 index 00000000..6c37f406 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/types/ListLicensesParams.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListLicensesParams.Builder.class) +public final class ListLicensesParams { + private final Optional> featureIds; + + private final Optional> ids; + + private final Optional limit; + + private final Optional name; + + private final Optional offset; + + private final Map additionalProperties; + + private ListLicensesParams( + Optional> featureIds, + Optional> ids, + Optional limit, + Optional name, + Optional offset, + Map additionalProperties) { + this.featureIds = featureIds; + this.ids = ids; + this.limit = limit; + this.name = name; + this.offset = offset; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("feature_ids") + public Optional> getFeatureIds() { + return featureIds; + } + + @JsonProperty("ids") + public Optional> getIds() { + return ids; + } + + /** + * @return Page limit (default 100) + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Page offset (default 0) + */ + @JsonProperty("offset") + public Optional getOffset() { + return offset; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListLicensesParams && equalTo((ListLicensesParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListLicensesParams other) { + return featureIds.equals(other.featureIds) + && ids.equals(other.ids) + && limit.equals(other.limit) + && name.equals(other.name) + && offset.equals(other.offset); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.featureIds, this.ids, this.limit, this.name, this.offset); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> featureIds = Optional.empty(); + + private Optional> ids = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional offset = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListLicensesParams other) { + featureIds(other.getFeatureIds()); + ids(other.getIds()); + limit(other.getLimit()); + name(other.getName()); + offset(other.getOffset()); + return this; + } + + @JsonSetter(value = "feature_ids", nulls = Nulls.SKIP) + public Builder featureIds(Optional> featureIds) { + this.featureIds = featureIds; + return this; + } + + public Builder featureIds(List featureIds) { + this.featureIds = Optional.ofNullable(featureIds); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional> ids) { + this.ids = ids; + return this; + } + + public Builder ids(List ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + /** + *

Page limit (default 100)

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

Page offset (default 0)

+ */ + @JsonSetter(value = "offset", nulls = Nulls.SKIP) + public Builder offset(Optional offset) { + this.offset = offset; + return this; + } + + public Builder offset(Long offset) { + this.offset = Optional.ofNullable(offset); + return this; + } + + public ListLicensesParams build() { + return new ListLicensesParams(featureIds, ids, limit, name, offset, 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/licenses/types/ListLicensesResponse.java b/src/main/java/com/schematic/api/resources/licenses/types/ListLicensesResponse.java new file mode 100644 index 00000000..761510d8 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/licenses/types/ListLicensesResponse.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.licenses.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.LicenseResponseData; +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 = ListLicensesResponse.Builder.class) +public final class ListLicensesResponse { + private final List data; + + private final ListLicensesParams params; + + private final Map additionalProperties; + + private ListLicensesResponse( + List data, ListLicensesParams params, Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + /** + * @return Input parameters + */ + @JsonProperty("params") + public ListLicensesParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListLicensesResponse && equalTo((ListLicensesResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListLicensesResponse other) { + return data.equals(other.data) && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.data, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ParamsStage builder() { + return new Builder(); + } + + public interface ParamsStage { + /** + *

Input parameters

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

Input parameters

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull ListLicensesParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(LicenseResponseData data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public ListLicensesResponse build() { + return new ListLicensesResponse(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/AsyncPlanmigrationsClient.java b/src/main/java/com/schematic/api/resources/planmigrations/AsyncPlanmigrationsClient.java index cfb395c9..18c38ba8 100644 --- a/src/main/java/com/schematic/api/resources/planmigrations/AsyncPlanmigrationsClient.java +++ b/src/main/java/com/schematic/api/resources/planmigrations/AsyncPlanmigrationsClient.java @@ -10,6 +10,7 @@ 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.PreviewMigrationRequestBody; import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody; import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse; import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse; @@ -17,6 +18,7 @@ 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.PreviewMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse; import java.util.concurrent.CompletableFuture; @@ -153,4 +155,13 @@ public CompletableFuture countMigrations( CountMigrationsRequest request, RequestOptions requestOptions) { return this.rawClient.countMigrations(request, requestOptions).thenApply(response -> response.body()); } + + public CompletableFuture previewMigration(PreviewMigrationRequestBody request) { + return this.rawClient.previewMigration(request).thenApply(response -> response.body()); + } + + public CompletableFuture previewMigration( + PreviewMigrationRequestBody request, RequestOptions requestOptions) { + return this.rawClient.previewMigration(request, requestOptions).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 30763fdf..3bd7f090 100644 --- a/src/main/java/com/schematic/api/resources/planmigrations/AsyncRawPlanmigrationsClient.java +++ b/src/main/java/com/schematic/api/resources/planmigrations/AsyncRawPlanmigrationsClient.java @@ -23,6 +23,7 @@ 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.PreviewMigrationRequestBody; import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody; import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse; import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse; @@ -30,6 +31,7 @@ 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.PreviewMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse; import com.schematic.api.types.ApiError; @@ -953,4 +955,109 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { }); return future; } + + public CompletableFuture> previewMigration( + PreviewMigrationRequestBody request) { + return previewMigration(request, null); + } + + public CompletableFuture> previewMigration( + PreviewMigrationRequestBody request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("plan-version-migrations/preview"); + 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); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, PreviewMigrationResponse.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 (JsonProcessingException e) { + future.completeExceptionally( + new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + }); + return future; + } } diff --git a/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java b/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java index 689508bb..b5917b59 100644 --- a/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java +++ b/src/main/java/com/schematic/api/resources/planmigrations/PlanmigrationsClient.java @@ -10,6 +10,7 @@ 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.PreviewMigrationRequestBody; import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody; import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse; import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse; @@ -17,6 +18,7 @@ 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.PreviewMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse; @@ -144,4 +146,13 @@ public CountMigrationsResponse countMigrations(CountMigrationsRequest request) { public CountMigrationsResponse countMigrations(CountMigrationsRequest request, RequestOptions requestOptions) { return this.rawClient.countMigrations(request, requestOptions).body(); } + + public PreviewMigrationResponse previewMigration(PreviewMigrationRequestBody request) { + return this.rawClient.previewMigration(request).body(); + } + + public PreviewMigrationResponse previewMigration( + PreviewMigrationRequestBody request, RequestOptions requestOptions) { + return this.rawClient.previewMigration(request, requestOptions).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 58c05476..64bbeab4 100644 --- a/src/main/java/com/schematic/api/resources/planmigrations/RawPlanmigrationsClient.java +++ b/src/main/java/com/schematic/api/resources/planmigrations/RawPlanmigrationsClient.java @@ -23,6 +23,7 @@ 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.PreviewMigrationRequestBody; import com.schematic.api.resources.planmigrations.requests.RetryMigrationRequestBody; import com.schematic.api.resources.planmigrations.types.CountCompanyMigrationsResponse; import com.schematic.api.resources.planmigrations.types.CountMigrationsResponse; @@ -30,6 +31,7 @@ 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.PreviewMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryCompanyMigrationResponse; import com.schematic.api.resources.planmigrations.types.RetryMigrationResponse; import com.schematic.api.types.ApiError; @@ -749,4 +751,84 @@ public BaseSchematicHttpResponse countMigrations( throw new BaseSchematicException("Network error executing HTTP request", e); } } + + public BaseSchematicHttpResponse previewMigration(PreviewMigrationRequestBody request) { + return previewMigration(request, null); + } + + public BaseSchematicHttpResponse previewMigration( + PreviewMigrationRequestBody request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("plan-version-migrations/preview"); + 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); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, PreviewMigrationResponse.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 (JsonProcessingException e) { + throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } } diff --git a/src/main/java/com/schematic/api/resources/planmigrations/requests/PreviewMigrationRequestBody.java b/src/main/java/com/schematic/api/resources/planmigrations/requests/PreviewMigrationRequestBody.java new file mode 100644 index 00000000..0ab803ee --- /dev/null +++ b/src/main/java/com/schematic/api/resources/planmigrations/requests/PreviewMigrationRequestBody.java @@ -0,0 +1,216 @@ +/** + * 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 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 = PreviewMigrationRequestBody.Builder.class) +public final class PreviewMigrationRequestBody { + private final List companyIds; + + private final String planId; + + private final String planVersionIdTo; + + private final PlanType targetPlanType; + + private final Map additionalProperties; + + private PreviewMigrationRequestBody( + List companyIds, + String planId, + String planVersionIdTo, + PlanType targetPlanType, + Map additionalProperties) { + this.companyIds = companyIds; + this.planId = planId; + this.planVersionIdTo = planVersionIdTo; + this.targetPlanType = targetPlanType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("company_ids") + public List getCompanyIds() { + return companyIds; + } + + @JsonProperty("plan_id") + public String getPlanId() { + return planId; + } + + @JsonProperty("plan_version_id_to") + public String getPlanVersionIdTo() { + return planVersionIdTo; + } + + @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 PreviewMigrationRequestBody && equalTo((PreviewMigrationRequestBody) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PreviewMigrationRequestBody other) { + return companyIds.equals(other.companyIds) + && planId.equals(other.planId) + && planVersionIdTo.equals(other.planVersionIdTo) + && targetPlanType.equals(other.targetPlanType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.companyIds, this.planId, this.planVersionIdTo, 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(PreviewMigrationRequestBody other); + } + + public interface PlanVersionIdToStage { + TargetPlanTypeStage planVersionIdTo(@NotNull String planVersionIdTo); + } + + public interface TargetPlanTypeStage { + _FinalStage targetPlanType(@NotNull PlanType targetPlanType); + } + + public interface _FinalStage { + PreviewMigrationRequestBody build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage companyIds(List companyIds); + + _FinalStage addCompanyIds(String companyIds); + + _FinalStage addAllCompanyIds(List companyIds); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PlanIdStage, PlanVersionIdToStage, TargetPlanTypeStage, _FinalStage { + private String planId; + + private String planVersionIdTo; + + private PlanType targetPlanType; + + private List companyIds = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PreviewMigrationRequestBody other) { + companyIds(other.getCompanyIds()); + planId(other.getPlanId()); + planVersionIdTo(other.getPlanVersionIdTo()); + 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 TargetPlanTypeStage planVersionIdTo(@NotNull String planVersionIdTo) { + this.planVersionIdTo = Objects.requireNonNull(planVersionIdTo, "planVersionIdTo 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 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 PreviewMigrationRequestBody build() { + return new PreviewMigrationRequestBody( + companyIds, planId, planVersionIdTo, 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/types/PreviewMigrationResponse.java b/src/main/java/com/schematic/api/resources/planmigrations/types/PreviewMigrationResponse.java new file mode 100644 index 00000000..71b963f4 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/planmigrations/types/PreviewMigrationResponse.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.PlanVersionMigrationPreviewResponseData; +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 = PreviewMigrationResponse.Builder.class) +public final class PreviewMigrationResponse { + private final PlanVersionMigrationPreviewResponseData data; + + private final Map params; + + private final Map additionalProperties; + + private PreviewMigrationResponse( + PlanVersionMigrationPreviewResponseData data, + Map params, + Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public PlanVersionMigrationPreviewResponseData 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 PreviewMigrationResponse && equalTo((PreviewMigrationResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PreviewMigrationResponse 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 PlanVersionMigrationPreviewResponseData data); + + Builder from(PreviewMigrationResponse other); + } + + public interface _FinalStage { + PreviewMigrationResponse 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 PlanVersionMigrationPreviewResponseData data; + + private Map params = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PreviewMigrationResponse other) { + data(other.getData()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull PlanVersionMigrationPreviewResponseData 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 PreviewMigrationResponse build() { + return new PreviewMigrationResponse(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/types/BillingCreditGrantZeroedOutReason.java b/src/main/java/com/schematic/api/types/BillingCreditGrantZeroedOutReason.java index 04117ab2..96d9f707 100644 --- a/src/main/java/com/schematic/api/types/BillingCreditGrantZeroedOutReason.java +++ b/src/main/java/com/schematic/api/types/BillingCreditGrantZeroedOutReason.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class BillingCreditGrantZeroedOutReason { + public static final BillingCreditGrantZeroedOutReason LICENSE_RETIRED = + new BillingCreditGrantZeroedOutReason(Value.LICENSE_RETIRED, "license_retired"); + public static final BillingCreditGrantZeroedOutReason INTEGRATION_UNINSTALLED = new BillingCreditGrantZeroedOutReason(Value.INTEGRATION_UNINSTALLED, "integration_uninstalled"); @@ -61,6 +64,8 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case LICENSE_RETIRED: + return visitor.visitLicenseRetired(); case INTEGRATION_UNINSTALLED: return visitor.visitIntegrationUninstalled(); case PLAN_CHANGE: @@ -84,6 +89,8 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static BillingCreditGrantZeroedOutReason valueOf(String value) { switch (value) { + case "license_retired": + return LICENSE_RETIRED; case "integration_uninstalled": return INTEGRATION_UNINSTALLED; case "plan_change": @@ -110,6 +117,8 @@ public enum Value { INTEGRATION_UNINSTALLED, + LICENSE_RETIRED, + MANUAL, PLAN_CHANGE, @@ -128,6 +137,8 @@ public interface Visitor { T visitIntegrationUninstalled(); + T visitLicenseRetired(); + T visitManual(); T visitPlanChange(); diff --git a/src/main/java/com/schematic/api/types/FeatureDetailResponseData.java b/src/main/java/com/schematic/api/types/FeatureDetailResponseData.java index a1f5dfdd..dca89321 100644 --- a/src/main/java/com/schematic/api/types/FeatureDetailResponseData.java +++ b/src/main/java/com/schematic/api/types/FeatureDetailResponseData.java @@ -26,6 +26,8 @@ public final class FeatureDetailResponseData { private final Optional billingLinkedResource; + private final Optional billingProduct; + private final OffsetDateTime createdAt; private final String description; @@ -42,6 +44,8 @@ public final class FeatureDetailResponseData { private final String id; + private final Optional licenseId; + private final Optional lifecyclePhase; private final Optional maintainer; @@ -62,10 +66,13 @@ public final class FeatureDetailResponseData { private final OffsetDateTime updatedAt; + private final Optional usageLimitTraitId; + private final Map additionalProperties; private FeatureDetailResponseData( Optional billingLinkedResource, + Optional billingProduct, OffsetDateTime createdAt, String description, Optional eventSubtype, @@ -74,6 +81,7 @@ private FeatureDetailResponseData( List flags, String icon, String id, + Optional licenseId, Optional lifecyclePhase, Optional maintainer, Optional maintainerAccountMemberId, @@ -84,8 +92,10 @@ private FeatureDetailResponseData( Optional trait, Optional traitId, OffsetDateTime updatedAt, + Optional usageLimitTraitId, Map additionalProperties) { this.billingLinkedResource = billingLinkedResource; + this.billingProduct = billingProduct; this.createdAt = createdAt; this.description = description; this.eventSubtype = eventSubtype; @@ -94,6 +104,7 @@ private FeatureDetailResponseData( this.flags = flags; this.icon = icon; this.id = id; + this.licenseId = licenseId; this.lifecyclePhase = lifecyclePhase; this.maintainer = maintainer; this.maintainerAccountMemberId = maintainerAccountMemberId; @@ -104,6 +115,7 @@ private FeatureDetailResponseData( this.trait = trait; this.traitId = traitId; this.updatedAt = updatedAt; + this.usageLimitTraitId = usageLimitTraitId; this.additionalProperties = additionalProperties; } @@ -112,6 +124,14 @@ public Optional getBillingLinkedResource() { return billingLinkedResource; } + /** + * @return The billing provider product that sells this feature in the current environment. Set for license features once they have been priced in a plan; a feature priced in several environments has a different product in each. + */ + @JsonProperty("billing_product") + public Optional getBillingProduct() { + return billingProduct; + } + @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; @@ -152,6 +172,14 @@ public String getId() { return id; } + /** + * @return The license sold through this feature. Set only on features of type license, and created automatically with them. + */ + @JsonProperty("license_id") + public Optional getLicenseId() { + return licenseId; + } + @JsonProperty("lifecycle_phase") public Optional getLifecyclePhase() { return lifecyclePhase; @@ -202,6 +230,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features. + */ + @JsonProperty("usage_limit_trait_id") + public Optional getUsageLimitTraitId() { + return usageLimitTraitId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -215,6 +251,7 @@ public Map getAdditionalProperties() { private boolean equalTo(FeatureDetailResponseData other) { return billingLinkedResource.equals(other.billingLinkedResource) + && billingProduct.equals(other.billingProduct) && createdAt.equals(other.createdAt) && description.equals(other.description) && eventSubtype.equals(other.eventSubtype) @@ -223,6 +260,7 @@ private boolean equalTo(FeatureDetailResponseData other) { && flags.equals(other.flags) && icon.equals(other.icon) && id.equals(other.id) + && licenseId.equals(other.licenseId) && lifecyclePhase.equals(other.lifecyclePhase) && maintainer.equals(other.maintainer) && maintainerAccountMemberId.equals(other.maintainerAccountMemberId) @@ -232,13 +270,15 @@ private boolean equalTo(FeatureDetailResponseData other) { && singularName.equals(other.singularName) && trait.equals(other.trait) && traitId.equals(other.traitId) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && usageLimitTraitId.equals(other.usageLimitTraitId); } @java.lang.Override public int hashCode() { return Objects.hash( this.billingLinkedResource, + this.billingProduct, this.createdAt, this.description, this.eventSubtype, @@ -247,6 +287,7 @@ public int hashCode() { this.flags, this.icon, this.id, + this.licenseId, this.lifecyclePhase, this.maintainer, this.maintainerAccountMemberId, @@ -256,7 +297,8 @@ public int hashCode() { this.singularName, this.trait, this.traitId, - this.updatedAt); + this.updatedAt, + this.usageLimitTraitId); } @java.lang.Override @@ -309,6 +351,13 @@ public interface _FinalStage { _FinalStage billingLinkedResource(BillingLinkedResourceResponseData billingLinkedResource); + /** + *

The billing provider product that sells this feature in the current environment. Set for license features once they have been priced in a plan; a feature priced in several environments has a different product in each.

+ */ + _FinalStage billingProduct(Optional billingProduct); + + _FinalStage billingProduct(BillingProductResponseData billingProduct); + _FinalStage eventSubtype(Optional eventSubtype); _FinalStage eventSubtype(String eventSubtype); @@ -323,6 +372,13 @@ public interface _FinalStage { _FinalStage addAllFlags(List flags); + /** + *

The license sold through this feature. Set only on features of type license, and created automatically with them.

+ */ + _FinalStage licenseId(Optional licenseId); + + _FinalStage licenseId(String licenseId); + _FinalStage lifecyclePhase(Optional lifecyclePhase); _FinalStage lifecyclePhase(FeatureLifecyclePhase lifecyclePhase); @@ -356,6 +412,13 @@ public interface _FinalStage { _FinalStage traitId(Optional traitId); _FinalStage traitId(String traitId); + + /** + *

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

+ */ + _FinalStage usageLimitTraitId(Optional usageLimitTraitId); + + _FinalStage usageLimitTraitId(String usageLimitTraitId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -382,6 +445,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional usageLimitTraitId = Optional.empty(); + private Optional traitId = Optional.empty(); private Optional trait = Optional.empty(); @@ -398,12 +463,16 @@ public static final class Builder private Optional lifecyclePhase = Optional.empty(); + private Optional licenseId = Optional.empty(); + private List flags = new ArrayList<>(); private Optional eventSummary = Optional.empty(); private Optional eventSubtype = Optional.empty(); + private Optional billingProduct = Optional.empty(); + private Optional billingLinkedResource = Optional.empty(); @JsonAnySetter @@ -414,6 +483,7 @@ private Builder() {} @java.lang.Override public Builder from(FeatureDetailResponseData other) { billingLinkedResource(other.getBillingLinkedResource()); + billingProduct(other.getBillingProduct()); createdAt(other.getCreatedAt()); description(other.getDescription()); eventSubtype(other.getEventSubtype()); @@ -422,6 +492,7 @@ public Builder from(FeatureDetailResponseData other) { flags(other.getFlags()); icon(other.getIcon()); id(other.getId()); + licenseId(other.getLicenseId()); lifecyclePhase(other.getLifecyclePhase()); maintainer(other.getMaintainer()); maintainerAccountMemberId(other.getMaintainerAccountMemberId()); @@ -432,6 +503,7 @@ public Builder from(FeatureDetailResponseData other) { trait(other.getTrait()); traitId(other.getTraitId()); updatedAt(other.getUpdatedAt()); + usageLimitTraitId(other.getUsageLimitTraitId()); return this; } @@ -484,6 +556,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

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

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

+ */ + @java.lang.Override + @JsonSetter(value = "usage_limit_trait_id", nulls = Nulls.SKIP) + public _FinalStage usageLimitTraitId(Optional usageLimitTraitId) { + this.usageLimitTraitId = usageLimitTraitId; + return this; + } + @java.lang.Override public _FinalStage traitId(String traitId) { this.traitId = Optional.ofNullable(traitId); @@ -599,6 +691,26 @@ public _FinalStage lifecyclePhase(Optional lifecyclePhase return this; } + /** + *

The license sold through this feature. Set only on features of type license, and created automatically with them.

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

The license sold through this feature. Set only on features of type license, and created automatically with them.

+ */ + @java.lang.Override + @JsonSetter(value = "license_id", nulls = Nulls.SKIP) + public _FinalStage licenseId(Optional licenseId) { + this.licenseId = licenseId; + return this; + } + @java.lang.Override public _FinalStage addAllFlags(List flags) { if (flags != null) { @@ -649,6 +761,26 @@ public _FinalStage eventSubtype(Optional eventSubtype) { return this; } + /** + *

The billing provider product that sells this feature in the current environment. Set for license features once they have been priced in a plan; a feature priced in several environments has a different product in each.

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

The billing provider product that sells this feature in the current environment. Set for license features once they have been priced in a plan; a feature priced in several environments has a different product in each.

+ */ + @java.lang.Override + @JsonSetter(value = "billing_product", nulls = Nulls.SKIP) + public _FinalStage billingProduct(Optional billingProduct) { + this.billingProduct = billingProduct; + return this; + } + @java.lang.Override public _FinalStage billingLinkedResource(BillingLinkedResourceResponseData billingLinkedResource) { this.billingLinkedResource = Optional.ofNullable(billingLinkedResource); @@ -666,6 +798,7 @@ public _FinalStage billingLinkedResource(Optional licenseId; + private final Optional lifecyclePhase; private final Optional maintainerAccountMemberId; @@ -60,6 +62,8 @@ public final class FeatureInPlanResponseData { private final OffsetDateTime updatedAt; + private final Optional usageLimitTraitId; + private final Map additionalProperties; private FeatureInPlanResponseData( @@ -72,6 +76,7 @@ private FeatureInPlanResponseData( List flags, String icon, String id, + Optional licenseId, Optional lifecyclePhase, Optional maintainerAccountMemberId, String name, @@ -81,6 +86,7 @@ private FeatureInPlanResponseData( Optional trait, Optional traitId, OffsetDateTime updatedAt, + Optional usageLimitTraitId, Map additionalProperties) { this.billingLinkedResource = billingLinkedResource; this.createdAt = createdAt; @@ -91,6 +97,7 @@ private FeatureInPlanResponseData( this.flags = flags; this.icon = icon; this.id = id; + this.licenseId = licenseId; this.lifecyclePhase = lifecyclePhase; this.maintainerAccountMemberId = maintainerAccountMemberId; this.name = name; @@ -100,6 +107,7 @@ private FeatureInPlanResponseData( this.trait = trait; this.traitId = traitId; this.updatedAt = updatedAt; + this.usageLimitTraitId = usageLimitTraitId; this.additionalProperties = additionalProperties; } @@ -148,6 +156,14 @@ public String getId() { return id; } + /** + * @return The license sold through this feature. Set only on features of type license, and created automatically with them. + */ + @JsonProperty("license_id") + public Optional getLicenseId() { + return licenseId; + } + @JsonProperty("lifecycle_phase") public Optional getLifecyclePhase() { return lifecyclePhase; @@ -193,6 +209,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features. + */ + @JsonProperty("usage_limit_trait_id") + public Optional getUsageLimitTraitId() { + return usageLimitTraitId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -214,6 +238,7 @@ private boolean equalTo(FeatureInPlanResponseData other) { && flags.equals(other.flags) && icon.equals(other.icon) && id.equals(other.id) + && licenseId.equals(other.licenseId) && lifecyclePhase.equals(other.lifecyclePhase) && maintainerAccountMemberId.equals(other.maintainerAccountMemberId) && name.equals(other.name) @@ -222,7 +247,8 @@ private boolean equalTo(FeatureInPlanResponseData other) { && singularName.equals(other.singularName) && trait.equals(other.trait) && traitId.equals(other.traitId) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && usageLimitTraitId.equals(other.usageLimitTraitId); } @java.lang.Override @@ -237,6 +263,7 @@ public int hashCode() { this.flags, this.icon, this.id, + this.licenseId, this.lifecyclePhase, this.maintainerAccountMemberId, this.name, @@ -245,7 +272,8 @@ public int hashCode() { this.singularName, this.trait, this.traitId, - this.updatedAt); + this.updatedAt, + this.usageLimitTraitId); } @java.lang.Override @@ -312,6 +340,13 @@ public interface _FinalStage { _FinalStage addAllFlags(List flags); + /** + *

The license sold through this feature. Set only on features of type license, and created automatically with them.

+ */ + _FinalStage licenseId(Optional licenseId); + + _FinalStage licenseId(String licenseId); + _FinalStage lifecyclePhase(Optional lifecyclePhase); _FinalStage lifecyclePhase(FeatureLifecyclePhase lifecyclePhase); @@ -341,6 +376,13 @@ public interface _FinalStage { _FinalStage traitId(Optional traitId); _FinalStage traitId(String traitId); + + /** + *

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

+ */ + _FinalStage usageLimitTraitId(Optional usageLimitTraitId); + + _FinalStage usageLimitTraitId(String usageLimitTraitId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -367,6 +409,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional usageLimitTraitId = Optional.empty(); + private Optional traitId = Optional.empty(); private Optional trait = Optional.empty(); @@ -381,6 +425,8 @@ public static final class Builder private Optional lifecyclePhase = Optional.empty(); + private Optional licenseId = Optional.empty(); + private List flags = new ArrayList<>(); private Optional eventSummary = Optional.empty(); @@ -405,6 +451,7 @@ public Builder from(FeatureInPlanResponseData other) { flags(other.getFlags()); icon(other.getIcon()); id(other.getId()); + licenseId(other.getLicenseId()); lifecyclePhase(other.getLifecyclePhase()); maintainerAccountMemberId(other.getMaintainerAccountMemberId()); name(other.getName()); @@ -414,6 +461,7 @@ public Builder from(FeatureInPlanResponseData other) { trait(other.getTrait()); traitId(other.getTraitId()); updatedAt(other.getUpdatedAt()); + usageLimitTraitId(other.getUsageLimitTraitId()); return this; } @@ -466,6 +514,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

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

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

+ */ + @java.lang.Override + @JsonSetter(value = "usage_limit_trait_id", nulls = Nulls.SKIP) + public _FinalStage usageLimitTraitId(Optional usageLimitTraitId) { + this.usageLimitTraitId = usageLimitTraitId; + return this; + } + @java.lang.Override public _FinalStage traitId(String traitId) { this.traitId = Optional.ofNullable(traitId); @@ -568,6 +636,26 @@ public _FinalStage lifecyclePhase(Optional lifecyclePhase return this; } + /** + *

The license sold through this feature. Set only on features of type license, and created automatically with them.

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

The license sold through this feature. Set only on features of type license, and created automatically with them.

+ */ + @java.lang.Override + @JsonSetter(value = "license_id", nulls = Nulls.SKIP) + public _FinalStage licenseId(Optional licenseId) { + this.licenseId = licenseId; + return this; + } + @java.lang.Override public _FinalStage addAllFlags(List flags) { if (flags != null) { @@ -643,6 +731,7 @@ public FeatureInPlanResponseData build() { flags, icon, id, + licenseId, lifecyclePhase, maintainerAccountMemberId, name, @@ -652,6 +741,7 @@ public FeatureInPlanResponseData build() { trait, traitId, updatedAt, + usageLimitTraitId, additionalProperties); } diff --git a/src/main/java/com/schematic/api/types/FeatureResponseData.java b/src/main/java/com/schematic/api/types/FeatureResponseData.java index 30cb75dc..36cf1146 100644 --- a/src/main/java/com/schematic/api/types/FeatureResponseData.java +++ b/src/main/java/com/schematic/api/types/FeatureResponseData.java @@ -34,6 +34,8 @@ public final class FeatureResponseData { private final String id; + private final Optional licenseId; + private final Optional lifecyclePhase; private final Optional maintainerAccountMemberId; @@ -48,6 +50,8 @@ public final class FeatureResponseData { private final OffsetDateTime updatedAt; + private final Optional usageLimitTraitId; + private final Map additionalProperties; private FeatureResponseData( @@ -57,6 +61,7 @@ private FeatureResponseData( FeatureType featureType, String icon, String id, + Optional licenseId, Optional lifecyclePhase, Optional maintainerAccountMemberId, String name, @@ -64,6 +69,7 @@ private FeatureResponseData( Optional singularName, Optional traitId, OffsetDateTime updatedAt, + Optional usageLimitTraitId, Map additionalProperties) { this.createdAt = createdAt; this.description = description; @@ -71,6 +77,7 @@ private FeatureResponseData( this.featureType = featureType; this.icon = icon; this.id = id; + this.licenseId = licenseId; this.lifecyclePhase = lifecyclePhase; this.maintainerAccountMemberId = maintainerAccountMemberId; this.name = name; @@ -78,6 +85,7 @@ private FeatureResponseData( this.singularName = singularName; this.traitId = traitId; this.updatedAt = updatedAt; + this.usageLimitTraitId = usageLimitTraitId; this.additionalProperties = additionalProperties; } @@ -111,6 +119,14 @@ public String getId() { return id; } + /** + * @return The license sold through this feature. Set only on features of type license, and created automatically with them. + */ + @JsonProperty("license_id") + public Optional getLicenseId() { + return licenseId; + } + @JsonProperty("lifecycle_phase") public Optional getLifecyclePhase() { return lifecyclePhase; @@ -146,6 +162,14 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } + /** + * @return Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features. + */ + @JsonProperty("usage_limit_trait_id") + public Optional getUsageLimitTraitId() { + return usageLimitTraitId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -164,13 +188,15 @@ private boolean equalTo(FeatureResponseData other) { && featureType.equals(other.featureType) && icon.equals(other.icon) && id.equals(other.id) + && licenseId.equals(other.licenseId) && lifecyclePhase.equals(other.lifecyclePhase) && maintainerAccountMemberId.equals(other.maintainerAccountMemberId) && name.equals(other.name) && pluralName.equals(other.pluralName) && singularName.equals(other.singularName) && traitId.equals(other.traitId) - && updatedAt.equals(other.updatedAt); + && updatedAt.equals(other.updatedAt) + && usageLimitTraitId.equals(other.usageLimitTraitId); } @java.lang.Override @@ -182,13 +208,15 @@ public int hashCode() { this.featureType, this.icon, this.id, + this.licenseId, this.lifecyclePhase, this.maintainerAccountMemberId, this.name, this.pluralName, this.singularName, this.traitId, - this.updatedAt); + this.updatedAt, + this.usageLimitTraitId); } @java.lang.Override @@ -241,6 +269,13 @@ public interface _FinalStage { _FinalStage eventSubtype(String eventSubtype); + /** + *

The license sold through this feature. Set only on features of type license, and created automatically with them.

+ */ + _FinalStage licenseId(Optional licenseId); + + _FinalStage licenseId(String licenseId); + _FinalStage lifecyclePhase(Optional lifecyclePhase); _FinalStage lifecyclePhase(FeatureLifecyclePhase lifecyclePhase); @@ -260,6 +295,13 @@ public interface _FinalStage { _FinalStage traitId(Optional traitId); _FinalStage traitId(String traitId); + + /** + *

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

+ */ + _FinalStage usageLimitTraitId(Optional usageLimitTraitId); + + _FinalStage usageLimitTraitId(String usageLimitTraitId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -286,6 +328,8 @@ public static final class Builder private OffsetDateTime updatedAt; + private Optional usageLimitTraitId = Optional.empty(); + private Optional traitId = Optional.empty(); private Optional singularName = Optional.empty(); @@ -296,6 +340,8 @@ public static final class Builder private Optional lifecyclePhase = Optional.empty(); + private Optional licenseId = Optional.empty(); + private Optional eventSubtype = Optional.empty(); @JsonAnySetter @@ -311,6 +357,7 @@ public Builder from(FeatureResponseData other) { featureType(other.getFeatureType()); icon(other.getIcon()); id(other.getId()); + licenseId(other.getLicenseId()); lifecyclePhase(other.getLifecyclePhase()); maintainerAccountMemberId(other.getMaintainerAccountMemberId()); name(other.getName()); @@ -318,6 +365,7 @@ public Builder from(FeatureResponseData other) { singularName(other.getSingularName()); traitId(other.getTraitId()); updatedAt(other.getUpdatedAt()); + usageLimitTraitId(other.getUsageLimitTraitId()); return this; } @@ -370,6 +418,26 @@ public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { return this; } + /** + *

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

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

Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.

+ */ + @java.lang.Override + @JsonSetter(value = "usage_limit_trait_id", nulls = Nulls.SKIP) + public _FinalStage usageLimitTraitId(Optional usageLimitTraitId) { + this.usageLimitTraitId = usageLimitTraitId; + return this; + } + @java.lang.Override public _FinalStage traitId(String traitId) { this.traitId = Optional.ofNullable(traitId); @@ -435,6 +503,26 @@ public _FinalStage lifecyclePhase(Optional lifecyclePhase return this; } + /** + *

The license sold through this feature. Set only on features of type license, and created automatically with them.

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

The license sold through this feature. Set only on features of type license, and created automatically with them.

+ */ + @java.lang.Override + @JsonSetter(value = "license_id", nulls = Nulls.SKIP) + public _FinalStage licenseId(Optional licenseId) { + this.licenseId = licenseId; + return this; + } + @java.lang.Override public _FinalStage eventSubtype(String eventSubtype) { this.eventSubtype = Optional.ofNullable(eventSubtype); @@ -457,6 +545,7 @@ public FeatureResponseData build() { featureType, icon, id, + licenseId, lifecyclePhase, maintainerAccountMemberId, name, @@ -464,6 +553,7 @@ public FeatureResponseData build() { singularName, traitId, updatedAt, + usageLimitTraitId, additionalProperties); } diff --git a/src/main/java/com/schematic/api/types/FeatureType.java b/src/main/java/com/schematic/api/types/FeatureType.java index e42c42c6..bd0177ca 100644 --- a/src/main/java/com/schematic/api/types/FeatureType.java +++ b/src/main/java/com/schematic/api/types/FeatureType.java @@ -13,6 +13,8 @@ public final class FeatureType { public static final FeatureType EVENT = new FeatureType(Value.EVENT, "event"); + public static final FeatureType LICENSE = new FeatureType(Value.LICENSE, "license"); + private final Value value; private final String string; @@ -50,6 +52,8 @@ public T visit(Visitor visitor) { return visitor.visitBoolean(); case EVENT: return visitor.visitEvent(); + case LICENSE: + return visitor.visitLicense(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -65,6 +69,8 @@ public static FeatureType valueOf(String value) { return BOOLEAN; case "event": return EVENT; + case "license": + return LICENSE; default: return new FeatureType(Value.UNKNOWN, value); } @@ -75,6 +81,8 @@ public enum Value { EVENT, + LICENSE, + TRAIT, UNKNOWN @@ -85,6 +93,8 @@ public interface Visitor { T visitEvent(); + T visitLicense(); + T visitTrait(); T visitUnknown(String unknownType); diff --git a/src/main/java/com/schematic/api/types/FeatureView.java b/src/main/java/com/schematic/api/types/FeatureView.java index ac015944..9abc1d84 100644 --- a/src/main/java/com/schematic/api/types/FeatureView.java +++ b/src/main/java/com/schematic/api/types/FeatureView.java @@ -28,6 +28,8 @@ public final class FeatureView { private final Optional billingLinkedResource; + private final Optional billingProduct; + private final OffsetDateTime createdAt; private final String description; @@ -44,6 +46,8 @@ public final class FeatureView { private final String id; + private final Optional licenseId; + private final Optional lifecyclePhase; private final String name; @@ -67,6 +71,7 @@ public final class FeatureView { private FeatureView( String accountId, Optional billingLinkedResource, + Optional billingProduct, OffsetDateTime createdAt, String description, Optional eventSubtype, @@ -75,6 +80,7 @@ private FeatureView( List flags, String icon, String id, + Optional licenseId, Optional lifecyclePhase, String name, List plans, @@ -87,6 +93,7 @@ private FeatureView( Map additionalProperties) { this.accountId = accountId; this.billingLinkedResource = billingLinkedResource; + this.billingProduct = billingProduct; this.createdAt = createdAt; this.description = description; this.eventSubtype = eventSubtype; @@ -95,6 +102,7 @@ private FeatureView( this.flags = flags; this.icon = icon; this.id = id; + this.licenseId = licenseId; this.lifecyclePhase = lifecyclePhase; this.name = name; this.plans = plans; @@ -117,6 +125,11 @@ public Optional getBillingLinkedResource() { return billingLinkedResource; } + @JsonProperty("billing_product") + public Optional getBillingProduct() { + return billingProduct; + } + @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; @@ -157,6 +170,11 @@ public String getId() { return id; } + @JsonProperty("license_id") + public Optional getLicenseId() { + return licenseId; + } + @JsonProperty("lifecycle_phase") public Optional getLifecyclePhase() { return lifecyclePhase; @@ -216,6 +234,7 @@ public Map getAdditionalProperties() { private boolean equalTo(FeatureView other) { return accountId.equals(other.accountId) && billingLinkedResource.equals(other.billingLinkedResource) + && billingProduct.equals(other.billingProduct) && createdAt.equals(other.createdAt) && description.equals(other.description) && eventSubtype.equals(other.eventSubtype) @@ -224,6 +243,7 @@ private boolean equalTo(FeatureView other) { && flags.equals(other.flags) && icon.equals(other.icon) && id.equals(other.id) + && licenseId.equals(other.licenseId) && lifecyclePhase.equals(other.lifecyclePhase) && name.equals(other.name) && plans.equals(other.plans) @@ -240,6 +260,7 @@ public int hashCode() { return Objects.hash( this.accountId, this.billingLinkedResource, + this.billingProduct, this.createdAt, this.description, this.eventSubtype, @@ -248,6 +269,7 @@ public int hashCode() { this.flags, this.icon, this.id, + this.licenseId, this.lifecyclePhase, this.name, this.plans, @@ -313,6 +335,10 @@ public interface _FinalStage { _FinalStage billingLinkedResource(BillingLinkedResourceResponseData billingLinkedResource); + _FinalStage billingProduct(Optional billingProduct); + + _FinalStage billingProduct(BillingProductResponseData billingProduct); + _FinalStage eventSubtype(Optional eventSubtype); _FinalStage eventSubtype(String eventSubtype); @@ -327,6 +353,10 @@ public interface _FinalStage { _FinalStage addAllFlags(List flags); + _FinalStage licenseId(Optional licenseId); + + _FinalStage licenseId(String licenseId); + _FinalStage lifecyclePhase(Optional lifecyclePhase); _FinalStage lifecyclePhase(FeatureLifecyclePhase lifecyclePhase); @@ -399,12 +429,16 @@ public static final class Builder private Optional lifecyclePhase = Optional.empty(); + private Optional licenseId = Optional.empty(); + private List flags = new ArrayList<>(); private Optional eventSummary = Optional.empty(); private Optional eventSubtype = Optional.empty(); + private Optional billingProduct = Optional.empty(); + private Optional billingLinkedResource = Optional.empty(); @JsonAnySetter @@ -416,6 +450,7 @@ private Builder() {} public Builder from(FeatureView other) { accountId(other.getAccountId()); billingLinkedResource(other.getBillingLinkedResource()); + billingProduct(other.getBillingProduct()); createdAt(other.getCreatedAt()); description(other.getDescription()); eventSubtype(other.getEventSubtype()); @@ -424,6 +459,7 @@ public Builder from(FeatureView other) { flags(other.getFlags()); icon(other.getIcon()); id(other.getId()); + licenseId(other.getLicenseId()); lifecyclePhase(other.getLifecyclePhase()); name(other.getName()); plans(other.getPlans()); @@ -594,6 +630,19 @@ public _FinalStage lifecyclePhase(Optional lifecyclePhase return this; } + @java.lang.Override + public _FinalStage licenseId(String licenseId) { + this.licenseId = Optional.ofNullable(licenseId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "license_id", nulls = Nulls.SKIP) + public _FinalStage licenseId(Optional licenseId) { + this.licenseId = licenseId; + return this; + } + @java.lang.Override public _FinalStage addAllFlags(List flags) { if (flags != null) { @@ -644,6 +693,19 @@ public _FinalStage eventSubtype(Optional eventSubtype) { return this; } + @java.lang.Override + public _FinalStage billingProduct(BillingProductResponseData billingProduct) { + this.billingProduct = Optional.ofNullable(billingProduct); + return this; + } + + @java.lang.Override + @JsonSetter(value = "billing_product", nulls = Nulls.SKIP) + public _FinalStage billingProduct(Optional billingProduct) { + this.billingProduct = billingProduct; + return this; + } + @java.lang.Override public _FinalStage billingLinkedResource(BillingLinkedResourceResponseData billingLinkedResource) { this.billingLinkedResource = Optional.ofNullable(billingLinkedResource); @@ -662,6 +724,7 @@ public FeatureView build() { return new FeatureView( accountId, billingLinkedResource, + billingProduct, createdAt, description, eventSubtype, @@ -670,6 +733,7 @@ public FeatureView build() { flags, icon, id, + licenseId, lifecyclePhase, name, plans, diff --git a/src/main/java/com/schematic/api/types/LicenseResponseData.java b/src/main/java/com/schematic/api/types/LicenseResponseData.java new file mode 100644 index 00000000..b74d7700 --- /dev/null +++ b/src/main/java/com/schematic/api/types/LicenseResponseData.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LicenseResponseData.Builder.class) +public final class LicenseResponseData { + private final OffsetDateTime createdAt; + + private final String id; + + private final String name; + + private final OffsetDateTime updatedAt; + + private final Map additionalProperties; + + private LicenseResponseData( + OffsetDateTime createdAt, + String id, + String name, + OffsetDateTime updatedAt, + Map additionalProperties) { + this.createdAt = createdAt; + this.id = id; + this.name = name; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LicenseResponseData && equalTo((LicenseResponseData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LicenseResponseData other) { + return createdAt.equals(other.createdAt) + && id.equals(other.id) + && name.equals(other.name) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.createdAt, this.id, this.name, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CreatedAtStage builder() { + return new Builder(); + } + + public interface CreatedAtStage { + IdStage createdAt(@NotNull OffsetDateTime createdAt); + + Builder from(LicenseResponseData other); + } + + public interface IdStage { + NameStage id(@NotNull String id); + } + + public interface NameStage { + UpdatedAtStage name(@NotNull String name); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + LicenseResponseData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CreatedAtStage, IdStage, NameStage, UpdatedAtStage, _FinalStage { + private OffsetDateTime createdAt; + + private String id; + + private String name; + + private OffsetDateTime updatedAt; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LicenseResponseData other) { + createdAt(other.getCreatedAt()); + id(other.getId()); + name(other.getName()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public IdStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public UpdatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public LicenseResponseData build() { + return new LicenseResponseData(createdAt, id, name, updatedAt, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewCompanyResponseData.java b/src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewCompanyResponseData.java new file mode 100644 index 00000000..0877e316 --- /dev/null +++ b/src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewCompanyResponseData.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PlanVersionMigrationPreviewCompanyResponseData.Builder.class) +public final class PlanVersionMigrationPreviewCompanyResponseData { + private final String companyId; + + private final boolean hasBillingChanges; + + private final boolean hasCustomPricing; + + private final Optional note; + + private final Optional planVersionIdFrom; + + private final boolean willUpdateSubscription; + + private final Map additionalProperties; + + private PlanVersionMigrationPreviewCompanyResponseData( + String companyId, + boolean hasBillingChanges, + boolean hasCustomPricing, + Optional note, + Optional planVersionIdFrom, + boolean willUpdateSubscription, + Map additionalProperties) { + this.companyId = companyId; + this.hasBillingChanges = hasBillingChanges; + this.hasCustomPricing = hasCustomPricing; + this.note = note; + this.planVersionIdFrom = planVersionIdFrom; + this.willUpdateSubscription = willUpdateSubscription; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("company_id") + public String getCompanyId() { + return companyId; + } + + @JsonProperty("has_billing_changes") + public boolean getHasBillingChanges() { + return hasBillingChanges; + } + + @JsonProperty("has_custom_pricing") + public boolean getHasCustomPricing() { + return hasCustomPricing; + } + + @JsonProperty("note") + public Optional getNote() { + return note; + } + + @JsonProperty("plan_version_id_from") + public Optional getPlanVersionIdFrom() { + return planVersionIdFrom; + } + + @JsonProperty("will_update_subscription") + public boolean getWillUpdateSubscription() { + return willUpdateSubscription; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PlanVersionMigrationPreviewCompanyResponseData + && equalTo((PlanVersionMigrationPreviewCompanyResponseData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PlanVersionMigrationPreviewCompanyResponseData other) { + return companyId.equals(other.companyId) + && hasBillingChanges == other.hasBillingChanges + && hasCustomPricing == other.hasCustomPricing + && note.equals(other.note) + && planVersionIdFrom.equals(other.planVersionIdFrom) + && willUpdateSubscription == other.willUpdateSubscription; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.hasBillingChanges, + this.hasCustomPricing, + this.note, + this.planVersionIdFrom, + this.willUpdateSubscription); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CompanyIdStage builder() { + return new Builder(); + } + + public interface CompanyIdStage { + HasBillingChangesStage companyId(@NotNull String companyId); + + Builder from(PlanVersionMigrationPreviewCompanyResponseData other); + } + + public interface HasBillingChangesStage { + HasCustomPricingStage hasBillingChanges(boolean hasBillingChanges); + } + + public interface HasCustomPricingStage { + WillUpdateSubscriptionStage hasCustomPricing(boolean hasCustomPricing); + } + + public interface WillUpdateSubscriptionStage { + _FinalStage willUpdateSubscription(boolean willUpdateSubscription); + } + + public interface _FinalStage { + PlanVersionMigrationPreviewCompanyResponseData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage note(Optional note); + + _FinalStage note(String note); + + _FinalStage planVersionIdFrom(Optional planVersionIdFrom); + + _FinalStage planVersionIdFrom(String planVersionIdFrom); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CompanyIdStage, + HasBillingChangesStage, + HasCustomPricingStage, + WillUpdateSubscriptionStage, + _FinalStage { + private String companyId; + + private boolean hasBillingChanges; + + private boolean hasCustomPricing; + + private boolean willUpdateSubscription; + + private Optional planVersionIdFrom = Optional.empty(); + + private Optional note = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PlanVersionMigrationPreviewCompanyResponseData other) { + companyId(other.getCompanyId()); + hasBillingChanges(other.getHasBillingChanges()); + hasCustomPricing(other.getHasCustomPricing()); + note(other.getNote()); + planVersionIdFrom(other.getPlanVersionIdFrom()); + willUpdateSubscription(other.getWillUpdateSubscription()); + return this; + } + + @java.lang.Override + @JsonSetter("company_id") + public HasBillingChangesStage companyId(@NotNull String companyId) { + this.companyId = Objects.requireNonNull(companyId, "companyId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_billing_changes") + public HasCustomPricingStage hasBillingChanges(boolean hasBillingChanges) { + this.hasBillingChanges = hasBillingChanges; + return this; + } + + @java.lang.Override + @JsonSetter("has_custom_pricing") + public WillUpdateSubscriptionStage hasCustomPricing(boolean hasCustomPricing) { + this.hasCustomPricing = hasCustomPricing; + return this; + } + + @java.lang.Override + @JsonSetter("will_update_subscription") + public _FinalStage willUpdateSubscription(boolean willUpdateSubscription) { + this.willUpdateSubscription = willUpdateSubscription; + return this; + } + + @java.lang.Override + public _FinalStage planVersionIdFrom(String planVersionIdFrom) { + this.planVersionIdFrom = Optional.ofNullable(planVersionIdFrom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "plan_version_id_from", nulls = Nulls.SKIP) + public _FinalStage planVersionIdFrom(Optional planVersionIdFrom) { + this.planVersionIdFrom = planVersionIdFrom; + return this; + } + + @java.lang.Override + public _FinalStage note(String note) { + this.note = Optional.ofNullable(note); + return this; + } + + @java.lang.Override + @JsonSetter(value = "note", nulls = Nulls.SKIP) + public _FinalStage note(Optional note) { + this.note = note; + return this; + } + + @java.lang.Override + public PlanVersionMigrationPreviewCompanyResponseData build() { + return new PlanVersionMigrationPreviewCompanyResponseData( + companyId, + hasBillingChanges, + hasCustomPricing, + note, + planVersionIdFrom, + willUpdateSubscription, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewResponseData.java b/src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewResponseData.java new file mode 100644 index 00000000..4d0c908f --- /dev/null +++ b/src/main/java/com/schematic/api/types/PlanVersionMigrationPreviewResponseData.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.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 = PlanVersionMigrationPreviewResponseData.Builder.class) +public final class PlanVersionMigrationPreviewResponseData { + private final List companies; + + private final Map additionalProperties; + + private PlanVersionMigrationPreviewResponseData( + List companies, Map additionalProperties) { + this.companies = companies; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("companies") + public List getCompanies() { + return companies; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PlanVersionMigrationPreviewResponseData + && equalTo((PlanVersionMigrationPreviewResponseData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PlanVersionMigrationPreviewResponseData other) { + return companies.equals(other.companies); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.companies); + } + + @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 companies = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PlanVersionMigrationPreviewResponseData other) { + companies(other.getCompanies()); + return this; + } + + @JsonSetter(value = "companies", nulls = Nulls.SKIP) + public Builder companies(List companies) { + this.companies.clear(); + if (companies != null) { + this.companies.addAll(companies); + } + return this; + } + + public Builder addCompanies(PlanVersionMigrationPreviewCompanyResponseData companies) { + this.companies.add(companies); + return this; + } + + public Builder addAllCompanies(List companies) { + if (companies != null) { + this.companies.addAll(companies); + } + return this; + } + + public PlanVersionMigrationPreviewResponseData build() { + return new PlanVersionMigrationPreviewResponseData(companies, 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; + } + } +} From c789fe6d1ea5a45cc54996f13392c3a7e8f43c64 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 18:19:48 +0000 Subject: [PATCH 2/2] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 058ad905..b9fd14ac 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -18,5 +18,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-java-sdk: 4.11.1 -current_generation: 87b3adbf90d3b4093f69cfd08816d754d3d328ef + - commit_sha: 89360cf8750d3589d707ec7f8402d9858ed819eb + tree_hash: ab4b1afbfba8fb95bd586a3486f360ec9d842420 + timestamp: 2026-07-27T18:19:46.148Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 4.11.1 +current_generation: 89360cf8750d3589d707ec7f8402d9858ed819eb patches: []